A pure MoonBit, cross-platform OOXML viewer and lightweight editor core.
Dependencies
Library ยท conservative OOXML alpha. Read the product contract for the format matrix, bounded archive boundary, host boundary and release gates.
| Format | Viewer subset | Lightweight edit |
|---|---|---|
| .docx | Paragraphs, headings, lists, tables, basic run styles | Exact text replacement inside w:t |
| .xlsx | Sheets, common cell values, formulas, styles, merged ranges | Set a cell to inline text |
| .pptx | Slide order and size, text, shapes, pictures, transforms | Exact text replacement inside a:t |
moon check --target all
moon test --target all
moon info
moon fmtpub(all) suberror DocumentSessionError {
UnsupportedFormat(String)
Package(String)
Render(String)
OperationNotSupported(operation~ : String, format~ : DocumentFormat)
InvalidFind(String)
InvalidCoordinates(row~ : Int, column~ : Int)
SheetNotFound(String)
FormulaCell(sheet~ : String, row~ : Int, column~ : Int)
MergedCellNotAnchor(sheet~ : String, row~ : Int, column~ : Int)
SaveVerification(String)
} derive(Eq, Debug)pub struct DocumentSession {
// private fields
}fn DocumentSession::replace_text(self : DocumentSession, find : String, replacement : String) -> DocumentSession raise DocumentSessionErrorfn DocumentSession::save_as_copy(self : DocumentSession) -> VerifiedDocumentCopy raise DocumentSessionErrorfn DocumentSession::set_cell_text(self : DocumentSession, sheet : String, row : Int, column : Int, text : String) -> DocumentSession raise DocumentSessionErrorpub struct VerifiedDocumentCopy {
// private fields
}fn open_session(filename : String, content : FixedArray[Byte]) -> DocumentSession raise DocumentSessionErrorfn open_session_with_policy(filename : String, content : FixedArray[Byte], policy : ArchivePolicy) -> DocumentSession raise DocumentSessionErrorfn open_with_policy(filename : String, content : FixedArray[Byte], policy : ArchivePolicy) -> Document raise MoonLeafErrorA pure MoonBit, cross-platform OOXML viewer and lightweight editor core.
Dependencies