markshelf 0.7.0 → 0.8.0

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.
Files changed (72) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  10. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  12. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  13. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  14. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  15. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  16. package/.next/standalone/.next/server/app/api/asset/route.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/api/diff/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/file/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/api/graph/route.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/raw/[...path]/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/search/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/timeline/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/tree/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/watch/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/index.html +1 -1
  27. package/.next/standalone/.next/server/app/index.rsc +4 -4
  28. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  29. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  30. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  31. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  33. package/.next/standalone/.next/server/chunks/ssr/{1q96_modules_mermaid_dist_chunks_mermaid_core_sizeCapture-INFHLROL_mjs_1ogo6n9k2rgi4._.js → 1q96_modules_mermaid_dist_chunks_mermaid_core_sizeCapture-INFHLROL_mjs_1bbj7sttzxwb7._.js} +1 -1
  34. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e4ml2_62oajv._.js +1 -1
  35. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0eg7wjh-6h9jf._.js +10 -0
  36. package/.next/standalone/.next/server/chunks/ssr/{node_modules_1-ydhedb1fxsp._.js → node_modules_08_3-rklxy4s5._.js} +2 -2
  37. package/.next/standalone/.next/server/chunks/ssr/{node_modules_18giqcyh1vd1y._.js → node_modules_0f73nqjg-_u-b._.js} +1 -1
  38. package/.next/standalone/.next/server/chunks/ssr/{node_modules_04qg5bar2ldzl._.js → node_modules_11w3e0v3n4x4f._.js} +1 -1
  39. package/.next/standalone/.next/server/chunks/ssr/{node_modules_0jlp8j5ogj6ku._.js → node_modules_1egvzjfpi6bpk._.js} +1 -1
  40. package/.next/standalone/.next/server/chunks/ssr/{node_modules_1512e5-8q8157._.js → node_modules_1p62xz6zues5c._.js} +1 -1
  41. package/.next/standalone/.next/server/chunks/ssr/{node_modules_15yi5hitci_xg._.js → node_modules_1x25aie8c1qp4._.js} +1 -1
  42. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  43. package/.next/standalone/.next/server/pages/404.html +1 -1
  44. package/.next/standalone/.next/server/pages/500.html +1 -1
  45. package/.next/standalone/.next/server/preview-props.json +3 -3
  46. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  48. package/.next/standalone/.next/static/chunks/1e6sbswbpvi7u.css +2 -0
  49. package/.next/standalone/.next/static/chunks/3i795q8ryovtx.js +8 -0
  50. package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/SPEC3.5-Markdown/343/203/254/343/203/263/343/203/200/343/203/252/343/203/263/343/202/260.md +11 -5
  51. package/.next/standalone/package-lock.json +57 -2
  52. package/.next/standalone/package.json +2 -1
  53. package/.next/standalone/src/app/layout.tsx +1 -0
  54. package/.next/standalone/src/app/markdown.css +361 -0
  55. package/.next/standalone/src/components/DetailPanel.tsx +2 -1
  56. package/.next/standalone/src/components/Markdown.tsx +132 -54
  57. package/.next/standalone/src/lib/remarkAlerts.test.ts +40 -0
  58. package/.next/standalone/src/lib/remarkAlerts.ts +59 -0
  59. package/.next/static/chunks/1e6sbswbpvi7u.css +2 -0
  60. package/.next/static/chunks/3i795q8ryovtx.js +8 -0
  61. package/package.json +2 -1
  62. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__113dl-108b6lu._.js +0 -10
  63. package/.next/standalone/.next/static/chunks/1_r_ieqrdfmfe.css +0 -1
  64. package/.next/standalone/.next/static/chunks/3s3m8ud2li2il.js +0 -8
  65. package/.next/static/chunks/1_r_ieqrdfmfe.css +0 -1
  66. package/.next/static/chunks/3s3m8ud2li2il.js +0 -8
  67. /package/.next/standalone/.next/static/{d5WTefQHvkibk8_NfsU7s → 9ImbnQb2uptsGLqUBu2co}/_buildManifest.js +0 -0
  68. /package/.next/standalone/.next/static/{d5WTefQHvkibk8_NfsU7s → 9ImbnQb2uptsGLqUBu2co}/_clientMiddlewareManifest.js +0 -0
  69. /package/.next/standalone/.next/static/{d5WTefQHvkibk8_NfsU7s → 9ImbnQb2uptsGLqUBu2co}/_ssgManifest.js +0 -0
  70. /package/.next/static/{d5WTefQHvkibk8_NfsU7s → 9ImbnQb2uptsGLqUBu2co}/_buildManifest.js +0 -0
  71. /package/.next/static/{d5WTefQHvkibk8_NfsU7s → 9ImbnQb2uptsGLqUBu2co}/_clientMiddlewareManifest.js +0 -0
  72. /package/.next/static/{d5WTefQHvkibk8_NfsU7s → 9ImbnQb2uptsGLqUBu2co}/_ssgManifest.js +0 -0
