Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

SuperDoc — CDN

Zero build tools. A single HTML file plus the SuperDoc global bundle.

Run locally

pnpm --filter superdoc build              # builds superdoc.min.js
pnpm --filter @superdoc-dev/fonts build   # builds superdoc-fonts.min.js + the font faces
pnpm setup                                # copies both bundles + fonts + sample DOCX in
npx serve .

pnpm setup copies the built superdoc.min.js, superdoc-fonts.min.js, style.css, the font assets/, and a sample test_file.docx into this directory so the example is self-contained.

Use from the public CDN

Replace the local <script> and <link> with jsDelivr URLs:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/superdoc@latest/dist/style.css" />
<script src="https://cdn.jsdelivr.net/npm/superdoc@latest/dist/superdoc.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@superdoc-dev/fonts@latest/dist/superdoc-fonts.min.js"></script>

Pin to a specific version (e.g. superdoc@1.26.0) in production and add SRI hashes for integrity.

Fonts

The superdoc CDN build ships no fonts: by default the toolbar shows the baseline (one font per CSS generic) and documents render with system fonts. The reviewed fallback pack comes from the optional @superdoc-dev/fonts browser build, loaded as a second <script>. Pass its global to the editor:

new SuperDoc({ /* ... */ fonts: SuperDocFonts.superdocFonts });

From the public CDN the faces resolve automatically, relative to superdoc-fonts.min.js. Self-hosting copies both superdoc-fonts.min.js and the assets/ faces, keeping their relative layout; pnpm setup does this for you.

Learn more