Skip to main content
independoc
Language: English

Quick Start#

With Node.js 22.0.0 or newer (Node.js 22 / 24 LTS recommended), you can scaffold, preview, and build a documentation site directly — without running npm install.

Setup Steps#

  1. Verify your Node.js version.

    bash
    node --version
    # Must be v22.x.x or newer
  2. Scaffold a new documentation project.

    bash
    node ./bin/independoc.js init ./my-docs
    cd my-docs
  3. Start the local dev server with live reload.

    bash
    node ../bin/independoc.js serve --port 3000
  4. Check internal links and build the static site.

    bash
    node ../bin/independoc.js check
    node ../bin/independoc.js build --strict-links

Core Workflow#

Generate a minimal docs starter directory in seconds.

bash
node ./bin/independoc.js init ./my-docs
cd my-docs

This creates independoc.config.json, docs/index.md, and docs/01-getting-started.md. To preview or build this repository's own official site, run npm run serve or npm run build from the repository root.

Start a local development server with file watching and SSE (Server-Sent Events) live reload.

bash
# Run inside my-docs
node ../bin/independoc.js serve --port 3000

By default it binds to 127.0.0.1 and validates the Host header to protect against DNS rebinding.

Compile Markdown under docs/ (plus i18n/ and versioned_docs/ when configured) and assets in static/ into dist/.

bash
# Run inside my-docs
node ../bin/independoc.js build --strict-links

Output is staged into a temporary directory and swapped atomically so a failed build never corrupts an existing dist/ directory.

Validate Markdown syntax, duplicate routes, internal links, heading anchors, and navbar links without writing output files.

bash
# Run inside my-docs
node ../bin/independoc.js check

Directory Layout & URL Rules#

Files under docs/ map directly to the sidebar hierarchy and clean trailing-slash URLs. For multi-language documentation, add i18n/<locale>/docs/ and register the locale in i18n.locales and i18n.localeConfigs.

  • docs/

    • index.md → /
    • 01-getting-started.md → /getting-started/
    • 02-markdown-and-components.md → /markdown-and-components/
    • 03-configuration.md → /configuration/
    • guides/

      • _category.json Category label, order, and default collapse state
      • 01-zero-dependency-design.md → /guides/zero-dependency-design/
      • 03-deployment.md → /guides/deployment/
  • i18n/

    • en/

      • docs/ → /en/...
    • zh/

      • docs/ → /zh/...
  • static/ Static assets copied as-is
  • independoc.config.json Site configuration
  • Automatic numeric prefix stripping: Prefixes like 01- in 01-getting-started.md control ordering and are stripped from final URLs.
  • Index pages: index.md (or README.md) serves the directory root URL.
  • Relative .md link rewriting: Links such as [Configuration Reference](./03-configuration.md) are rewritten at build time with basePath and locale prefixes.
  • Draft exclusion: Pages with draft: true in Frontmatter are excluded from production builds, search indexes, and llms.txt unless --include-drafts is passed.

Continue to Markdown & Web Components.

Edit this pageLast updated:
Built with independoc itself — 0 npm dependencies.