|
|
2 年之前 | |
|---|---|---|
| .. | ||
| src | 2 年之前 | |
| .gitignore | 2 年之前 | |
| README.md | 2 年之前 | |
| build-ios.sh | 2 年之前 | |
| bump-version.sh | 2 年之前 | |
| get-pkg-version.js | 2 年之前 | |
| nbb.edn | 2 年之前 | |
| package.json | 2 年之前 | |
| patch-xcode-project.sh | 2 年之前 | |
| publishing.sh | 4 年之前 | |
| yarn.lock | 2 年之前 | |
This is a collection of development related scripts, written as bash scripts, bb/babashka scripts and nbb scripts.
Most bb scripts live under src/ and are defined as bb tasks. See babashka tasks
Before running nbb-logseq scripts, be sure to have node >= 18.14 installed as well as a recent babashka for managing the dependencies in nbb.edn. Then yarn install to install dependencies
For database graphs, it is possible to create graphs with the
logseq.tasks.db-graph.create-graph
ns. This ns makes it easy to write scripts that create graphs by supporting a
concise EDN map for graph generation. For example, the
create_graph_with_properties.cljs script uses this ns to create a graph with
a variety of properties:
$ yarn nbb-logseq src/logseq/tasks/db_graph/create_graph_with_properties.cljs woot
Generating 16 pages and 24 blocks ...
Created graph woot!
This script creates a DB graph with blocks containing several property types for both single and many cardinality. It also includes queries for most of these properties. Read the docs in logseq.tasks.db-graph.create-graph for specifics on the EDN map.
For database graphs, it is possible to update graphs with the
logseq.tasks.db-graph.persist-graph
ns. This ns makes it easy to write scripts that update graphs using datascript
and logseq's schema. For example, the update_graph_to_add_todos.cljs script
uses this ns to update blocks with a specified query with a TODO task marker:
$ yarn -s nbb-logseq src/logseq/tasks/db_graph/update_graph_to_add_todos.cljs woot '[:find (pull ?b [*]) :where (has-property ?b :url-many)]'
Updated 1 block(s) with a 'TODO' for graph woot!
This script updates a DB graph by finding all blocks that match the given
property query and marking them as TODO.