Skip to content

Add Logseq cheatsheets: syntax, queries, datalog schema - #100

Draft
alycda wants to merge 1 commit into
mainfrom
claude/logseq-cheat-sheet-u0yp2f
Draft

Add Logseq cheatsheets: syntax, queries, datalog schema#100
alycda wants to merge 1 commit into
mainfrom
claude/logseq-cheat-sheet-u0yp2f

Conversation

@alycda

@alycda alycda commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Why

Logseq is absent from the upstream cheat/cheatsheets repo — verified, raw.githubusercontent.com/cheat/cheatsheets/master/logseq 404s, as do datalog, datascript, and obsidian. That repo is scoped to CLI tools, so a GUI outliner was never going to land there. Good fit for our own community/ tree instead.

What

Eight sheets under tools/cheat/cheatsheets/community/logseq/, split rather than one wall of text because the layers get reached for at different times — the plaintext syntax you type all day vs. the Datalog layer you only touch when a simple query runs out of road.

sheet contents
syntax refs, embeds, key:: value properties, trigger chars, macros, templates, KaTeX
tasks markers, [#A], SCHEDULED/DEADLINE, the three repeater kinds (.+ ++ +)
query the {{query}} simple DSL, query-table::, {{function (sum :price)}}
datalog advanced query shape, :inputs, worked examples, custom :rules
schema :block/* attributes + built-in rule signatures
keys default shortcuts and the :shortcuts rebinding syntax
config config.edn keys worth knowing, :macros, :default-queries
db-version how the DB rewrite renames all of the above

Notes

db-version is the sheet that earns its keep. Logseq's SQLite rewrite renames the entire query surface — :block/content:block/title, :block/marker:logseq.property/status, :block/path-refs replaced by a (has-ref) rule, (page-tags)(tags). Every advanced query on a blog or forum post assumes the file-based names, so a copy-pasted query returns empty with no error. Cheaper to keep the rename table one cheat away than to debug it.

Content is grounded in logseq/docs at master plus the 0.10.9 source (deps/db/src/logseq/db/{schema.cljs,rules.cljc} and src/main/frontend/modules/shortcut/config.cljs) rather than recall — the rule signatures in particular are easy to get subtly wrong, e.g. (task ?b #{"TODO"}) takes a set, not a string.

README.md gains one line in the structure listing.

Testing

No Nix changes — home-manager/modules/tools/cheat.nix points at the directory, so new sheets are picked up on the next switch with nothing to wire up. Lint/check jobs are unaffected (no .nix files touched).

Worth a skim for accuracy before merge, especially the shortcut table.


Generated by Claude Code

Logseq is absent from the upstream cheat/cheatsheets repo (verified:
raw.githubusercontent.com/cheat/cheatsheets/master/logseq 404s, as do
datalog/datascript/obsidian). That repo is scoped to CLI tools, so a GUI
outliner was never going to land there - which makes it a good fit for
our own community/ tree.

Split into eight sheets rather than one wall of text, because the two
halves of Logseq get reached for at different times: the plaintext syntax
you type all day, and the Datalog layer you only touch when a simple
query runs out of road.

- syntax     refs, embeds, properties, trigger chars, macros, templates
- tasks      markers, priorities, SCHEDULED/DEADLINE, repeater kinds
- query      the {{query}} simple DSL and its filters
- datalog    advanced query shape, inputs, worked examples, rules
- schema     :block/* attributes + the built-in rule signatures
- keys       default shortcuts and the :shortcuts rebinding syntax
- config     config.edn keys worth knowing
- db-version how the DB rewrite renames all of the above

Content is grounded in logseq/docs at master plus the 0.10.9 source
(deps/db/src/logseq/db/{schema.cljs,rules.cljc} and the shortcut config),
not from memory - the rule signatures in particular are easy to get
subtly wrong, e.g. (task ?b #{"TODO"}) takes a set, not a string.

The db-version sheet exists because it is the sharpest trap here: every
advanced query on a blog or forum post assumes :block/content and
:block/marker, and those are :block/title and :logseq.property/status in
a DB graph. Cheaper to keep the rename table one `cheat` away than to
debug a silently-empty query.

No Nix changes needed - modules/tools/cheat.nix points at the directory,
so new sheets are picked up on the next switch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cp77FqaFeATGNvaWnLxz96
@github-actions

Copy link
Copy Markdown
Contributor

⊕ Entity-level changes

tools/cheat/README.md

Status Type Name
Δ heading Structure

tools/cheat/cheatsheets/community/logseq/config

Status Type Name
+ chunk lines 1-20
+ chunk lines 21-40
+ chunk lines 41-60
+ chunk lines 61-80
+ chunk lines 81-82

tools/cheat/cheatsheets/community/logseq/datalog

Status Type Name
+ chunk lines 1-20
+ chunk lines 21-40
+ chunk lines 41-60
+ chunk lines 61-80
+ chunk lines 81-100
+ chunk lines 101-102

tools/cheat/cheatsheets/community/logseq/db-version

Status Type Name
+ chunk lines 1-20
+ chunk lines 21-40
+ chunk lines 41-50

tools/cheat/cheatsheets/community/logseq/keys

Status Type Name
+ chunk lines 1-20
+ chunk lines 21-40
+ chunk lines 41-60
+ chunk lines 61-62

tools/cheat/cheatsheets/community/logseq/query

Status Type Name
+ chunk lines 1-20
+ chunk lines 21-40
+ chunk lines 41-49

tools/cheat/cheatsheets/community/logseq/schema

Status Type Name
+ chunk lines 1-20
+ chunk lines 21-40
+ chunk lines 41-60
+ chunk lines 61-66

tools/cheat/cheatsheets/community/logseq/syntax

Status Type Name
+ chunk lines 1-20
+ chunk lines 21-40
+ chunk lines 41-60
+ chunk lines 61-77

tools/cheat/cheatsheets/community/logseq/tasks

Status Type Name
+ chunk lines 1-20
+ chunk lines 21-40
+ chunk lines 41-43

Summary: 32 added, 1 modified across 9 files

functions and classes, not lines · sem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant