aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md12
1 files changed, 7 insertions, 5 deletions
diff --git a/README.md b/README.md
index da88e50..dbb05cb 100644
--- a/README.md
+++ b/README.md
@@ -24,9 +24,11 @@ To convert an existing .docx file to HTML, use `mammoth.convertToHtml`:
```javascript
var mammoth = require("mammoth");
-var result = mammoth.convertToHtml({path: "path/to/document.docx"});
-var html = result.value; // The generated HTML
-var messages = result.messages; // Any messages, such as warnings during conversion
+mammoth.convertToHtml({path: "path/to/document.docx"})
+ .then(function(result){
+ var html = result.value; // The generated HTML
+ var messages = result.messages; // Any messages, such as warnings during conversion
+ });
```
By default,
@@ -45,7 +47,7 @@ var options = {
style("p.Heading2 => h2")
]
};
-var result = mammoth.convertToHtml({path: "path/to/document.docx"}, options);
+mammoth.convertToHtml({path: "path/to/document.docx"}, options);
```
To extend the standard style map:
@@ -62,7 +64,7 @@ var customStyles = [
var options = {
styleMap: customStyles.concat(mammoth.standardOptions.styleMap)
};
-var result = mammoth.convertToHtml({path: "path/to/document.docx"}, options);
+mammoth.convertToHtml({path: "path/to/document.docx"}, options);
```
## Writing styles