@@ -4,15 +4,21 @@
4
4
 
5
5
  ## 設計
6
6
 
7
- - 実装: `src/components/Markdown.tsx`(`react-markdown` + `remark-gfm`)
8
- - GitHub Flavored Markdown(テーブル・タスクリスト・打ち消し線)を有効化
7
+ - 実装: `src/components/Markdown.tsx`(`react-markdown` + `remark-gfm` + `rehype-highlight`)
8
+ - GitHub Flavored Markdown(テーブル・タスクリスト・打ち消し線・脚注)を有効化
9
+ - スタイルは `src/app/markdown.css`(GitHub 風の閲覧テーマ。md-reader を参考)。`variant` で 2 種類を切り替える
10
+ - `reader`(本文表示): 本文 16px・行間 1.8、最大幅 860px で中央寄せ。h1/h2 に下線
11
+ - `compact`(プレビューポップアップ、既定): 本文 12px の詰めた表示。コードのコピーボタンは出さない
12
+ - アラート: GitHub と同じ `> [!NOTE]`(TIP / IMPORTANT / WARNING / CAUTION、大文字小文字は区別しない)を `src/lib/remarkAlerts.ts` で検出し、色付きの枠とアイコン付きタイトルで表示。マーカーは行に単独で書いたときだけ有効(`> [!NOTE] 本文` は通常の引用)
13
+ - テーブルは横スクロール可能な枠で囲み、ヘッダー背景・縞模様・ホバー強調を付ける
9
14
  - 見出しはカスタムコンポーネントに置き換え、`src/lib/markdown.ts` の `parseHeadings()` で採番した ID を付与(目次のアンカーと一致。[SPEC3.3 TableOfContents](SPEC3.3-TableOfContents.md))
10
15
  - `enableHeadingLinks`(本文表示のみ true、プレビューポップアップは false)のとき、見出しにホバーで現れるリンクアンカー `<HeadingAnchor>` を付ける
11
16
  - アンカークリックで `location.hash` を当該見出し ID に更新(`history.replaceState`)し、`?file=...#見出しID` 形式の共有 URL をクリップボードにコピー(コピー後は一時的にチェックアイコンを表示)。共有 URL の初期表示スクロールは [SPEC5.2 URL クエリ](../SPEC5-永続化/SPEC5.2-URLクエリ.md) を参照
12
- - スクロール到達時に上端へ張り付かないよう `scroll-mt-4` を付与
17
+ - スクロール到達時に上端へ張り付かないよう `scroll-mt-6` を付与
13
18
  - コードブロック:
