windhamdavid 1 day ago
parent
commit
1442f91a9a
8 changed files with 125 additions and 115 deletions
  1. 1 1
      docs/index.md
  2. 1 0
      docusaurus.config.js
  3. 1 0
      notes/house/house.md
  4. 0 0
      posts/2025/2025-03-31-posts.md
  5. 16 7
      scripts/build-graph.mjs
  6. 0 0
      src/data/graph.json
  7. 1 3
      src/pages/graph.jsx
  8. 105 104
      src/pages/map.md

+ 1 - 1
docs/index.md

@@ -51,7 +51,7 @@ I use this library of documents as a quick reference to find technical answers,
 
 
 ### AI
 ### AI
 
 
-[ai](/docs/ai/ai.md)
+[ai](ai/ai.md)
 
 
 ### Computers
 ### Computers
 
 

+ 1 - 0
docusaurus.config.js

@@ -135,6 +135,7 @@ export default {
         {to: 'about/',activeBasePath: 'til',label: 'About',position: 'left'},
         {to: 'about/',activeBasePath: 'til',label: 'About',position: 'left'},
         {to: 'ai', label: 'AI',position: 'left'},
         {to: 'ai', label: 'AI',position: 'left'},
         {to: 'docs/',activeBasePath: 'docs',label: 'Docs',position: 'left'},
         {to: 'docs/',activeBasePath: 'docs',label: 'Docs',position: 'left'},
+        {to: 'graph',activeBasePath: 'graph',label: 'Graph',position: 'left'},
         {to: 'lists/',activeBasePath: 'lists',label: 'Lists',position: 'left'},
         {to: 'lists/',activeBasePath: 'lists',label: 'Lists',position: 'left'},
         {to: 'notes/',activeBasePath: 'notes',label: 'Notes',position: 'left'},
         {to: 'notes/',activeBasePath: 'notes',label: 'Notes',position: 'left'},
         {to: 'posts/',activeBasePath: 'posts',label: 'Posts',position: 'left'}, 
         {to: 'posts/',activeBasePath: 'posts',label: 'Posts',position: 'left'}, 

+ 1 - 0
notes/house/house.md

@@ -8,6 +8,7 @@
 | [build](build.md)
 | [build](build.md)
 | [fireplaces](fire.md)
 | [fireplaces](fire.md)
 | [helene](helene.md)
 | [helene](helene.md)
+| [kitchen](kitchen.md)
 | [studio](studio.md)
 | [studio](studio.md)
 | [helene repairs](helene-repairs.md)
 | [helene repairs](helene-repairs.md)
 | [helene ins](helene-ins-sum.md)
 | [helene ins](helene-ins-sum.md)

+ 0 - 0
posts/2025/2025-03-31-post.md → posts/2025/2025-03-31-posts.md


+ 16 - 7
scripts/build-graph.mjs

@@ -33,12 +33,9 @@ const DOC_SECTIONS = [
   { dir: 'lists', base: '/lists', group: 'lists' },
   { dir: 'lists', base: '/lists', group: 'lists' },
 ];
 ];
 const BLOG_SECTIONS = [{ dir: 'posts', base: '/posts', group: 'posts' }];
 const BLOG_SECTIONS = [{ dir: 'posts', base: '/posts', group: 'posts' }];
-const PAGES = [
-  { route: '/', label: 'Home', group: 'page' },
-  { route: '/ai', label: 'AI Assistant', group: 'page' },
-  { route: '/help', label: 'Help', group: 'page' },
-  { route: '/map', label: 'Map', group: 'page' },
-  { route: '/about', label: 'About', group: 'page' },
+const PAGES_DIR = 'src/pages';                                 // about.md, ai.mdx, map.md, โ€ฆ
+const MANUAL_NODES = [                                          // routes with no .md in src/pages
+  { route: '/graph', label: 'Graph', group: 'page' },          // graph.jsx
   { route: '/posts', label: 'Posts (blog index)', group: 'page' },
   { route: '/posts', label: 'Posts (blog index)', group: 'page' },
 ];
 ];
 
 
