HTML Documentation Build System
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.
Quick Start
View HTML Documentation
All HTML files live in the html/ directory:
- Open
html/index.htmlin your browser for the homepage - Browse the
html/docs/folder for chapter and appendix pages - All internal links between documents are preserved
Build Commands
# Install dependencies (first time only)
npm install
# Build HTML once
npm run build:html
# Watch mode - auto-rebuild on markdown changes
npm run watch:html
# Clean generated files
npm run clean
How It Works
The build is run locally before committing. There is no CI pipeline - you build the HTML yourself and commit both the .md source and the html/ output in the same commit.
Typical workflow:
- Edit one or more
.mdfiles - Run
npm run build:html - Stage and commit everything:
git add -A && git commit -m "docs: update chapter 6 and rebuild HTML" - Push
What Gets Converted
docs/*.md→html/docs/*.htmllearning-room/**/*.md→html/learning-room/**/*.htmlREADME.md→html/index.htmlCONTRIBUTING.md→html/CONTRIBUTING.html- All other root-level
.mdfiles
HTML Features
Style and Layout:
- GitHub-flavored Markdown styling (familiar appearance)
- Responsive design (mobile and desktop)
- Syntax highlighting for code blocks
- Clean, readable typography
Accessibility:
- Semantic HTML5 markup
- Proper ARIA labels and roles
- Keyboard navigation support
- High contrast mode support
- Skip-to-content links
- Screen reader friendly navigation
Navigation:
- Breadcrumb links on every page
- Footer with return link
- Preserves all internal links between documents
Configuration Files
- Build script:
scripts/build-html.js- Conversion logic - Dependencies:
package.json- Node.js packages (marked, highlight.js, etc.)
Customization
Modify Styling
Edit scripts/build-html.js and look for the customCss constant to add custom styles.
Change HTML Template
Edit the htmlTemplate function in scripts/build-html.js to modify the page structure.
Update Dependencies
# Check for updates
npm outdated
# Update packages
npm update
# Commit package.json changes
git add package.json
git commit -m "chore: update HTML build dependencies"
Troubleshooting
Local Build Errors
"Cannot find module 'marked'"
→ Run npm install first
"Permission denied" errors
→ Check write permissions on the html/ directory
HTML doesn't look right → Clear browser cache and reload
Watch mode not detecting changes → Ensure you're saving files (Ctrl+S in VS Code)
HTML Files Not Appearing in Git
Check .gitignore to ensure html/ is NOT listed there. The html/ directory must be tracked by Git so the built output is always available in the repository.
For Contributors
When submitting pull requests:
- Edit the Markdown files, then run
npm run build:html - Include both the
.mdchanges and the updatedhtml/files in your commit - If you forget to rebuild, a reviewer will ask you to run the build before merging
Additional Resources
- marked documentation - Markdown parser
- highlight.js documentation - Syntax highlighting
- GitHub Markdown spec - GitHub Flavored Markdown
For complete contributor guidelines, see CONTRIBUTING.md.