目录

MoonBlox

Write Markdown. Embed MoonBit components. Ship interactive pages.

@badge(text: "new", tone: "info")

@counter(initial: 0)

:::callout(type: "note", title: "Tip")
Your Markdown content here.
:::

Features

  • Embed components in Markdown@counter(initial: 0) inline. Not a shortcode, not a template tag. Just part of your prose.
  • Composable, not configurable — write your own components with rabbita. Static, interactive, container — you decide what they do.
  • Zero-config buildmoonblox build scans your components, compiles to JavaScript, and assembles dist/ in one command.

Quick Start

Requires MoonBit toolchain.

git clone https://github.com/xz-xuezhe/moonblox
cd moonblox

# Scaffold a new site
moon run --target native cmd/moonblox -- init my-site

# Build and open
MOONBLOX_PATH=. moon run --target native cmd/moonblox -- build my-site
open my-site/dist/index.html

Project Structure

my-site/
  posts/index.md           # your Markdown content
  components/
    badge/                 # @badge(text: "new", tone: "info")
    counter/               # @counter(initial: 0)
    callout/               # :::callout ... :::
  theme/base.css           # global styles
  dist/                    # built output

Components

A component is a directory under components/<name>/:

  • moon.pkg — declares supported_targets = "js+native"
  • <name>.mbt — exports pub fn <name>_cell(args) -> @rabbita.Cell
  • <name>.css — optional, component styles

See the built-in components for examples.

Dependencies

License

Apache 2.0

关于

MoonBit-native programmable site generator with interactive components

123.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号