secondbrain-py 0.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- brain/__init__.py +0 -0
- brain/__main__.py +18 -0
- brain/_capture_command.py +445 -0
- brain/_compose.py +52 -0
- brain/activity.py +206 -0
- brain/ask.py +631 -0
- brain/audio.py +591 -0
- brain/backfill/__init__.py +12 -0
- brain/backfill/search_extras.py +141 -0
- brain/backfill/source_rows.py +101 -0
- brain/bin/__init__.py +1 -0
- brain/bin/_launcher.py +107 -0
- brain/bin/down.py +8 -0
- brain/bin/launchd.py +268 -0
- brain/bin/monitor.py +570 -0
- brain/bin/rebuild.py +8 -0
- brain/bin/status.py +8 -0
- brain/bin/up.py +8 -0
- brain/brief.py +272 -0
- brain/capture.py +49 -0
- brain/chat.py +293 -0
- brain/cli.py +9760 -0
- brain/cli_claude.py +81 -0
- brain/cli_connect.py +285 -0
- brain/cli_demo.py +266 -0
- brain/config.py +1949 -0
- brain/connect.py +925 -0
- brain/db.py +540 -0
- brain/demo/__init__.py +452 -0
- brain/demo/corpus/manifest.json +403 -0
- brain/demo/embedder.py +74 -0
- brain/durations.py +84 -0
- brain/edit_session.py +156 -0
- brain/editor.py +67 -0
- brain/elicit/__init__.py +16 -0
- brain/elicit/detectors.py +250 -0
- brain/elicit/drafter.py +70 -0
- brain/elicit/queue.py +220 -0
- brain/elicit/schema.py +48 -0
- brain/elicit/session.py +445 -0
- brain/embedding_targets.py +54 -0
- brain/embeddings.py +424 -0
- brain/enrichment.py +808 -0
- brain/errors.py +357 -0
- brain/eval/__init__.py +129 -0
- brain/eval/answer_eval.py +281 -0
- brain/eval/baseline.py +265 -0
- brain/eval/concept_extraction.py +378 -0
- brain/eval/corpus.py +152 -0
- brain/eval/errors.py +19 -0
- brain/eval/graph_baseline.py +226 -0
- brain/eval/graph_retrieval.py +202 -0
- brain/eval/graph_runner.py +319 -0
- brain/eval/metrics.py +101 -0
- brain/eval/runner.py +223 -0
- brain/format.py +783 -0
- brain/gaps.py +390 -0
- brain/graph_rag/__init__.py +94 -0
- brain/graph_rag/_retrieval_common.py +113 -0
- brain/graph_rag/aggregates.py +303 -0
- brain/graph_rag/aliases/__init__.py +583 -0
- brain/graph_rag/backends/__init__.py +10 -0
- brain/graph_rag/backends/_age_helpers.py +473 -0
- brain/graph_rag/backends/age.py +782 -0
- brain/graph_rag/backends/base.py +272 -0
- brain/graph_rag/build.py +344 -0
- brain/graph_rag/communities.py +644 -0
- brain/graph_rag/communities_summary.py +437 -0
- brain/graph_rag/concepts.py +202 -0
- brain/graph_rag/cooccur.py +193 -0
- brain/graph_rag/cross_type.py +312 -0
- brain/graph_rag/extract.py +885 -0
- brain/graph_rag/fuse.py +371 -0
- brain/graph_rag/global_.py +412 -0
- brain/graph_rag/grouping.py +372 -0
- brain/graph_rag/person_resolver.py +167 -0
- brain/graph_rag/reconcile.py +792 -0
- brain/graph_rag/relational.py +353 -0
- brain/graph_rag/retrieve.py +526 -0
- brain/graph_rag/router.py +288 -0
- brain/graph_rag/schema.py +320 -0
- brain/graph_rag/sync.py +237 -0
- brain/graph_rag/tenancy.py +43 -0
- brain/graph_rag/themes.py +501 -0
- brain/graph_rag/weighting.py +202 -0
- brain/ingest/__init__.py +1926 -0
- brain/ingest/chunker.py +249 -0
- brain/ingest/docx.py +40 -0
- brain/ingest/gmail.py +621 -0
- brain/ingest/markdown.py +37 -0
- brain/ingest/pdf.py +61 -0
- brain/ingest/stdin.py +22 -0
- brain/ingest/sub_tokens.py +91 -0
- brain/ingest/text.py +16 -0
- brain/interactions.py +205 -0
- brain/maintenance.py +355 -0
- brain/mcp_server.py +3405 -0
- brain/migrations/001_init.sql +43 -0
- brain/migrations/002_qwen3_embedding.sql +17 -0
- brain/migrations/003_vault_model.sql +41 -0
- brain/migrations/004_relax_content_hash_uniqueness.sql +18 -0
- brain/migrations/005_derived_links.sql +67 -0
- brain/migrations/006_dedup_file_by_source_path.sql +25 -0
- brain/migrations/007_email_thread_and_draft.sql +15 -0
- brain/migrations/008_gmail_thread_unique.sql +11 -0
- brain/migrations/009_chunks_weighted_tsv.sql +28 -0
- brain/migrations/010_interactions.sql +30 -0
- brain/migrations/011_documents_summary.sql +23 -0
- brain/migrations/012_graphrag.sql +171 -0
- brain/migrations/013_graphrag_communities.sql +125 -0
- brain/migrations/014_graphrag_community_summary_hash.sql +33 -0
- brain/migrations/015_interactions_graph_targets.sql +89 -0
- brain/migrations/016_index_hygiene.sql +61 -0
- brain/migrations/017_elicit.sql +30 -0
- brain/migrations/018_review_gap_signal_kinds.sql +40 -0
- brain/migrations/019_search_queries.sql +35 -0
- brain/migrations/020_link_suggestions.sql +40 -0
- brain/migrations/021_timeline_doc_date.sql +34 -0
- brain/migrations/022_link_suggestions_undirected.sql +84 -0
- brain/migrations/023_search_queries_fts_count.sql +28 -0
- brain/quartz_overrides/__init__.py +8 -0
- brain/quartz_overrides/quartz/bootstrap-cli.mjs +65 -0
- brain/quartz_overrides/quartz/build.ts +568 -0
- brain/quartz_overrides/quartz/cli/args.js +152 -0
- brain/quartz_overrides/quartz/cli/build_partial_handler.js +544 -0
- brain/quartz_overrides/quartz/cli/handlers.js +636 -0
- brain/quartz_overrides/quartz/components/CommandPalette.tsx +172 -0
- brain/quartz_overrides/quartz/components/Explorer.tsx +198 -0
- brain/quartz_overrides/quartz/components/Footer.tsx +27 -0
- brain/quartz_overrides/quartz/components/Graph.tsx +468 -0
- brain/quartz_overrides/quartz/components/PageTitle.tsx +72 -0
- brain/quartz_overrides/quartz/components/RelatedDocs.tsx +38 -0
- brain/quartz_overrides/quartz/components/Search.tsx +161 -0
- brain/quartz_overrides/quartz/components/SummaryLede.tsx +72 -0
- brain/quartz_overrides/quartz/components/index.ts +92 -0
- brain/quartz_overrides/quartz/components/pages/TagContent.tsx +272 -0
- brain/quartz_overrides/quartz/components/scripts/commandPalette.inline.ts +665 -0
- brain/quartz_overrides/quartz/components/scripts/explorer.inline.ts +768 -0
- brain/quartz_overrides/quartz/components/scripts/graph.inline.ts +2302 -0
- brain/quartz_overrides/quartz/components/scripts/relatedDocs.inline.ts +163 -0
- brain/quartz_overrides/quartz/components/scripts/search.inline.ts +1011 -0
- brain/quartz_overrides/quartz/plugins/emitters/contentIndex.ts +546 -0
- brain/quartz_overrides/quartz/plugins/transformers/codeCopy.ts +94 -0
- brain/quartz_overrides/quartz/plugins/transformers/derivedFenceMark.ts +302 -0
- brain/quartz_overrides/quartz/plugins/transformers/emailThread.ts +148 -0
- brain/quartz_overrides/quartz/plugins/transformers/emptyDoorFilter.ts +213 -0
- brain/quartz_overrides/quartz/plugins/transformers/index.ts +114 -0
- brain/quartz_overrides/quartz/plugins/transformers/linkKindMark.ts +205 -0
- brain/quartz_overrides/quartz/plugins/transformers/linkSourceTag.ts +104 -0
- brain/quartz_overrides/quartz/plugins/transformers/relativeDate.ts +100 -0
- brain/quartz_overrides/quartz/plugins/transformers/reloadSignal.ts +131 -0
- brain/quartz_overrides/quartz/processors/parse.ts +371 -0
- brain/quartz_overrides/quartz/processors/parser_cache.ts +78 -0
- brain/quartz_overrides/quartz/static/brain-logo-dark.png +0 -0
- brain/quartz_overrides/quartz/static/brain-logo-light.png +0 -0
- brain/quartz_overrides/quartz/static/codeCopy.js +196 -0
- brain/quartz_overrides/quartz/static/emailThread.js +334 -0
- brain/quartz_overrides/quartz/static/favicon.ico +0 -0
- brain/quartz_overrides/quartz/static/icon.png +0 -0
- brain/quartz_overrides/quartz/static/linkSourceTag.js +104 -0
- brain/quartz_overrides/quartz/static/relativeDate.js +142 -0
- brain/quartz_overrides/quartz/static/reload.js +168 -0
- brain/quartz_overrides/quartz/styles/brain/_article.scss +252 -0
- brain/quartz_overrides/quartz/styles/brain/_atmosphere.scss +113 -0
- brain/quartz_overrides/quartz/styles/brain/_callouts.scss +180 -0
- brain/quartz_overrides/quartz/styles/brain/_cmdk.scss +7 -0
- brain/quartz_overrides/quartz/styles/brain/_code.scss +208 -0
- brain/quartz_overrides/quartz/styles/brain/_command_palette.scss +369 -0
- brain/quartz_overrides/quartz/styles/brain/_email_thread.scss +228 -0
- brain/quartz_overrides/quartz/styles/brain/_explorer.scss +142 -0
- brain/quartz_overrides/quartz/styles/brain/_home.scss +182 -0
- brain/quartz_overrides/quartz/styles/brain/_links.scss +322 -0
- brain/quartz_overrides/quartz/styles/brain/_marginalia.scss +117 -0
- brain/quartz_overrides/quartz/styles/brain/_motion.scss +175 -0
- brain/quartz_overrides/quartz/styles/brain/_people_hub.scss +100 -0
- brain/quartz_overrides/quartz/styles/brain/_related_docs.scss +137 -0
- brain/quartz_overrides/quartz/styles/brain/_search.scss +252 -0
- brain/quartz_overrides/quartz/styles/brain/_sidebar.scss +468 -0
- brain/quartz_overrides/quartz/styles/brain/_summary_lede.scss +56 -0
- brain/quartz_overrides/quartz/styles/brain/_surface.scss +43 -0
- brain/quartz_overrides/quartz/styles/brain/_tag_content.scss +118 -0
- brain/quartz_overrides/quartz/styles/brain/_tokens.scss +197 -0
- brain/quartz_overrides/quartz/styles/brain/_typography.scss +92 -0
- brain/quartz_overrides/quartz/styles/custom.scss +89 -0
- brain/quartz_overrides/quartz/styles/graph.scss +505 -0
- brain/quartz_overrides/quartz/util/ctx.ts +92 -0
- brain/quartz_overrides/quartz/util/fastpath_manifest.ts +608 -0
- brain/quartz_overrides/quartz/util/path.ts +358 -0
- brain/quartz_overrides/quartz/util/sourceIcons.ts +55 -0
- brain/quartz_overrides/quartz.config.ts +270 -0
- brain/quartz_overrides/quartz.layout.ts +314 -0
- brain/queries.py +1188 -0
- brain/rank_fusion.py +8 -0
- brain/resurface.py +210 -0
- brain/review/__init__.py +26 -0
- brain/review/emit.py +27 -0
- brain/review/queries.py +436 -0
- brain/review/render.py +196 -0
- brain/review/scans.py +355 -0
- brain/review/weekly.py +413 -0
- brain/search.py +704 -0
- brain/set_similarity.py +15 -0
- brain/setup.py +1205 -0
- brain/tags.py +56 -0
- brain/templates/Caddyfile.j2 +9 -0
- brain/templates/__init__.py +1 -0
- brain/templates/bin/__init__.py +1 -0
- brain/templates/bin/_brain-brief-fg.sh +25 -0
- brain/templates/bin/_brain-build-fg.sh +53 -0
- brain/templates/bin/_brain-watcher-fg.sh +65 -0
- brain/templates/bin/brain-down.sh +89 -0
- brain/templates/bin/brain-status.sh +83 -0
- brain/templates/bin/brain-up.sh +221 -0
- brain/templates/docker/age/Dockerfile +79 -0
- brain/templates/docker-compose.stock.yml.j2 +26 -0
- brain/templates/docker-compose.yml.j2 +34 -0
- brain/templates/env.example +190 -0
- brain/templates/launchd/__init__.py +1 -0
- brain/templates/launchd/com.brain.brief.plist.j2 +45 -0
- brain/templates/launchd/com.brain.build.plist.j2 +46 -0
- brain/templates/launchd/com.brain.watcher.plist.j2 +46 -0
- brain/templates/skill/SKILL.md +63 -0
- brain/templates/skill/__init__.py +1 -0
- brain/timeline.py +834 -0
- brain/todo.py +124 -0
- brain/uninstall.py +185 -0
- brain/vault/__init__.py +115 -0
- brain/vault/_atomic.py +25 -0
- brain/vault/daily_index.py +228 -0
- brain/vault/derived_links/__init__.py +50 -0
- brain/vault/derived_links/directory.py +683 -0
- brain/vault/derived_links/fence.py +408 -0
- brain/vault/derived_links/gws.py +64 -0
- brain/vault/derived_links/participants.py +143 -0
- brain/vault/derived_links/pass_runner.py +362 -0
- brain/vault/derived_links/rules.py +137 -0
- brain/vault/export.py +683 -0
- brain/vault/frontmatter.py +165 -0
- brain/vault/graph.py +620 -0
- brain/vault/graph_format.py +388 -0
- brain/vault/link_rewrite.py +235 -0
- brain/vault/links.py +260 -0
- brain/vault/note_builder.py +211 -0
- brain/vault/paths.py +55 -0
- brain/vault/quartz_overlay.py +236 -0
- brain/vault/rename.py +591 -0
- brain/vault/resolver.py +304 -0
- brain/vault/slug.py +127 -0
- brain/vault/sync.py +1513 -0
- brain/vault/sync_summaries.py +264 -0
- brain/vault/templates.py +145 -0
- brain/vault/watch.py +1052 -0
- brain/wiki/__init__.py +6 -0
- brain/wiki/_github_slugger.py +76 -0
- brain/wiki/_person_name.py +314 -0
- brain/wiki/build_homepage.py +541 -0
- brain/wiki/build_partial.py +273 -0
- brain/wiki/build_people.py +934 -0
- brain/wiki/build_related.py +758 -0
- brain/wiki/build_swap.py +585 -0
- brain/wiki/build_watcher.py +975 -0
- brain/wiki/edit_classifier.py +215 -0
- brain/wiki/errors.py +10 -0
- brain/wiki/fastpath_manifest.py +475 -0
- brain/wiki/fastpath_state.py +174 -0
- brain/wiki/install.py +296 -0
- brain/wiki/slug.py +111 -0
- secondbrain_py-0.2.1.dist-info/METADATA +195 -0
- secondbrain_py-0.2.1.dist-info/RECORD +273 -0
- secondbrain_py-0.2.1.dist-info/WHEEL +5 -0
- secondbrain_py-0.2.1.dist-info/entry_points.txt +11 -0
- secondbrain_py-0.2.1.dist-info/licenses/LICENSE +21 -0
- secondbrain_py-0.2.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
// Brain callouts — Lane C of the 2026 commonplace-book redesign.
|
|
2
|
+
//
|
|
3
|
+
// This file is installed at
|
|
4
|
+
// `<vault>/.quartz/quartz/styles/brain/_callouts.scss` by `brain vault
|
|
5
|
+
// render --overlay` and pulled into the global SCSS via `custom.scss`'s
|
|
6
|
+
// `@use "./brain/callouts"` line.
|
|
7
|
+
//
|
|
8
|
+
// Stock Quartz callouts (`quartz/styles/callouts.scss`) ship a
|
|
9
|
+
// Material-style palette — saturated blue / cyan / orange / red over
|
|
10
|
+
// white — that clashes hard with the cream-paper redesign. This file
|
|
11
|
+
// repaints every Quartz callout type into the redesign palette, then
|
|
12
|
+
// adds the editorial chrome the plan calls for: tinted background
|
|
13
|
+
// (`color-mix`), a 3px left border in the type color, a small-caps
|
|
14
|
+
// title bar, and a subtle `--shadow-sm` on the container.
|
|
15
|
+
//
|
|
16
|
+
// Callout types touched (the full Quartz set):
|
|
17
|
+
// note, info, abstract, tip, success, question, warning, danger,
|
|
18
|
+
// failure, bug, example, quote.
|
|
19
|
+
//
|
|
20
|
+
// Each gets its own `--callout-{type}` token at the top of `:root` /
|
|
21
|
+
// `:root[saved-theme="dark"]` so the palette is auditable in one
|
|
22
|
+
// place. The per-type rule below resolves `--type-color` from the
|
|
23
|
+
// matching token, then layers the chrome on top.
|
|
24
|
+
//
|
|
25
|
+
// Strategy note — we don't try to fight stock Quartz on icon/glyph
|
|
26
|
+
// markup (the SVG icon URIs in stock `callouts.scss` still apply via
|
|
27
|
+
// `--callout-icon`). We only repaint colors, the title bar, and the
|
|
28
|
+
// container.
|
|
29
|
+
//
|
|
30
|
+
// Tokens consumed (from `_tokens.scss`):
|
|
31
|
+
// * `--surface-1` — base for the `color-mix` tinted bg
|
|
32
|
+
// * `--shadow-sm` — container elevation
|
|
33
|
+
// * `--ink-0` — body text inside callouts
|
|
34
|
+
// * `--accent-soft`/`--accent-strong` — ridden by `note` + `quote`
|
|
35
|
+
// * `--brain-tier-*` — re-used so callouts and the graph share hues
|
|
36
|
+
// * `--callout-note / -info / -abstract / -tip / -success /
|
|
37
|
+
// -question / -warning / -danger / -failure / -bug / -example /
|
|
38
|
+
// -quote` — per-type hue palette (one per Quartz callout type),
|
|
39
|
+
// defined in `_tokens.scss` so cross-file consumers (`_code.scss`'s
|
|
40
|
+
// success-flash, future home/sidebar callouts) don't depend on
|
|
41
|
+
// this partial's load order.
|
|
42
|
+
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
// Type-color tokens are defined in `_tokens.scss` (light + dark blocks).
|
|
45
|
+
//
|
|
46
|
+
// Single source of truth — devtools-inspecting any callout surfaces the
|
|
47
|
+
// full palette under `:root` alongside the rest of the redesign tokens,
|
|
48
|
+
// and cross-file consumers (`_code.scss`'s success-flash, future
|
|
49
|
+
// home/sidebar callouts) don't depend on this partial's load order.
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
// Container chrome — applied uniformly via the data-callout attribute
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
//
|
|
56
|
+
// Stock callouts.scss writes `--color`, `--border`, `--bg` per type.
|
|
57
|
+
// We override those vars to pull from our `--callout-{type}` tokens
|
|
58
|
+
// instead, then add the `--shadow-sm` + `border-left: 3px solid` +
|
|
59
|
+
// tinted bg via `color-mix`.
|
|
60
|
+
//
|
|
61
|
+
// Why mutate stock's `--color`/`--bg` rather than restyle every
|
|
62
|
+
// selector: stock's `.callout-title { color: var(--color) }` (and
|
|
63
|
+
// inner-`<p>` in title, and icon mask color) all read the same vars,
|
|
64
|
+
// so swapping the var values cleanly retints the entire chrome with
|
|
65
|
+
// one block. Less drift surface than re-targeting each child.
|
|
66
|
+
|
|
67
|
+
.callout {
|
|
68
|
+
// brain: redesign chrome — the per-type `--color` set in the rules
|
|
69
|
+
// below picks the hue; this block applies the universal layout.
|
|
70
|
+
border: 0;
|
|
71
|
+
border-left: 3px solid var(--type-color, var(--callout-note));
|
|
72
|
+
border-radius: 6px;
|
|
73
|
+
// brain: tinted background via `color-mix`. 8% per the plan spec —
|
|
74
|
+
// visible enough to read as a tinted region, faint enough not to
|
|
75
|
+
// shout. Falls back to `--surface-1` cleanly when `color-mix` is
|
|
76
|
+
// unsupported (graceful degradation).
|
|
77
|
+
background: color-mix(in srgb, var(--type-color, var(--callout-note)) 8%, var(--surface-1));
|
|
78
|
+
box-shadow: var(--shadow-sm);
|
|
79
|
+
margin: 1.2rem 0;
|
|
80
|
+
padding: 0.4rem 1rem;
|
|
81
|
+
color: var(--ink-0);
|
|
82
|
+
|
|
83
|
+
// Override stock's `--color` so the title bar + icon mask track
|
|
84
|
+
// the redesigned hue. (`--bg` is irrelevant since we paint the
|
|
85
|
+
// background directly above; we still null it for cleanliness.)
|
|
86
|
+
--color: var(--type-color, var(--callout-note));
|
|
87
|
+
--bg: transparent;
|
|
88
|
+
--border: var(--type-color, var(--callout-note));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Title bar — uppercase + tracking, type-color tint, tighter padding
|
|
92
|
+
// than stock so the title sits close to the content rather than
|
|
93
|
+
// floating mid-card.
|
|
94
|
+
//
|
|
95
|
+
// brain (Linear): replaced small-caps with uppercase + tracking.
|
|
96
|
+
// Tech aesthetic doesn't have small caps; uppercase reads cleaner
|
|
97
|
+
// against the indigo-violet accent.
|
|
98
|
+
.callout-title {
|
|
99
|
+
padding: 0.6rem 0;
|
|
100
|
+
text-transform: uppercase;
|
|
101
|
+
letter-spacing: 0.06em;
|
|
102
|
+
font-size: 0.75rem;
|
|
103
|
+
font-weight: 600;
|
|
104
|
+
color: var(--type-color, var(--callout-note));
|
|
105
|
+
|
|
106
|
+
// The inner `<p>` Quartz wraps around the title text inherits the
|
|
107
|
+
// type color via stock's `.callout-title-inner > p { color: var(--color) }`.
|
|
108
|
+
// We re-pin to be explicit and inherit the uppercase treatment.
|
|
109
|
+
> .callout-title-inner > p {
|
|
110
|
+
color: inherit;
|
|
111
|
+
text-transform: inherit;
|
|
112
|
+
letter-spacing: inherit;
|
|
113
|
+
margin: 0;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// ---------------------------------------------------------------------------
|
|
118
|
+
// Per-type rules — set --type-color, the chrome above does the rest
|
|
119
|
+
// ---------------------------------------------------------------------------
|
|
120
|
+
//
|
|
121
|
+
// Stock callouts.scss uses the `&[data-callout="x"]` selector pattern
|
|
122
|
+
// inside its top-level `.callout` block. Since this file is loaded
|
|
123
|
+
// AFTER stock's via custom.scss's `@use` order (base → tokens →
|
|
124
|
+
// typography → surface → atmosphere → motion → links → sidebar →
|
|
125
|
+
// article → marginalia → callouts → code → home), we override at
|
|
126
|
+
// equal specificity by using the same `&[data-callout="x"]` shape.
|
|
127
|
+
|
|
128
|
+
.callout {
|
|
129
|
+
&[data-callout="note"] {
|
|
130
|
+
--type-color: var(--callout-note);
|
|
131
|
+
}
|
|
132
|
+
&[data-callout="info"],
|
|
133
|
+
&[data-callout="todo"] {
|
|
134
|
+
--type-color: var(--callout-info);
|
|
135
|
+
}
|
|
136
|
+
&[data-callout="abstract"],
|
|
137
|
+
&[data-callout="summary"],
|
|
138
|
+
&[data-callout="tldr"] {
|
|
139
|
+
--type-color: var(--callout-abstract);
|
|
140
|
+
}
|
|
141
|
+
&[data-callout="tip"],
|
|
142
|
+
&[data-callout="hint"],
|
|
143
|
+
&[data-callout="important"] {
|
|
144
|
+
--type-color: var(--callout-tip);
|
|
145
|
+
}
|
|
146
|
+
&[data-callout="success"],
|
|
147
|
+
&[data-callout="check"],
|
|
148
|
+
&[data-callout="done"] {
|
|
149
|
+
--type-color: var(--callout-success);
|
|
150
|
+
}
|
|
151
|
+
&[data-callout="question"],
|
|
152
|
+
&[data-callout="help"],
|
|
153
|
+
&[data-callout="faq"] {
|
|
154
|
+
--type-color: var(--callout-question);
|
|
155
|
+
}
|
|
156
|
+
&[data-callout="warning"],
|
|
157
|
+
&[data-callout="caution"],
|
|
158
|
+
&[data-callout="attention"] {
|
|
159
|
+
--type-color: var(--callout-warning);
|
|
160
|
+
}
|
|
161
|
+
&[data-callout="danger"],
|
|
162
|
+
&[data-callout="error"] {
|
|
163
|
+
--type-color: var(--callout-danger);
|
|
164
|
+
}
|
|
165
|
+
&[data-callout="failure"],
|
|
166
|
+
&[data-callout="fail"],
|
|
167
|
+
&[data-callout="missing"] {
|
|
168
|
+
--type-color: var(--callout-failure);
|
|
169
|
+
}
|
|
170
|
+
&[data-callout="bug"] {
|
|
171
|
+
--type-color: var(--callout-bug);
|
|
172
|
+
}
|
|
173
|
+
&[data-callout="example"] {
|
|
174
|
+
--type-color: var(--callout-example);
|
|
175
|
+
}
|
|
176
|
+
&[data-callout="quote"],
|
|
177
|
+
&[data-callout="cite"] {
|
|
178
|
+
--type-color: var(--callout-quote);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Compatibility alias for the historical command-palette partial name.
|
|
2
|
+
//
|
|
3
|
+
// The Phase 5 handoff standardizes the file as `_command_palette.scss`;
|
|
4
|
+
// this wrapper keeps older comments/tools that probe `_cmdk.scss` from
|
|
5
|
+
// failing while the real styles live in the spec-named partial.
|
|
6
|
+
|
|
7
|
+
@use "./command_palette";
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
// Brain code surface — Lane C of the 2026 commonplace-book redesign.
|
|
2
|
+
//
|
|
3
|
+
// This file is installed at
|
|
4
|
+
// `<vault>/.quartz/quartz/styles/brain/_code.scss` by `brain vault
|
|
5
|
+
// render --overlay` and pulled into the global SCSS via `custom.scss`'s
|
|
6
|
+
// `@use "./brain/code"` line.
|
|
7
|
+
//
|
|
8
|
+
// Scope of this file:
|
|
9
|
+
//
|
|
10
|
+
// * `<pre>` block surface — rounded `8px`, `--shadow-sm`, padding
|
|
11
|
+
// `1rem 1.2rem`, `--fs-sm` body. Background `--surface-2` in light,
|
|
12
|
+
// a deeper espresso in dark (the dark-mode token wiring is in
|
|
13
|
+
// `_tokens.scss`'s dark-mode `:root[saved-theme="dark"]` block —
|
|
14
|
+
// `--surface-2` becomes `#2a2418` there).
|
|
15
|
+
// * Inline `code` polish — Lane A's `_surface.scss` already paints
|
|
16
|
+
// the background; this file refines padding/radius/no-shrink so
|
|
17
|
+
// `code` snippets read at the surrounding text size.
|
|
18
|
+
// * Language label + copy button hover affordance — wires the
|
|
19
|
+
// `[data-language]` attribute Quartz's `Plugin.SyntaxHighlighting`
|
|
20
|
+
// stamps on `<pre>` into a CSS-only top-right pill, paired with
|
|
21
|
+
// a brain-themed copy button injected by `codeCopy.js`.
|
|
22
|
+
// * Hide stock Quartz `.clipboard-button` — Body.tsx ships a
|
|
23
|
+
// stock clipboard button that, if left alone, would render next
|
|
24
|
+
// to our brain-themed `.brain-code-copy`. Our button supersedes
|
|
25
|
+
// it; this file hides stock's via `display: none`.
|
|
26
|
+
//
|
|
27
|
+
// Tokens consumed (from `_tokens.scss`):
|
|
28
|
+
// * `--surface-1` / `--surface-2` — code surfaces
|
|
29
|
+
// * `--shadow-sm` — pre elevation
|
|
30
|
+
// * `--fs-sm` — pre font size
|
|
31
|
+
// * `--ink-1` / `--ink-2` — label + button colors
|
|
32
|
+
// * `--rule` — button border
|
|
33
|
+
// * `--accent-soft` — copy hover
|
|
34
|
+
// * `--motion-fast`/`--motion-easing` — transitions
|
|
35
|
+
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
// 1. <pre> block surface
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
//
|
|
40
|
+
// Stock Quartz paints `pre { padding: 0 0.5rem; border-radius: 5px;
|
|
41
|
+
// border: 1px solid var(--lightgray); }` (see base.scss). We override
|
|
42
|
+
// to the redesign aesthetic: bigger radius, generous padding, soft
|
|
43
|
+
// shadow, no border. Background pulls from the surface scale —
|
|
44
|
+
// `--surface-2` is the third-tier paper surface in light, the espresso
|
|
45
|
+
// `#2a2418` in dark (see `_tokens.scss`).
|
|
46
|
+
|
|
47
|
+
article pre {
|
|
48
|
+
position: relative;
|
|
49
|
+
background: var(--surface-2);
|
|
50
|
+
border: 0;
|
|
51
|
+
border-radius: 8px;
|
|
52
|
+
box-shadow: var(--shadow-sm);
|
|
53
|
+
padding: 1rem 1.2rem;
|
|
54
|
+
font-size: var(--fs-sm);
|
|
55
|
+
// Stock Quartz keeps `<pre>` content as a single line in some
|
|
56
|
+
// mermaid contexts; cap with an explicit overflow rule so wide
|
|
57
|
+
// code scrolls horizontally rather than blowing out the column.
|
|
58
|
+
overflow-x: auto;
|
|
59
|
+
margin: 1.2rem 0;
|
|
60
|
+
// brain: line-height tuned for code reading. Stock leaves it at the
|
|
61
|
+
// article's `1.7`, which is far too loose for monospace.
|
|
62
|
+
line-height: 1.55;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Reset the inner `<code>` so its padding doesn't double-pad inside
|
|
66
|
+
// the pre. Stock Quartz adds `padding: 0.5rem 0` on `pre > code`;
|
|
67
|
+
// keep that for line-number gutters but trim outer.
|
|
68
|
+
article pre > code {
|
|
69
|
+
padding: 0;
|
|
70
|
+
background: none;
|
|
71
|
+
font-size: inherit;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
// 2. Inline `code` polish
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
//
|
|
78
|
+
// Lane A's `_surface.scss` already writes `code:not(pre code) { background: var(--surface-2) }`.
|
|
79
|
+
// This block refines the box: tighter padding, smaller radius, and
|
|
80
|
+
// `font-size: 0.92em` so `code` snippets don't visibly shrink against
|
|
81
|
+
// surrounding running serif text. The 0.92em is deliberate — pure
|
|
82
|
+
// `1em` reads chunky against Newsreader's optical-sized body, while
|
|
83
|
+
// the stock `0.9em` reads tiny.
|
|
84
|
+
|
|
85
|
+
code:not(pre code) {
|
|
86
|
+
padding: 0.1rem 0.35rem;
|
|
87
|
+
border-radius: 3px;
|
|
88
|
+
font-size: 0.92em;
|
|
89
|
+
// Reset stock Quartz's `color: var(--dark)` so inline code rides the
|
|
90
|
+
// ink scale for theme consistency. Falls back to the body color
|
|
91
|
+
// otherwise.
|
|
92
|
+
color: var(--ink-0);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// ---------------------------------------------------------------------------
|
|
96
|
+
// 3. Hide stock Quartz `.clipboard-button`
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
//
|
|
99
|
+
// `Body.tsx` injects a stock clipboard button on every `<pre>`. Our
|
|
100
|
+
// brain copy button (injected by `codeCopy.js`) supersedes it. Hiding
|
|
101
|
+
// stock's avoids two-buttons-side-by-side. The stock script's click
|
|
102
|
+
// behavior still functions if accessed programmatically; we only hide
|
|
103
|
+
// the visual chrome.
|
|
104
|
+
//
|
|
105
|
+
// brain (Lane C audit fix 2026-05-02): scoped to `article pre
|
|
106
|
+
// .clipboard-button`. The added selector chain (3,0,2 vs stock's
|
|
107
|
+
// 0,1,0) wins on specificity without `!important`, and confines the
|
|
108
|
+
// rule to article code blocks — popovers / mermaid diagrams / future
|
|
109
|
+
// non-pre clipboard hooks won't be globally hidden.
|
|
110
|
+
|
|
111
|
+
article pre .clipboard-button {
|
|
112
|
+
display: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// ---------------------------------------------------------------------------
|
|
116
|
+
// 4. Brain copy button + language label hover area
|
|
117
|
+
// ---------------------------------------------------------------------------
|
|
118
|
+
//
|
|
119
|
+
// Both the copy button and the language label live in the top-right
|
|
120
|
+
// of the `<pre>`. Together they form a small chrome that fades in on
|
|
121
|
+
// hover. Default: opacity 0; on `pre:hover` or `pre:focus-within`:
|
|
122
|
+
// opacity 1. `focus-within` covers keyboard users tabbing into the
|
|
123
|
+
// button.
|
|
124
|
+
//
|
|
125
|
+
// The language label is pure CSS, driven by `pre[data-language]`
|
|
126
|
+
// (Quartz's `Plugin.SyntaxHighlighting` stamps the attribute). Falls
|
|
127
|
+
// back gracefully when absent — the `::before` only renders when the
|
|
128
|
+
// attribute is present, so untyped code blocks stay clean.
|
|
129
|
+
|
|
130
|
+
article pre[data-language]::before {
|
|
131
|
+
content: attr(data-language);
|
|
132
|
+
position: absolute;
|
|
133
|
+
top: 0.5rem;
|
|
134
|
+
// brain: room for the 64px-wide copy button at the same right edge.
|
|
135
|
+
// The label sits to the LEFT of the button so they don't overlap.
|
|
136
|
+
right: 4.2rem;
|
|
137
|
+
font-family: var(--codeFont);
|
|
138
|
+
font-size: var(--fs-xs);
|
|
139
|
+
color: var(--ink-2);
|
|
140
|
+
// brain (Linear): code-style label — lowercase mono instead of
|
|
141
|
+
// small-caps. Reads as a tech tag, not an editorial caption.
|
|
142
|
+
text-transform: lowercase;
|
|
143
|
+
letter-spacing: 0.02em;
|
|
144
|
+
pointer-events: none;
|
|
145
|
+
opacity: 0;
|
|
146
|
+
transition: opacity var(--motion-fast) var(--motion-easing);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
article pre:hover[data-language]::before,
|
|
150
|
+
article pre:focus-within[data-language]::before {
|
|
151
|
+
opacity: 1;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// The injected copy button — class is `.brain-code-copy`, written
|
|
155
|
+
// by `codeCopy.js`. ARIA label set there too. Visual rules here.
|
|
156
|
+
.brain-code-copy {
|
|
157
|
+
position: absolute;
|
|
158
|
+
top: 0.5rem;
|
|
159
|
+
right: 0.5rem;
|
|
160
|
+
display: inline-flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
gap: 0.3rem;
|
|
163
|
+
padding: 0.2rem 0.55rem;
|
|
164
|
+
background: var(--surface-1);
|
|
165
|
+
color: var(--ink-1);
|
|
166
|
+
border: 1px solid var(--rule);
|
|
167
|
+
border-radius: 4px;
|
|
168
|
+
// brain (Linear): mono copy button — Geist Mono lowercase tracks
|
|
169
|
+
// the language label's tech tag treatment.
|
|
170
|
+
font-family: var(--codeFont);
|
|
171
|
+
font-size: var(--fs-xs);
|
|
172
|
+
text-transform: lowercase;
|
|
173
|
+
letter-spacing: 0.02em;
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
opacity: 0;
|
|
176
|
+
transition:
|
|
177
|
+
opacity var(--motion-fast) var(--motion-easing),
|
|
178
|
+
background var(--motion-fast) var(--motion-easing),
|
|
179
|
+
color var(--motion-fast) var(--motion-easing);
|
|
180
|
+
|
|
181
|
+
&:hover {
|
|
182
|
+
background: var(--accent-soft);
|
|
183
|
+
color: var(--ink-0);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&:focus-visible {
|
|
187
|
+
outline: 2px solid var(--accent-strong);
|
|
188
|
+
outline-offset: 1px;
|
|
189
|
+
opacity: 1;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// brain: the "Copied" pulse swaps the label text via JS; the chip
|
|
193
|
+
// itself uses the success-callout color briefly. `--callout-success`
|
|
194
|
+
// is defined in `_tokens.scss` (loaded first via `custom.scss` order),
|
|
195
|
+
// so the var is always resolved here — no fallback hex needed.
|
|
196
|
+
&.is-copied {
|
|
197
|
+
background: color-mix(in srgb, var(--callout-success) 18%, var(--surface-1));
|
|
198
|
+
color: var(--callout-success);
|
|
199
|
+
border-color: var(--callout-success);
|
|
200
|
+
opacity: 1;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Reveal on hover or keyboard focus on the surrounding pre.
|
|
205
|
+
article pre:hover .brain-code-copy,
|
|
206
|
+
article pre:focus-within .brain-code-copy {
|
|
207
|
+
opacity: 1;
|
|
208
|
+
}
|