Skip to content

Repository files navigation

wdpr

Wikidot markup parser and renderer.

Packages

Package Description
@wdprlib/ast AST types for Wikidot markup
@wdprlib/parser Parser for Wikidot markup
@wdprlib/render HTML renderer for Wikidot markup
@wdprlib/decompiler Decompiler for Wikidot markup
@wdprlib/runtime Client-side runtime for Wikidot markup

Installation

npm install @wdprlib/parser @wdprlib/render

Example

WDPR Workers wiki starter is a D1-backed starter using Cloudflare Workers, the official Cloudflare Vite plugin, Hono, vanilla TypeScript, and R2-backed HTML blocks.

Usage

import { parse } from '@wdprlib/parser'
import { renderToHtml } from '@wdprlib/render'

const ast = parse('**Hello** world')
const html = renderToHtml(ast)

Build information

Every package exports its own build information:

import { buildInfo } from '@wdprlib/render'

buildInfo.version // This package's version
buildInfo.sha     // Full source commit SHA, or null when unavailable
buildInfo.dirty   // Uncommitted repository changes, or null when unavailable

The object is read-only and frozen. It records a snapshot when metadata is generated, not the current state of the consuming application. dirty includes tracked and untracked changes across the repository, excluding ignored files. Dependency package versions are not included. ESM, CommonJS and Bun exports carry the same snapshot.

Development

bun install
bun run build
bun test

bun install and build startup generate package metadata automatically. Run bun run build:info after changing the checkout when using source imports without rebuilding. Restart bun run dev to refresh metadata during watch development. Generated metadata is included in published packages; consumers do not need Git.

Origins

wdpr began as an independent TypeScript implementation of Wikidot markup. Its syntax behavior, AST compatibility, and parser design were developed with reference to the following projects, and portions of the project were later adapted from them:

See THIRD-PARTY-LICENSES.md for the applicable notices and licenses.

License

Available under the terms of the GNU Affero General Public License. See LICENSE.

About

Wikidot markup parser and renderer.

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages