Add Logseq cheatsheets: syntax, queries, datalog schema - #100
Draft
alycda wants to merge 1 commit into
Draft
Conversation
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
Contributor
⊕ Entity-level changestools/cheat/README.md
tools/cheat/cheatsheets/community/logseq/config
tools/cheat/cheatsheets/community/logseq/datalog
tools/cheat/cheatsheets/community/logseq/db-version
tools/cheat/cheatsheets/community/logseq/keys
tools/cheat/cheatsheets/community/logseq/query
tools/cheat/cheatsheets/community/logseq/schema
tools/cheat/cheatsheets/community/logseq/syntax
tools/cheat/cheatsheets/community/logseq/tasks
Summary: 32 added, 1 modified across 9 files functions and classes, not lines · sem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Logseq is absent from the upstream cheat/cheatsheets repo — verified,
raw.githubusercontent.com/cheat/cheatsheets/master/logseq404s, as dodatalog,datascript, andobsidian. That repo is scoped to CLI tools, so a GUI outliner was never going to land there. Good fit for our owncommunity/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.syntaxkey:: valueproperties, trigger chars, macros, templates, KaTeXtasks[#A], SCHEDULED/DEADLINE, the three repeater kinds (.++++)query{{query}}simple DSL,query-table::,{{function (sum :price)}}datalog:inputs, worked examples, custom:rulesschema:block/*attributes + built-in rule signatureskeys:shortcutsrebinding syntaxconfig:macros,:default-queriesdb-versionNotes
db-versionis 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-refsreplaced 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 onecheataway than to debug it.Content is grounded in
logseq/docsat master plus the 0.10.9 source (deps/db/src/logseq/db/{schema.cljs,rules.cljc}andsrc/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.mdgains one line in the structure listing.Testing
No Nix changes —
home-manager/modules/tools/cheat.nixpoints at the directory, so new sheets are picked up on the next switch with nothing to wire up. Lint/check jobs are unaffected (no.nixfiles touched).Worth a skim for accuracy before merge, especially the shortcut table.
Generated by Claude Code