@@ -113,7 +110,7 @@ const addNode = (route, label, group, partial = false) => {
   if (!nodes.has(route)) nodes.set(route, partial ? { id: route, label, group, partial: true } : { id: route, label, group });
   if (!nodes.has(route)) nodes.set(route, partial ? { id: route, label, group, partial: true } : { id: route, label, group });
   if (!byLc.has(route.toLowerCase())) byLc.set(route.toLowerCase(), route);
   if (!byLc.has(route.toLowerCase())) byLc.set(route.toLowerCase(), route);
 };
 };
-PAGES.forEach((p) => addNode(p.route, p.label, p.group));
+MANUAL_NODES.forEach((p) => addNode(p.route, p.label, p.group));
 
 
 let skipped = 0, noSlug = 0;
 let skipped = 0, noSlug = 0;
 
 
@@ -158,6 +155,16 @@ for (const { dir, base, group } of BLOG_SECTIONS) {
   }
   }
 }
 }
 
 
+// standalone pages (src/pages/*.md|mdx) โ€” parse their bodies so About/Map/AI/Home connect
+for (const file of walk(join(ROOT, PAGES_DIR))) {
+  const name = basename(file).replace(/\.mdx?$/, '');
+  if (name.startsWith('_')) continue;
+  const { data, body } = parseFrontmatter(readFileSync(file, 'utf8'));
+  const route = name === 'index' ? '/' : `/${name}`;
+  addNode(route, titleOf(data, body, name), 'page');
+  files.push({ base: '', rel: name, route, body }); // base '' โ†’ relative links resolve from site root
+}
+
 // ---------- link resolution ----------
 // ---------- link resolution ----------
 const matchRoute = (r) => (r == null ? null : nodes.has(r) ? r : byLc.get(r.toLowerCase()) || null);
 const matchRoute = (r) => (r == null ? null : nodes.has(r) ? r : byLc.get(r.toLowerCase()) || null);
 
 
@@ -193,12 +200,14 @@ const links = [];
 const unresolved = new Map();
 const unresolved = new Map();
 const LINK_RE = /\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g;
 const LINK_RE = /\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g;
 const HREF_RE = /href=["']([^"']+)["']/g;
 const HREF_RE = /href=["']([^"']+)["']/g;
