summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-01-07 21:56:36 +0000
committerMichael Williamson <mike@zwobble.org>2014-01-07 21:56:36 +0000
commita40e1c1343ac2095feebb96c7efbb02b6d5032d8 (patch)
treebe7305445c9375d97c7551b76e7c7c662476de30
parentbf06f5dd16c0261c3388f5cad3dd93255a24a23b (diff)
Fill out API reference a bit more
-rw-r--r--README.md16
1 files changed, 15 insertions, 1 deletions
diff --git a/README.md b/README.md
index ff9e70f..bb96342 100644
--- a/README.md
+++ b/README.md
@@ -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: