Add docs
This commit is contained in:
parent
287c94e246
commit
b79801a1d7
6 changed files with 47 additions and 5 deletions
1
docs/.gitignore
vendored
Normal file
1
docs/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
book
|
6
docs/book.toml
Normal file
6
docs/book.toml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[book]
|
||||||
|
authors = ["Michael Zhang"]
|
||||||
|
language = "en"
|
||||||
|
multilingual = false
|
||||||
|
src = "src"
|
||||||
|
title = "mznotes documentation"
|
5
docs/src/SUMMARY.md
Normal file
5
docs/src/SUMMARY.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Summary
|
||||||
|
|
||||||
|
## App Developers
|
||||||
|
|
||||||
|
- [`meta.json`](./app/meta_json.md)
|
3
docs/src/app/meta_json.md
Normal file
3
docs/src/app/meta_json.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# `meta.json`
|
||||||
|
|
||||||
|
`meta.json` is the entrypoint for installing an application.
|
|
@ -23,6 +23,7 @@
|
||||||
cargo-watch
|
cargo-watch
|
||||||
|
|
||||||
deno
|
deno
|
||||||
|
mdbook
|
||||||
|
|
||||||
(python310.withPackages (p: with p; [ ipython numpy scipy sympy ]))
|
(python310.withPackages (p: with p; [ ipython numpy scipy sympy ]))
|
||||||
]) ++ (with toolchain; [
|
]) ++ (with toolchain; [
|
||||||
|
|
|
@ -1,8 +1,29 @@
|
||||||
type NodeCreationRequest = {
|
interface ICreateNodeRequest {
|
||||||
};
|
/**
|
||||||
|
* A label for humans. This is not used by the database in any way, it's just
|
||||||
|
* something to print when debugging.
|
||||||
|
*/
|
||||||
|
label: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A mapping from labels to node creation requests.
|
||||||
|
*/
|
||||||
|
auxiliary_nodes: Map<string, ICreateNodeRequest>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A set of edges, using the IDs in auxiliary_nodes.
|
||||||
|
*/
|
||||||
|
edges: Set<ICreateEdgeRequest>;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ICreateEdgeRequest {
|
||||||
|
from_node: string;
|
||||||
|
to_node: string;
|
||||||
|
metadata: unknown;
|
||||||
|
}
|
||||||
|
|
||||||
export default class Database {
|
export default class Database {
|
||||||
public createNode(request: NodeCreationRequest): Node {
|
public createNode(request: ICreateNodeRequest): Node {
|
||||||
// TODO: Calculate the interfaces that must be implemented
|
// TODO: Calculate the interfaces that must be implemented
|
||||||
// - Use the interface application rules
|
// - Use the interface application rules
|
||||||
// - Insert them into the database
|
// - Insert them into the database
|
||||||
|
@ -13,11 +34,16 @@ export default class Database {
|
||||||
|
|
||||||
// TODO: Run pre-creation hooks
|
// TODO: Run pre-creation hooks
|
||||||
|
|
||||||
|
// TODO: Create all the nodes according to their requests
|
||||||
|
|
||||||
|
// TODO: Run all validations on all of the nodes
|
||||||
|
|
||||||
let node = new Node();
|
let node = new Node();
|
||||||
|
|
||||||
|
return node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Node {
|
export class Node {
|
||||||
public delete() {
|
public delete() {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue