Pure MoonBit RTF parsing, structured extraction, diagnostics, and text conversion.
Dependencies
| 组件 | 完整版本 | 构建日期 |
|---|---|---|
| 构建工具 moon | 0.1.20260915 (2e1a46d) | 2026-09-15 |
| 编译器 moonc | v0.10.13+cbb11c36f | 2026-09-15 |
| 执行器 moonrun | 0.1.20260915 (2e1a46d) | 2026-09-15 |
git clone https://github.com/tlhuecdkoyg/MoonRTF.git
cd MoonRTF
moon update
moon run examples/basic
moon run --target native cmd/main -- text fixtures/basic.rtf
moon run --target native cmd/main -- json fixtures/basic.rtf --pretty
moon run --target native cmd/main -- markdown fixtures/basic.rtf
moon run --target native cmd/main -- html fixtures/basic.rtf -o fragment.html
moon run --target native cmd/main -- csv fixtures/table.rtf
moon run --target native cmd/main -- validate fixtures/malformed.rtfmoon add tlhuecdkoyg/MoonRTF@0.2.0///|
test "README extraction" {
let result = @MoonRTF.parse(
b"{\\rtf1 Hello {\\b MoonRTF}! \\u20013?\\u25991?}",
)
assert_true(result.acceptable())
assert_eq(result.document.to_text(), "Hello MoonRTF! 中文")
assert_eq(result.document.find_text("MoonRTF").length(), 1)
}moon check --target all --deny-warn
moon test --target all --deny-warn
moon fmt --check
moon info
python scripts/count_lines.py --minimum 4000
moon build --target native --release cmd/main
python scripts/smoke_cli.py
python scripts/stress_cli.pypub(all) struct Conversion {
content : String
diagnostics : Array[Diagnostic]
exceeded_limit : Bool
} derive(Eq, ToJson, Debug)fn Document::conversion_diagnostics(self : Document, format : OutputFormat, include_hidden? : Bool) -> Array[Diagnostic]fn MappedText::find_all(self : MappedText, needle : String, ascii_insensitive? : Bool, max_matches? : Int, overlapping? : Bool) -> Array[TextMatch]fn ParseResult::convert(self : ParseResult, format : OutputFormat, options? : TextOptions, max_output_units? : Int) -> Conversionpub(all) struct Statistics {
input_bytes : Int
paragraphs : Int
runs : Int
characters : Int
hidden_characters : Int
words : Int
tables : Int
rows : Int
cells : Int
links : Int
fonts : Int
colors : Int
attachments : Int
body_paragraphs : Int
header_paragraphs : Int
footer_paragraphs : Int
note_paragraphs : Int
} derive(Eq, ToJson, Debug)pub(all) struct ValidationReport {
valid : Bool
complete : Bool
errors : Int
warnings : Int
diagnostics : Array[Diagnostic]
} derive(Eq, ToJson, Debug)fn explain_diagnostics(input : Bytes, diagnostics : Array[Diagnostic], max_messages? : Int) -> StringInstall
Download zipPure MoonBit RTF parsing, structured extraction, diagnostics, and text conversion.
Dependencies