From a40e1c1343ac2095feebb96c7efbb02b6d5032d8 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 7 Jan 2014 21:56:36 +0000 Subject: Fill out API reference a bit more --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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: -- cgit v1.2.3