diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-01-07 21:56:36 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-01-07 21:56:36 +0000 |
| commit | a40e1c1343ac2095feebb96c7efbb02b6d5032d8 (patch) | |
| tree | be7305445c9375d97c7551b76e7c7c662476de30 | |
| parent | bf06f5dd16c0261c3388f5cad3dd93255a24a23b (diff) | |
Fill out API reference a bit more
| -rw-r--r-- | README.md | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -83,8 +83,18 @@ mammoth.convertToHtml({path: "path/to/document.docx"}, options); Converts the source document to HTML. -* `input` should be an object describing the source document. +* `input`: an object describing the source document. To read the file found at `path`, pass in `{path: path}`. + +* `options` (optional): options for the conversion. + May have the following properties: + +** `styleMap`: controls the mapping of Word styles to HTML. + If `options.styleMap` is a string, + each non-blank line is treated as a separate style mapping. + If `options.styleMap` is an array, + each element is expected to be the result of a call to `mammoth.style`. + See "Writing styles" for a reference to the syntax for styles. * Returns a promise containing a result. This result has the following properties: @@ -93,6 +103,10 @@ Converts the source document to HTML. ** `messages`: any messages, such as errors and warnings, generated during the conversion +#### `mammoth.style(string)` + +Creates a style using the passed string. + #### Messages Each message has the following properties: |
