You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: add heading IDs to HTML build so TOC anchor links work on GitHub Pages
marked was rendering headings without id attributes, breaking all same-page
anchor links in table of contents sections. Added a custom heading renderer
using GitHub's anchor algorithm (lowercase, strip punctuation, spaces to hyphens).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
<p>This repository converts all Markdown files to accessible HTML. The HTML output is committed alongside the Markdown source so that both formats are always in sync.</p>
63
-
<h2>Quick Start</h2>
64
-
<h3>View HTML Documentation</h3>
63
+
<h2id="quick-start">Quick Start</h2>
64
+
<h3id="view-html-documentation">View HTML Documentation</h3>
65
65
<p>All HTML files live in the <code>html/</code> directory:</p>
66
66
<ul>
67
67
<li>Open <code>html/index.html</code> in your browser for the homepage</li>
68
68
<li>Browse the <code>html/docs/</code> folder for chapter and appendix pages</li>
69
69
<li>All internal links between documents are preserved</li>
70
70
</ul>
71
-
<h3>Build Commands</h3>
71
+
<h3id="build-commands">Build Commands</h3>
72
72
<pre><codeclass="hljs language-bash"><spanclass="hljs-comment"># Install dependencies (first time only)</span>
<p>The build is run <strong>locally</strong> before committing. There is no CI pipeline - you build the HTML yourself and commit both the <code>.md</code> source and the <code>html/</code> output in the same commit.</p>
85
85
<p><strong>Typical workflow:</strong></p>
86
86
<ol>
@@ -89,15 +89,15 @@ <h2>How It Works</h2>
89
89
<li>Stage and commit everything: <code>git add -A && git commit -m "docs: update chapter 6 and rebuild HTML"</code></li>
<p><strong>Watch mode not detecting changes</strong>
152
152
→ Ensure you're saving files (Ctrl+S in VS Code)</p>
153
-
<h3>HTML Files Not Appearing in Git</h3>
153
+
<h3id="html-files-not-appearing-in-git">HTML Files Not Appearing in Git</h3>
154
154
<p>Check <code>.gitignore</code> to ensure <code>html/</code> is NOT listed there. The <code>html/</code> directory must be tracked by Git so the built output is always available in the repository.</p>
155
-
<h2>For Contributors</h2>
155
+
<h2id="for-contributors">For Contributors</h2>
156
156
<p>When submitting pull requests:</p>
157
157
<ul>
158
158
<li><strong>Edit the Markdown files</strong>, then run <code>npm run build:html</code></li>
159
159
<li><strong>Include both</strong> the <code>.md</code> changes and the updated <code>html/</code> files in your commit</li>
160
160
<li>If you forget to rebuild, a reviewer will ask you to run the build before merging</li>
0 commit comments