logseq/scripts
Gabriel Horner 0f4cdbbadf bump outdated nbb-logseq and fix lint 2023-12-11 15:55:38 -05:00
..
resources First pass at a script that creates a db graph with schema.org ontology 2023-08-30 16:15:46 -04:00
src/logseq/tasks enhance: bring back built-in properties using closed values 2023-12-04 17:29:41 -05:00
.gitignore Finish migration of publishing to deps 2023-04-09 23:13:33 +08:00
README.md First pass at a general transact script for db graphs 2023-10-27 17:40:12 -04:00
build-ios.sh chore: bump to 0.8.12 2022-11-23 21:09:29 +08:00
bump-version.sh Added a configuration to specify a build version different than the release version 2023-07-02 23:41:03 +08:00
deps.edn fix: create graph script not working 2023-09-05 16:10:31 -04:00
get-pkg-version.js chore(scripts): use prerelease style alpha version num 2023-09-07 11:37:19 +08:00
nbb.edn Move db malli schema into db dep since it's stable 2023-10-11 08:40:26 -04:00
package.json bump nbb-logseq to first version 2023-12-11 13:52:15 -05:00
patch-xcode-project.sh ci(ios): testflight build workflow 2022-11-25 10:17:05 +08:00
publishing.sh chore: add publishing.sh 2021-03-01 21:08:01 +08:00
yarn.lock bump outdated nbb-logseq and fix lint 2023-12-11 15:55:38 -05:00

README.md

Description

This is a collection of development related scripts, written as bash scripts, bb/babashka scripts and nbb scripts.

Usage

Babashka scripts

Most bb scripts live under src/ and are defined as bb tasks. See babashka tasks

Nbb scripts

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

Create graph scripts

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.

Another example is the create_graph_with_schema_org.cljs script which creates a graph with the https://schema.org/ ontology with as many of the classes and properties as possible:

$ yarn -s nbb-logseq src/logseq/tasks/db_graph/create_graph_with_schema_org.cljs schema
Skipping 67 superseded properties
Skipping 25 properties with unsupported data types
Renaming 44 classes due to page name conflicts
Generating 2268 pages with 900 classes and 1368 properties ...
Created graph schema!

Update graph scripts

For database graphs, it is possible to update graphs with the logseq.outliner.cli.persist-graph. ns. This ns makes it easy to write scripts that update graphs using datascript and logseq's schema. TODO