Standalone (Offline) Editor

May 31, 2026 · View on GitHub

The standalone editor bundles all fence-rendering libraries into a single file so that quikdown works fully offline — no CDN requests, no network dependencies.

What's Bundled

LibraryPurposeSize Contribution
highlight.jsSyntax highlighting (12 languages)~500 KB
mermaidDiagram rendering~2.0 MB
DOMPurifyHTML fence sanitization~30 KB
LeafletGeoJSON map rendering + base64 marker icons~140 KB
Three.jsSTL 3D model rendering~500 KB
ABCJSABC music notation rendering~300 KB
Vega + Vega-Lite + Vega-EmbedData visualization charts~1.5 MB
MathJax (tex-svg)Math equation rendering~1.5 MB
Natural Earth (110m + admin-1)Offline vector basemap for GeoJSON maps (2 sibling .topojson files)~1 MB
quikdown editorCore editor + parser~98 KB

Total offline core (JS + basemap): ≤ 9 MB uncompressed (~1.5 MB gzipped for JS alone)

The standalone bundle defaults allowExternalFetch: false — all rendering is local with no network requests. Pass allowExternalFetch: true to re-enable OSM tiles and CDN loads.

Distribution Files

FileFormatUse Case
quikdown_edit_standalone.esm.min.jsES Module (minified)Modern apps with import
quikdown_edit_standalone.umd.min.jsUMD (minified)Script tag, any environment
basemap_countries_110m.topojsonTopoJSONCountry fills (keep next to JS)
basemap_admin1_lines.topojsonTopoJSONState/province borders (keep next to JS)
quikdown_edit_standalone.esm.jsES ModuleDevelopment / debugging
quikdown_edit_standalone.umd.jsUMDDevelopment / debugging

Usage

ES Module

<div id="editor"></div>
<script type="module">
  import QuikdownEditor from './quikdown_edit_standalone.esm.min.js';
  const editor = new QuikdownEditor('#editor', { mode: 'split' });
  editor.setMarkdown('# Hello offline world!');
</script>

UMD (Script Tag)

<div id="editor"></div>
<script src="quikdown_edit_standalone.umd.min.js"></script>
<script>
  const editor = new QuikdownEditor('#editor', { mode: 'split' });
  editor.setMarkdown('# Hello offline world!');
</script>

API

The standalone editor has the exact same API as the regular editor (quikdown_edit.js). All options, methods, and events work identically. The only difference is that fence-rendering libraries are pre-loaded instead of lazy-loaded from CDN.

See API Reference for the full editor API.

Building

The standalone bundle is built separately from the main build:

npm run build:standalone

This runs a dedicated rollup config (rollup.config.standalone.js) that bundles all dependencies with inlineDynamicImports: true. Fence libraries (highlight.js, mermaid, dompurify, leaflet, three, abcjs, vega, vega-lite, vega-embed, mathjax-full) must be present in devDependencies — CI runs npm ci before building.

The main build (npm run build) does NOT include the standalone bundle. To build everything:

npm run build:all

Release CI and npm run release always run build:all, verify:release, and test:standalone:e2e so the offline bundle cannot be omitted from a ship.

Release / CI

StepWhat happens
npm run releasebuild:allverify:releasetest:standalone:e2ebuild:airgapnpm test → auto-commit dist/
PR / daily CInpm run build + tests only — no standalone build
publish.ymlbuild:all, verify:release, standalone smoke, npm publish, GitHub Release assets
npm publishStandalone in dist/ (files: ["dist"])
GitHub Releasequikdown_edit_standalone.*.min.js, .gz, and quikdown-airgap-vX.Y.Z.zip

See release-process.md for the full workflow.

When to Use

Use the standalone bundle when:

  • Air-gapped environments — no internet access
  • Offline-first apps — PWAs, Electron, mobile webviews
  • Self-hosted deployments — no dependency on external CDNs
  • Embedded systems — single-file deployment with no network

Use the regular editor when:

  • Bundle size matters — the regular editor is 86 KB; fence libraries are loaded on demand
  • Most fences aren't used — if your users only write text and code blocks, loading mermaid/leaflet/three.js upfront is waste
  • CDN is available — lazy loading gives the best initial load time

Supported Languages (highlight.js)

The standalone bundle includes syntax highlighting for 12 common languages:

JavaScript, TypeScript, Python, Java, C, C++, CSS, HTML/XML, JSON, Bash, Shell, SQL

Additional languages can be registered at runtime if highlight.js is available on window.hljs:

// After importing the standalone editor
import go from 'highlight.js/lib/languages/go';
window.hljs.registerLanguage('go', go);