From 5afd06dfe8e10f4f2da2b16cb5b43f342330cc37 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Thu, 30 Mar 2023 00:55:56 -0500 Subject: [PATCH] build docs --- .woodpecker.yml | 18 ++++++++++++++++++ Makefile | 2 +- ci/build-docs.sh | 4 ++++ design.md | 28 +++++++++++++++++++++++++++- docs/book.toml | 4 ++-- flake.nix | 43 ++++++++++++++++++++++++------------------- prisma/schema.prisma | 2 +- spec/meta.schema.yml | 2 +- 8 files changed, 78 insertions(+), 25 deletions(-) create mode 100644 .woodpecker.yml create mode 100755 ci/build-docs.sh diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..99a1500 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,18 @@ +pipeline: + build: + image: nixos/nix + commands: + - mdbook + + deploy: + image: alpine + commands: + - apk add rsync openssh + - echo "$${SSH_SECRET_KEY}" > SSH_SECRET_KEY + - chmod 600 SSH_SECRET_KEY + - mkdir -p ~/.ssh + - echo "mzhang.io ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBzBZ+QmM4EO3Fwc1ZcvWV2IY9VF04T0H9brorGj9Udp" >> ~/.ssh/known_hosts + - rsync -azvrP -e "ssh -i SSH_SECRET_KEY" docs/book/ sourcehutBuilds@mzhang.io:/mnt/storage/svcdata/blog-public/panorama + secrets: [SSH_SECRET_KEY] + when: + branch: master diff --git a/Makefile b/Makefile index 4fed1f6..7d6f5a6 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ doc-dependencies: docs/src/generated/spec/index.md generated/spec/meta.schema.json: spec/meta.schema.yml mkdir -p generated/spec - yq -o json . $< > $@ + yq -o=json . $< > $@ docs/src/generated/spec/index.md: generated/spec/meta.schema.json mkdir -p docs/src/generated/spec diff --git a/ci/build-docs.sh b/ci/build-docs.sh new file mode 100755 index 0000000..6318b05 --- /dev/null +++ b/ci/build-docs.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p mdbook + +mdbook build docs diff --git a/design.md b/design.md index f9d9cf0..c6bbb4b 100644 --- a/design.md +++ b/design.md @@ -37,6 +37,16 @@ - The privileged namespace is for keeping track of database state, for example which scripts are trusted + - Hooks: + + - Hooks consist of a (pattern, type, callback). The pattern is a metadata + matcher, that determines if the node should be executed upon. The + callback is Javascript code executed in the app's execution context. + + - Type determines what kind of callback to call. + - Ensures callbacks: these make sure that a node has + - + - Database service: - IFTTT Events @@ -60,9 +70,25 @@ - Sample apps + - Todos app + + - Metadata keys (these are somewhat based on Taskwarrior) + + - `status`: Enum{Pending | Deleted | Completed | Waiting | Recurring} + - Task status + - `description`: String + - Description + - `start`: DateTime + - `due`: DateTime{.due >= .start} + - `depends`: NodeRef + + - Interfaces: + + - + - Content / blob storage - - Exposed interfaces + - Interfaces: - `Content` - `upload() -> Writer` diff --git a/docs/book.toml b/docs/book.toml index e812a89..68685ca 100644 --- a/docs/book.toml +++ b/docs/book.toml @@ -8,5 +8,5 @@ title = "mznotes documentation" [output.html] additional-css = ["custom.css"] -[preprocessor.tera] -command = "docs/make-then-tera.sh" +# [preprocessor.tera] +# command = "docs/make-then-tera.sh" diff --git a/flake.nix b/flake.nix index 2b2f8c6..86d1c0d 100644 --- a/flake.nix +++ b/flake.nix @@ -32,29 +32,34 @@ in rec { packages = flake-utils.lib.flattenTree flakePkgs; - devShell = pkgs.mkShell ({ - packages = with pkgs; [ - cargo-deny - cargo-edit - cargo-expand - cargo-flamegraph - cargo-watch + devShells = { + default = pkgs.mkShell ({ + packages = with pkgs; [ + cargo-deny + cargo-edit + cargo-expand + cargo-flamegraph + cargo-watch - deno - openssl - yq + deno + openssl + yq - mdbook - flakePkgs.mdbook-tera + mdbook + flakePkgs.mdbook-tera - (python310.withPackages (p: with p; [ ipython numpy scipy sympy ])) + (python310.withPackages + (p: with p; [ ipython numpy scipy sympy ])) - pkgs.fenix.minimal.cargo - pkgs.fenix.minimal.rustc + pkgs.fenix.minimal.cargo + pkgs.fenix.minimal.rustc - # Get the nightly version of rustfmt so we can wrap comments - pkgs.fenix.default.rustfmt - ]; - } // prisma-env); + # Get the nightly version of rustfmt so we can wrap comments + pkgs.fenix.default.rustfmt + ]; + } // prisma-env); + + ci = pkgs.mkShell { packages = with pkgs; [ bash mdbook nodejs ]; }; + }; }); } diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 1c85cde..1ec06ef 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -39,7 +39,7 @@ model Edge { model NodeMeta { nodeId String - toNode Node @relation(fields: [nodeId], references: [id]) + node Node @relation(fields: [nodeId], references: [id]) appId String app App @relation(fields: [appId], references: [id]) diff --git a/spec/meta.schema.yml b/spec/meta.schema.yml index b945e50..53b256e 100644 --- a/spec/meta.schema.yml +++ b/spec/meta.schema.yml @@ -3,6 +3,7 @@ $schema: "http://json-schema.org/draft-07/schema" title: Application type: object additionalProperties: false +required: ['title'] properties: $schema: @@ -11,7 +12,6 @@ properties: title: type: string - required: true title: Name of the application authors: