Std.Office.Docx
Std.Office.Docx — read and write Word documents (.docx) as blocks of
Types
type alias Run = { text : String , bold : Bool , italic : Bool , link : Maybe String }
type ListKind = Bulleted | Numbered
type Block = Heading Int (List Run) | Paragraph (List Run) | ListItem ListKind Int (List Run) | Table (List (List (List Block)))
type alias Limits = { zip : Zip.Limits , maxBlocks : Int , maxDepth : Int }
type RawRun
type RawBlock
type alias TextState = { lines : List String , counters : List Int }
Values
defaultLimits : Limits
`Zip.defaultLimits`, 1,000,000 blocks, depth 256.
read : String -> Result Error (List Block)
The blocks of a document, under `defaultLimits`.
readWith : Limits -> String -> Result Error (List Block)
`read` with chosen limits.
run : String -> Run
A plain run of text: not bold, not italic, no link.
toText : List Block -> String
The text of the blocks, one line a block: a list item indented two
write : List Block -> Result Error String
The document of these blocks. Cost: O(blocks). The same blocks always