14
- - `language-mermaid` は `<MermaidBlock>` に差し替え([Mermaid](../../用語集/Mermaid.md))
15
- - その他は Tailwind Typography の `prose-pre` / `prose-code` スタイルで装飾
19
+ - `language-mermaid` は `<MermaidBlock>` に差し替え([Mermaid](../../用語集/Mermaid.md))。ハイライト対象から外し、元のテキストのまま渡す
20
+ - その他は `<CodeBlock>` で表示。言語を明示したフェンスだけを highlight.js(`rehype-highlight`、自動判定なし)で色付けし、GitHub ライト配色を使う
21
+ - 右上に言語名を表示し、ホバーでコピーボタンを出す(コピー処理は見出しアンカーと共通。非セキュアコンテキストでは `execCommand` にフォールバック)
16
22
  - Markdown を入れ子で埋め込む場合は CommonMark どおり**外側のフェンスを内側より長く**する(例: 外側 \`\`\`\`、内側 \`\`\`)。同じ長さで入れ子にしたソースは仕様上その時点でブロックが閉じるため、レンダリング結果も途中で切れる
17
23
  - リンク(`<a>`):
18
24
  - 相対パスは `resolveRelativeLink()` で docs パスへ解決し、解決できたら**アプリ内ナビゲーション**扱い(`<span>` + onClick)
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "markshelf",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "markshelf",
9
- "version": "0.7.0",
9
+ "version": "0.8.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@tailwindcss/typography": "^0.5.20",
@@ -18,6 +18,7 @@
18
18
  "react": "19.3.1",
19
19
  "react-dom": "19.3.1",
20
20
  "react-markdown": "^10.1.0",
21
+ "rehype-highlight": "^7.0.2",
21
22
  "remark-gfm": "^4.0.1",
22
23
  "simple-git": "^4.1.0"
23
24
  },
@@ -4278,6 +4279,19 @@
4278
4279
  "url": "https://opencollective.com/unified"
4279
4280
  }
4280
4281
  },
4282
+ "node_modules/hast-util-to-text": {
4283
+ "version": "4.0.3",
4284
+ "resolved": "https://registry.npmjs.org/hast-util-to-text/-/hast-util-to-text-4.0.3.tgz",
4285
+ "integrity": "sha512-5yrlWOvGFs6CqHriUpSsNrjzT/Tdo+IOQudbznxOn8K5qblp18MJyzOg8IgDOKQ8MYgQcJA7SusuCjSpDr8mSA==",
4286
+ "license": "MIT",
4287
+ "dependencies": {
4288
+ "@types/hast": "^3.0.0"
4289
+ },
4290
+ "funding": {
4291
+ "type": "opencollective",
4292
+ "url": "https://opencollective.com/unified"
4293
+ }
4294
+ },
4281
4295
  "node_modules/hast-util-whitespace": {
4282
4296
  "version": "3.0.0",
4283
4297
  "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz",
@@ -4308,6 +4322,15 @@
4308
4322
  "hermes-estree": "0.25.1"
4309
4323
  }
4310
4324
  },
4325
+ "node_modules/highlight.js": {
4326
+ "version": "11.11.2",
4327
+ "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.11.2.tgz",
4328
+ "integrity": "sha512-oaXMACAU0kzOMXBjWpNcX+vlwSBCIAiZ9BHa7gA15NOTtT2L/l8OSZDuqS2XppOhZBPJ7hm4o8ep2kyuip2uEQ==",
4329
+ "license": "BSD-3-Clause",
4330
+ "engines": {
4331
+ "node": ">=12.0.0"
4332
+ }
4333
+ },
4311
4334
  "node_modules/hookified": {
4312
4335
  "version": "1.15.1",
4313
4336
  "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.15.1.tgz",
@@ -4888,6 +4911,21 @@
4888
4911
  "url": "https://github.com/sponsors/wooorm"
4889
4912
  }
4890
4913
  },
4914
+ "node_modules/lowlight": {
4915
+ "version": "3.3.0",
4916
+ "resolved": "https://registry.npmjs.org/lowlight/-/lowlight-3.3.0.tgz",
4917
+ "integrity": "sha512-0JNhgFoPvP6U6lE/UdVsSq99tn6DhjjpAj5MxG49ewd2mOBVtwWYIT8ClyABhq198aXXODMU6Ox8DrGy/CpTZQ==",
4918
+ "license": "MIT",
4919
+ "dependencies": {
4920
+ "@types/hast": "^3.0.0",
4921
+ "devlop": "^1.0.0",
4922
+ "highlight.js": "~11.11.0"
4923
+ },
4924
+ "funding": {
4925
+ "type": "github",
4926
+ "url": "https://github.com/sponsors/wooorm"
4927
+ }
4928
+ },
4891
4929
  "node_modules/lru-cache": {
4892
4930
  "version": "5.1.1",
4893
4931
  "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
@@ -6328,6 +6366,23 @@
6328
6366
  "react": ">=18"
6329
6367
  }
6330
6368
  },
6369
+ "node_modules/rehype-highlight": {
6370
+ "version": "7.0.2",
6371
+ "resolved": "https://registry.npmjs.org/rehype-highlight/-/rehype-highlight-7.0.2.tgz",
6372
+ "integrity": "sha512-k158pK7wdC2qL3M5NcZROZ2tR/l7zOzjxXd5VGdcfIyoijjQqpHd3JKtYSBDpDZ38UI2WJWuFAtkMDxmx5kstA==",
6373
+ "license": "MIT",
6374
+ "dependencies": {
6375
+ "@types/hast": "^3.0.0",
6376
+ "hast-util-to-text": "^4.0.0",
6377
+ "lowlight": "^3.0.0",
6378
+ "unist-util-visit": "^5.0.0",
6379
+ "vfile": "^6.0.0"
6380
+ },
6381
+ "funding": {
6382
+ "type": "opencollective",
6383
+ "url": "https://opencollective.com/unified"
6384
+ }
6385
+ },
6331
6386
  "node_modules/remark-gfm": {
6332
6387
  "version": "4.0.1",
6333
6388
  "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.1.tgz",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markshelf",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Structured markdown viewer for git repositories",
5
5
  "license": "MIT",
6
6
  "author": "sksp.work",
@@ -54,6 +54,7 @@
54
54
  "react": "19.3.1",
55
55
  "react-dom": "19.3.1",
56
56
  "react-markdown": "^10.1.0",
57
+ "rehype-highlight": "^7.0.2",
57
58
  "remark-gfm": "^4.0.1",
58
59
  "simple-git": "^4.1.0"
59
60
  },
@@ -1,5 +1,6 @@
1
1
  import type { Metadata } from "next";
2
2
  import "./globals.css";
3
+ import "./markdown.css";
3
4
 
4
5
  export const metadata: Metadata = {
5
6
  title: "MarkShelf",
@@ -0,0 +1,361 @@
1
+ /*
2
+ * Markdown body styles (src/components/Markdown.tsx).
3
+ * A GitHub-like reading theme, modeled on md-reader: centered measure,
4
+ * generous line-height, clear heading hierarchy, framed code and tables.
5
+ *
6
+ * .md-body.md-reader main content pane
7
+ * .md-body.md-compact hover preview popup
8
+ */
9
+
10
+ .md-body {
11
+ --md-fg: var(--text-primary);
12
+ --md-fg-soft: #2f3440;
13
+ --md-fg-muted: #656d76;
14
+ --md-border: #d8dee4;
15
+ --md-border-soft: #e6eaef;
16
+ --md-code-bg: #f6f8fa;
17
+ --md-inline-code-bg: rgba(175, 184, 193, 0.2);
18
+ --md-link: var(--brand-primary);
19
+ --md-mark: #fff8c5;
20
+
21
+ color: var(--md-fg-soft);
22
+ font-size: 15px;
23
+ line-height: 1.8;
24
+ word-wrap: break-word;
25
+ overflow-wrap: anywhere;
26
+ letter-spacing: 0.02em;
27
+ font-feature-settings: "palt" 0;
28
+ }
29
+
30
+ .md-reader {
31
+ max-width: 860px;
32
+ margin: 0 auto;
33
+ font-size: 16px;
34
+ }
35
+
36
+ .md-compact {
37
+ font-size: 12px;
38
+ line-height: 1.7;
39
+ }
40
+
41
+ .md-body > :first-child { margin-top: 0 !important; }
42
+ .md-body > :last-child { margin-bottom: 0 !important; }
43
+
44
+ /* ---- Block spacing ---------------------------------------------------- */
45
+
46
+ .md-body p,
47
+ .md-body ul,
48
+ .md-body ol,
49
+ .md-body dl,
50
+ .md-body table,
51
+ .md-body .md-table-wrap,
52
+ .md-body blockquote,
53
+ .md-body .md-code,
54
+ .md-body .md-alert,
55
+ .md-body details {
56
+ margin-top: 0;
57
+ margin-bottom: 1.1em;
58
+ }
59
+
60
+ /* ---- Headings --------------------------------------------------------- */
61
+
62
+ .md-body h1,
63
+ .md-body h2,
64
+ .md-body h3,
65
+ .md-body h4,
66
+ .md-body h5,
67
+ .md-body h6 {
68
+ color: var(--md-fg);
69
+ font-weight: 650;
70
+ line-height: 1.35;
71
+ letter-spacing: 0.01em;
72
+ margin-top: 1.9em;
73
+ margin-bottom: 0.8em;
74
+ }
75
+
76
+ .md-body h1 {
77
+ font-size: 2em;
78
+ font-weight: 700;
79
+ padding-bottom: 0.3em;
80
+ border-bottom: 1px solid var(--md-border);
81
+ }
82
+ .md-body h2 {
83
+ font-size: 1.5em;
84
+ padding-bottom: 0.3em;
85
+ border-bottom: 1px solid var(--md-border-soft);
86
+ }
87
+ .md-body h3 { font-size: 1.25em; }
88
+ .md-body h4 { font-size: 1.05em; }
89
+ .md-body h5 { font-size: 0.95em; }
90
+ .md-body h6 { font-size: 0.9em; color: var(--md-fg-muted); }
91
+
92
+ .md-compact h1 { font-size: 1.45em; }
93
+ .md-compact h2 { font-size: 1.25em; }
94
+ .md-compact h3 { font-size: 1.1em; }
95
+ .md-compact h1,
96
+ .md-compact h2,
97
+ .md-compact h3,
98
+ .md-compact h4 { margin-top: 1.3em; margin-bottom: 0.5em; }
99
+
100
+ .md-heading-anchor {
101
+ display: inline-flex;
102
+ align-items: center;
103
+ margin-left: 0.4em;
104
+ vertical-align: middle;
105
+ color: var(--text-muted);
106
+ opacity: 0;
107
+ transition: opacity 0.15s, color 0.15s;
108
+ }
109
+ .md-body .group:hover .md-heading-anchor,
110
+ .md-heading-anchor:focus-visible { opacity: 1; }
111
+ .md-heading-anchor:hover { color: var(--md-link); }
112
+
113
+ /* ---- Inline ----------------------------------------------------------- */
114
+
115
+ .md-body strong { color: var(--md-fg); font-weight: 650; }
116
+ .md-body a { color: var(--md-link); text-decoration: none; }
117
+ .md-body a:hover { text-decoration: underline; text-underline-offset: 2px; }
118
+ .md-body mark { background: var(--md-mark); color: inherit; padding: 0 0.15em; border-radius: 2px; }
119
+ .md-body del { color: var(--md-fg-muted); }
120
+ .md-body kbd {
121
+ display: inline-block;
122
+ padding: 0.1em 0.4em;
123
+ font: 0.8em var(--font-mono);
124
+ line-height: 1.4;
125
+ color: var(--md-fg);
126
+ background: var(--md-code-bg);
127
+ border: 1px solid var(--md-border);
128
+ border-bottom-color: #c3cad2;
129
+ border-radius: 5px;
130
+ box-shadow: inset 0 -1px 0 #c3cad2;
131
+ }
132
+
133
+ .md-body :not(pre) > code {
134
+ font-family: var(--font-mono);
135
+ font-size: 0.86em;
136
+ padding: 0.15em 0.4em;
137
+ margin: 0 0.1em;
138
+ color: var(--md-fg);
139
+ background: var(--md-inline-code-bg);
140
+ border-radius: 6px;
141
+ white-space: break-spaces;
142
+ }
143
+
144
+ /* ---- Lists ------------------------------------------------------------ */
145
+
146
+ .md-body ul,
147
+ .md-body ol { padding-left: 1.8em; }
148
+ .md-body ul { list-style: disc; }
149
+ .md-body ol { list-style: decimal; }
150
+ .md-body ul ul { list-style: circle; }
151
+ .md-body ul ul ul { list-style: square; }
152
+ .md-body li + li { margin-top: 0.3em; }
153
+ .md-body li > ul,
154
+ .md-body li > ol { margin-top: 0.3em; margin-bottom: 0; }
155
+ .md-body li::marker { color: var(--md-fg-muted); }
156
+
157
+ /* GFM task lists */
158
+ .md-body .contains-task-list { list-style: none; padding-left: 0.4em; }
159
+ .md-body .contains-task-list .contains-task-list { padding-left: 1.6em; }
160
+ .md-body .task-list-item input[type="checkbox"] {
161
+ margin: 0 0.5em 0.2em 0;
162
+ vertical-align: middle;
163
+ accent-color: var(--md-link);
164
+ }
165
+
166
+ /* ---- Blockquote ------------------------------------------------------- */
167
+
168
+ .md-body blockquote {
169
+ padding: 0.1em 1em;
170
+ color: var(--md-fg-muted);
171
+ border-left: 0.25em solid var(--md-border);
172
+ }
173
+ .md-body blockquote > :last-child { margin-bottom: 0; }
174
+
175
+ /* ---- Alerts (> [!NOTE] …) -------------------------------------------- */
176
+
177
+ .md-alert {
178
+ --alert-color: #0969da;
179
+ padding: 0.6em 1em;
180
+ border-left: 0.25em solid var(--alert-color);
181
+ background: color-mix(in srgb, var(--alert-color) 6%, transparent);
182
+ border-radius: 0 6px 6px 0;
183
+ }
184
+ .md-alert > :last-child { margin-bottom: 0; }
185
+ .md-alert .md-alert-title {
186
+ display: flex;
187
+ align-items: center;
188
+ gap: 0.45em;
189
+ margin-bottom: 0.35em;
190
+ font-weight: 600;
191
+ color: var(--alert-color);
192
+ }
193
+ .md-alert-note { --alert-color: #0969da; }
194
+ .md-alert-tip { --alert-color: #1a7f37; }
195
+ .md-alert-important { --alert-color: #8250df; }
196
+ .md-alert-warning { --alert-color: #9a6700; }
197
+ .md-alert-caution { --alert-color: #cf222e; }
198
+
199
+ /* ---- Code blocks ------------------------------------------------------ */
200
+
201
+ .md-code {
202
+ position: relative;
203
+ background: var(--md-code-bg);
204
+ border: 1px solid var(--md-border-soft);
205
+ border-radius: 8px;
206
+ }
207
+ .md-code-bar {
208
+ position: absolute;
209
+ top: 0;
210
+ right: 0;
211
+ display: flex;
212
+ align-items: center;
213
+ gap: 0.25em;
214
+ padding: 0.35em 0.4em;
215
+ }
216
+ .md-code-lang {
217
+ font: 11px/1 var(--font-mono);
218
+ color: var(--md-fg-muted);
219
+ text-transform: lowercase;
220
+ user-select: none;
221
+ transition: opacity 0.15s;
222
+ }
223
+ .md-code-copy {
224
+ display: inline-flex;
225
+ align-items: center;
226
+ justify-content: center;
227
+ width: 26px;
228
+ height: 26px;
229
+ color: var(--md-fg-muted);
230
+ background: var(--bg-surface);
231
+ border: 1px solid var(--md-border);
232
+ border-radius: 6px;
233
+ cursor: pointer;
234
+ opacity: 0;
235
+ transition: opacity 0.15s, color 0.15s;
236
+ }
237
+ .md-code:hover .md-code-copy,
238
+ .md-code-copy:focus-visible { opacity: 1; }
239
+ .md-code-copy:hover { color: var(--md-link); }
240
+ .md-compact .md-code-bar { display: none; }
241
+
242
+ .md-body pre {
243
+ margin: 0;
244
+ padding: 1em 1.2em;
245
+ overflow-x: auto;
246
+ font-family: var(--font-mono);
247
+ font-size: 0.85em;
248
+ line-height: 1.6;
249
+ color: #1f2328;
250
+ tab-size: 4;
251
+ letter-spacing: 0;
252
+ }
253
+ .md-body pre code {
254
+ font: inherit;
255
+ background: transparent;
256
+ padding: 0;
257
+ }
258
+
259
+ /* highlight.js tokens — GitHub light palette */
260
+ .hljs-doctag,
261
+ .hljs-keyword,
262
+ .hljs-meta .hljs-keyword,
263
+ .hljs-template-tag,
264
+ .hljs-template-variable,
265
+ .hljs-type,
266
+ .hljs-variable.language_ { color: #cf222e; }
267
+ .hljs-title,
268
+ .hljs-title.class_,
269
+ .hljs-title.class_.inherited__,
270
+ .hljs-title.function_ { color: #8250df; }
271
+ .hljs-attr,
272
+ .hljs-attribute,
273
+ .hljs-literal,
274
+ .hljs-meta,
275
+ .hljs-number,
276
+ .hljs-operator,
277
+ .hljs-variable,
278
+ .hljs-selector-attr,
279
+ .hljs-selector-class,
280
+ .hljs-selector-id { color: #0550ae; }
281
+ .hljs-regexp,
282
+ .hljs-string,
283
+ .hljs-meta .hljs-string { color: #0a3069; }
284
+ .hljs-built_in,
285
+ .hljs-symbol { color: #953800; }
286
+ .hljs-comment,
287
+ .hljs-code,
288
+ .hljs-formula { color: #6e7781; font-style: italic; }
289
+ .hljs-name,
290
+ .hljs-quote,
291
+ .hljs-selector-tag,
292
+ .hljs-selector-pseudo { color: #116329; }
293
+ .hljs-subst { color: #1f2328; }
294
+ .hljs-section { color: #0550ae; font-weight: 600; }
295
+ .hljs-bullet { color: #953800; }
296
+ .hljs-emphasis { font-style: italic; }
297
+ .hljs-strong { font-weight: 600; }
298
+ .hljs-addition { color: #116329; background: #dafbe1; }
299
+ .hljs-deletion { color: #82071e; background: #ffebe9; }
300
+
301
+ /* ---- Tables ----------------------------------------------------------- */
302
+
303
+ .md-table-wrap {
304
+ overflow-x: auto;
305
+ border: 1px solid var(--md-border);
306
+ border-radius: 8px;
307
+ }
308
+ .md-body table {
309
+ width: 100%;
310
+ margin: 0;
311
+ border-collapse: collapse;
312
+ font-size: 0.9em;
313
+ line-height: 1.6;
314
+ font-variant-numeric: tabular-nums;
315
+ }
316
+ .md-body th,
317
+ .md-body td {
318
+ padding: 0.5em 0.9em;
319
+ border-bottom: 1px solid var(--md-border-soft);
320
+ vertical-align: top;
321
+ }
322
+ .md-body th + th,
323
+ .md-body td + td { border-left: 1px solid var(--md-border-soft); }
324
+ .md-body thead th {
325
+ background: var(--md-code-bg);
326
+ color: var(--md-fg);
327
+ font-weight: 600;
328
+ text-align: left;
329
+ border-bottom-color: var(--md-border);
330
+ }
331
+ .md-body tbody tr:last-child td { border-bottom: 0; }
332
+ .md-body tbody tr:nth-child(even) { background: #fafbfc; }
333
+ .md-body tbody tr:hover { background: #f3f6fa; }
334
+
335
+ /* ---- Media, rules, footnotes ----------------------------------------- */
336
+
337
+ .md-body img {
338
+ max-width: 100%;
339
+ height: auto;
340
+ border-radius: 6px;
341
+ }
342
+ .md-body hr {
343
+ height: 1px;
344
+ margin: 2em 0;
345
+ border: 0;
346
+ background: var(--md-border);
347
+ }
348
+ .md-body details summary { cursor: pointer; font-weight: 600; color: var(--md-fg); }
349
+ .md-body dt { font-weight: 600; color: var(--md-fg); }
350
+ .md-body dd { margin: 0 0 0.6em 1.2em; }
351
+
352
+ .md-body .footnotes {
353
+ margin-top: 2.5em;
354
+ padding-top: 1em;
355
+ border-top: 1px solid var(--md-border);
356
+ font-size: 0.88em;
357
+ color: var(--md-fg-muted);
358
+ }
359
+ .md-body .footnotes h2 { font-size: 1em; border: 0; margin-top: 0; }
360
+ .md-body sup a[data-footnote-ref]::before { content: "["; }
361
+ .md-body sup a[data-footnote-ref]::after { content: "]"; }
@@ -243,8 +243,9 @@ export function DetailPanel({ filePath, fileRefs, folders, onNavigate, onGoBack,
243
243
  content !== null ? (
244
244
  <div className="flex-1 flex overflow-hidden">
245
245
  <div className="flex-1 overflow-y-auto" ref={scrollRef}>
246
- <div className="p-4">
246
+ <div className="px-6 py-8 md:px-10">
247
247
  <Markdown
248
+ variant="reader"
248
249
  enableHeadingLinks
249
250
  onHeadingsExtracted={setHeadings}
250
251
  fileRefs={fileRefs}