@aewerdev/dokujs
v0.1.3
Published
Doku (.doku) compiler, builder and browser runtime for documentation, guides and books.
Maintainers
Readme
Doku (.doku)
Doku is a simple documentation format and toolchain for building online docs, guides, and books.
- Write content in
.dokufiles (Markdown + optional frontmatter in YAML---or TOML+++). - Use the browser runtime to embed a doc:
<script src="/path/to/dokujs.js"></script>then<doku src="/docs/intro.doku"></doku>. - Use the CLI to compile files or build full projects.
Install
Use your preferred package manager:
# npm
npm install -D dokujs
# pnpm
pnpm add -D dokujs
# yarn
yarn add -D dokujsCLI
Unified command doku with subcommands:
# Create project
npx doku new my-docs
# Build (HTML site)
npx doku build my-docs --format=html
# Build (Doku client output: emits .doku pages + client index)
npx doku build my-docs --format=doku
# Compile a single .doku to HTML
npx doku compile path/to/file.doku path/to/output.htmlLegacy binaries (still available): doku-new, doku-build, doku-compile.
Project Structure
my-doku/
doku.toml
version.yaml
config.json
index.html
src/
result.yaml
assets/
logo.svg
intro.md
intro.ru.md
chapter1.md
chapter1.ru.md
res/
index_<buildid>.html
index_<buildid>.js
assets/
... (copied from src/assets)
assets-manifest.jsonBrowser Usage
<script src="/path/to/dokujs.js"></script>
<doku src="/docs/intro.doku"></doku>Features
- i18n:
languagesand language-specificnavinsrc/result.yaml. The built site includes a language dropdown and persists selection. - Theming: theme colors (
theme.primary,theme.accent), dark/light theme toggle with highlight.js theme switching. - Code highlighting: highlight.js via Marked; works server-side (build) and client-side (runtime).
- Icons & UI: Font Awesome + W3CSS + W3JS included in generated HTML.
- Assets & Logo:
- Put static files under
src/assets/. They are copied unmodified tores/assets/on build. - A manifest
res/assets-manifest.jsonmaps each relative asset path to a uniqueid(for stable references). - Set a header logo via
logo: assets/logo.svginsrc/result.yaml.
- Put static files under
result.yaml (example)
title: My Docs
repo: https://github.com/your/repo
author:
name: Your Name
url: https://example.com
avatar: https://...
theme:
primary: "#0f62fe"
accent: "#f1c21b"
logo: assets/logo.svg
languages:
- code: en
label: English
- code: ru
label: Русский
socials:
- icon: github
url: https://github.com/your
nav:
en:
- text: Introduction
file: intro.md
ru:
- text: Введение
file: intro.ru.md