A modern documentation and static site generator for the MoonBit ecosystem, inspired by mdBook and Hakyll
Dependencies
moon add himeno/mopressmopress init
mopress build
mopress servetitle = "MoPress Doc"
description = "A modern documentation and static site generator for the MoonBit ecosystem, inspired by mdBook and Hakyll"
keywords = "Documentation,Static Site Generator,SSG,MoonBit,MoonLang,Moon,Functional,Haskell,mdBook,Hakyll"
favicon = "https://himeno-sena.com/favicon.ico"
logo = "https://himeno-sena.com/favicon.ico"
authors = ["Himeno Sena"]
language = "en"
src = "./"
dest = "./dest"
repository = "https://github.com/biyuehu/mopress"
[features]
highlight-enabled = false
highlight-theme = "github"
mathjax-enabled = false
[extensions]
template = "templates/default.html"
assets = ["images/**/*", "styles/**/*", "scripts/**/*", "plugins/runtime/**/*"]
inject-head = []
inject-body = []
use-js = ["console.log('Hello, MoPress!');"]
use-css = []
import-css = []
import-js = []
preprocessors = []
transformers = []
src/
├── SUMMARY.md
└── intro.mdmopress new my-book
cd my-book
moon run --target native site.mbtx build
moon run --target native site.mbtx serveimport {
"himeno/mopress/core",
"moonbitlang/async",
}
///|
async fn main {
@core.mopress([
Glob(
"**/*.md",
Text(raw => {
raw
|> @core.set_extension(".html")
|> @core.render_markdown_and_frontmatter
|> @core.load_and_apply_template("templates/default.html")
|> @core.use_js(["console.log('hi, moonbit! hi, mopress!')"])
|> @core.unify
}),
),
Glob("styles/**/*", Copy),
])
}async fn process_markdown_page(raw : Item[String], config : BookConfig, summary : Summary) -> Item[Thing]A modern documentation and static site generator for the MoonBit ecosystem, inspired by mdBook and Hakyll
Dependencies