Extended Markdown template engine for TypeScript / JavaScript.
Control flow and templating live in HTML comments (@hg … @endhg or @@ … @@), so source files stay preview-friendly. The library outputs Markdown only (HTML is left to the consumer).
- Package name:
@b4moss/hyogen-md - Product name: hyogen.md(表現.md)
- License: MIT
- Japanese README: README_ja.md
- Changelog: user-docs/changelog.md
- Documentation: https://hyogenmd.oss.b4m.jp (Nuxt Content; not in npm)
- Playground: https://hyogenmd.oss.b4m.jp/playground (same site; not in npm)
- Specs (Japanese, maintainers): docs/
Homepage: https://github.com/b4m-oss/hyogen-md
This file is kept in sync at the repository root and at app/README.md (npm package root).
npm install @b4moss/hyogen-mdRequires Node.js >= 24.
npx hyogen-md create my-site
cd my-site
npm install
npm run dev # preview with file tree + HMR (default http://127.0.0.1:4173)
npm run build # write Markdown to outDir (default ./out)hyogen.config.js (or .ts):
import { defineConfig } from "@b4moss/hyogen-md/config";
export default defineConfig({
input: "./src/**/*.md",
// outDir: "./out",
});import { renderClient } from "@b4moss/hyogen-md/client";
const result = await renderClient(
{ path: "/src/index.md" },
{ siteName: "Demo" },
{
loader: async (path) => {
// resolve path → file contents (virtual FS, fetch, etc.)
return await readSomewhere(path);
},
},
);
console.log(result.markdown);
console.log(result.warnings);import { renderServer, createNodeLoader } from "@b4moss/hyogen-md";
const result = await renderServer(
{ path: "./pages/index.md" },
{ title: "Hello" },
{
loader: createNodeLoader(),
// serverContext: { apiKey: "…" }, // server-only; not available on renderClient
},
);import { build } from "@b4moss/hyogen-md";
const { files, warnings } = await build({
input: "./src/**/*.md",
outDir: "./out",
context: { siteName: "Demo" },
});API details: docs/specs/api.md.
| Path | Role |
|---|---|
app/ |
Library published to npm (files: dist, plus README / LICENSE) |
docs-site/ |
Documentation site + Playground on GitHub Pages (not in npm) |
user-docs/ |
User-facing docs (e.g. changelog) |
docs/ |
Specs and roadmap (Japanese, maintainers) |
Site: https://hyogenmd.oss.b4m.jp (GitHub Pages; /ja, /en, /playground).
Playground: https://hyogenmd.oss.b4m.jp/playground
Local:
make install-docs
make dev-docsOpen http://localhost:3000 (docs) and /playground. Uses ../app via Vite alias. Virtual FS + localStorage only.
This is 0.x. APIs and output may change until 1.0.0.
Published: @b4moss/hyogen-md@0.14.1 (git tag v0.14.1).
Playground UX ships with the documentation site and is not included in the npm tarball.
The coverage badge reflects statement coverage for app/ (library) from Vitest (≥90% target; enforced by Vitest thresholds). Coverage is uploaded to Codecov from .github/workflows/quality.yml on pushes to main.
See user-docs/changelog.md (Japanese: changelog_ja.md).
MIT © Kohki SHIKATA