+const CLICK_RE = /^\s*click\s+\S+\s+"([^"]+)"/gm;             // mermaid: click NODE "url" (map.md)
 
 
 for (const { base, rel, route, body } of files) {
 for (const { base, rel, route, body } of files) {
   const targets = new Set();
   const targets = new Set();
   let m;
   let m;
   while ((m = LINK_RE.exec(body))) targets.add(m[1]);
   while ((m = LINK_RE.exec(body))) targets.add(m[1]);
   while ((m = HREF_RE.exec(body))) targets.add(m[1]);
   while ((m = HREF_RE.exec(body))) targets.add(m[1]);
+  while ((m = CLICK_RE.exec(body))) targets.add(m[1]);
   for (const t of targets) {
   for (const t of targets) {
     const dest = resolveLink(t, base, rel);
     const dest = resolveLink(t, base, rel);
     if (!dest) {
     if (!dest) {

File diff suppressed because it is too large
+ 0 - 0
src/data/graph.json


+ 1 - 3
src/pages/graph.jsx

@@ -8,9 +8,7 @@ export default function GraphPage() {
       <main style={{padding: '1rem 1.25rem 0'}}>
       <main style={{padding: '1rem 1.25rem 0'}}>
         <h1 style={{marginBottom: '0.25rem'}}>Graph</h1>
         <h1 style={{marginBottom: '0.25rem'}}>Graph</h1>
         <p style={{marginBottom: '0.75rem', maxWidth: 820}}>
         <p style={{marginBottom: '0.75rem', maxWidth: 820}}>
-          How the pages here link to one another โ€” docs, notes, lists, and posts. Unlike the
-          file-based view, this resolves the absolute route links too, so the posts' outgoing
-          links to docs/notes/lists show up as edges. Rebuilt with <code>npm run graph</code>.
+          How the pages here link to one another โ€” rebuilt with <code>npm run graph</code>.
         </p>
         </p>
         <KnowledgeGraph />
         <KnowledgeGraph />
       </main>
       </main>

+ 105 - 104
src/pages/map.md

@@ -8,7 +8,111 @@ hide_table_of_contents: true
 
 
 # Map
 # Map
 
 
-A clickable version of the top level โ€” nodes link out to each section (the full picture is in the mindmap below).
+```mermaid
+%%{
+  init: {
+    'theme':'forest'
+  }
+}%%
+mindmap
+  root)DAW.com ๐Ÿ’ป(
+    About ๐Ÿ“•
+      Ancestors
+      Bio
+      CV
+    )DW.com ๐Ÿ“˜ (
+    )Desk ๐Ÿ“‘(
+      Bookmarks
+      Categories
+      Posts
+      Reader
+      Tags
+    )Code ๐Ÿ’ป(
+      Activity
+      Commits
+      Repos ๐Ÿ’พ
+        Branches
+        Commits
+        Issues
+        Releases
+      Wikis
+    )Contact ๐Ÿ“ฅ(
+      Chat
+      Chess
+      Contract
+      Guestbook
+      Inquiry
+      Invoice
+      Email List
+      Pay
+      Support
+    Search ๐Ÿ”Ž
+    Sitemap
+      Analytics
+      Privacy
+    )Studio ๐Ÿ–ฅ๏ธ(
+      Art
+      Audio
+      Design
+      Projects
+      Photo
+      Radio
+      Video
+      Web
+    )TIL ๐Ÿ“–(
+      AI
+      Docs ๐Ÿ““
+        Computers
+        Data
+        Database
+        Editors
+        Frameworks
+        Language
+        SaaS
+        Server
+        Hosted
+        Shell
+        Software
+        Versioning
+      Ideas
+      Notes ๐Ÿ—’๏ธ
+        art
+        dogs
+        garden
+        house
+        personal
+        work
+      Lists โœ…
+        Now โŒš๏ธ
+          Learning
+          Listening
+          Playing
+          Reading
+          Watching
+        Next
+        Todo
+        Groceries
+        Shopping
+        Art
+        Lit
+        Motion
+        Music
+        Visual
+        Concepts
+        Design
+        Feeds
+        Lists
+        Places
+        People
+        Things
+        Trivia
+        Tweets
+        Quotes
+        Words
+      Posts
+```
+
+A clickable version of the top level โ€” nodes link out to each section
 
 
 ```mermaid
 ```mermaid
 flowchart LR
 flowchart LR
@@ -182,106 +286,3 @@ flowchart LR
   click LS_WORDS "https://davidawindham.com/til/lists/words" _blank
   click LS_WORDS "https://davidawindham.com/til/lists/words" _blank
 ```
 ```
 
 
-```mermaid
-%%{
-  init: {
-    'theme':'forest'
-  }
-}%%
-mindmap
-  root)DAW.com ๐Ÿ’ป(
-    About ๐Ÿ“•
-      Ancestors
-      Bio
-      CV
-    )DW.com ๐Ÿ“˜ (
-    )Desk ๐Ÿ“‘(
-      Bookmarks
-      Categories
-      Posts
-      Reader
-      Tags
-    )Code ๐Ÿ’ป(
-      Activity
-      Commits
-      Repos ๐Ÿ’พ
-        Branches
-        Commits
-        Issues
-        Releases
-      Wikis
-    )Contact ๐Ÿ“ฅ(
-      Chat
-      Chess
-      Contract
-      Guestbook
-      Inquiry
-      Invoice
-      Email List
-      Pay
-      Support
-    Search ๐Ÿ”Ž
-    Sitemap
-      Analytics
-      Privacy
-    )Studio ๐Ÿ–ฅ๏ธ(
-      Art
-      Audio
-      Design
-      Projects
-      Photo
-      Radio
-      Video
-      Web
-    )TIL ๐Ÿ“–(
-      AI
-      Docs ๐Ÿ““
-        Computers
-        Data
-        Database
-        Editors
-        Frameworks
-        Language
-        SaaS
-        Server
-        Hosted
-        Shell
-        Software
-        Versioning
-      Ideas
-      Notes ๐Ÿ—’๏ธ
-        art
-        dogs
-        garden
-        house
-        personal
-        work
-      Lists โœ…
-        Now โŒš๏ธ
-          Learning
-          Listening
-          Playing
-          Reading
-          Watching
-        Next
-        Todo
-        Groceries
-        Shopping
-        Art
-        Lit
-        Motion
-        Music
-        Visual
-        Concepts
-        Design
-        Feeds
-        Lists
-        Places
-        People
-        Things
-        Trivia
-        Tweets
-        Quotes
-        Words
-      Posts
-```

Some files were not shown because too many files changed in this diff