mopress

    A modern documentation and static site generator for the MoonBit ecosystem, inspired by mdBook and Hakyll

    docs
    utils
    cli
    functional
    site-generator
    website
    Download zip
    Author
    Version
    0.1.0
    License
    GPL-3.0-or-later
    Last updated
    4 months ago
    Downloads
    128

    #himeno/mopress

    wakatime Language License CI

    A modern documentation and static site generator for the MoonBit ecosystem, inspired by mdBook and Hakyll.

    #Overview

    mopress offers two usage modes:

    Book mode — out-of-the-box experience similar to mdBook. Configure via sena.toml and write Markdown. No code required.

    Site mode — declare rules and pipelines in site.mbt for full control over how your content is processed and rendered. Inspired by Hakyll's composable compiler design.

    #Features

    • Composable pipeline API — chain transforms with |>
    • Front matter support
    • Built-in preprocessors: callout blocks, math (LaTeX), file includes
    • External preprocessor protocol (stdin/stdout, language-agnostic)
    • WebComponent-friendly — raw HTML in Markdown is preserved, bring your own components
    • Global CSS/JS injection
    • Lightweight template engine built-in
    • Outputs clean static HTML

    #Development

    #Environment

    • MoonBit
    • Just
    • Bun
    • Lefthook

    #Build

    just init just build just test

    #Example

    fn main {
    mopress([
    Glob(
    "*.markdown",
    Text(raw => {
    raw
    |> set_extension("html")
    |> render_markdown_and_frontmatter
    |> load_and_apply_template("test/src/templates/default.html")
    |> import_js("./custom.js")
    |> import_css("./custom.css")
    |> use_js("console.log('hi, moonbit! hi, mopress!')")
    |> use_css("some css code")
    |> identify
    }),
    ),
    Glob("images/*", Binary(raw => raw |> identify)),
    Glob("css/*", Copy),
    ])
    }

    #License

    Under the terms of the GNU General Public License, version 3 (GPLv3).