Static website for Control Path with CSS-only syntax highlighting.
This website uses pre-rendered syntax highlighting - code blocks are highlighted at build time, so no JavaScript is needed in the browser. Only CSS is required at runtime.
- Install dependencies:
npm install- Run the highlight script to pre-render syntax highlighting:
npm run highlightOr directly:
node highlight.js- The
highlight.jsscript processes all HTML files - It finds all
<code class="language-xxx">blocks - Uses Prism.js to highlight the code and add HTML spans with CSS classes
- The HTML is updated with the highlighted code
- At runtime, only the CSS file (
prism-theme.css) is needed - no JavaScript!
- TypeScript (
language-typescript) - JavaScript (
language-javascript) - YAML (
language-yaml) - Bash (
language-bash) - Plain text (
language-plaintext)
- Edit HTML files with code blocks using
class="language-xxx" - Run
npm run highlightto pre-render highlighting - Deploy the static files (HTML + CSS, no JS needed)