aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md19
1 files changed, 18 insertions, 1 deletions
diff --git a/README.md b/README.md
index b921381..71991e7 100644
--- a/README.md
+++ b/README.md
@@ -42,12 +42,29 @@ var style = mammoth.style;
var options = {
styleMap: [
style("p.Heading1 => h1"),
- style("p.Heading2 => h2"),
+ style("p.Heading2 => h2")
]
};
var result = mammoth.convertToHtml({path: "path/to/document.docx"}, options);
```
+To extend the standard style map:
+
+```javascript
+var mammoth = require("mammoth");
+var style = mammoth.style;
+
+var customStyles = [
+ style("p.AsideHeading => div.aside > h2:fresh"),
+ style("p.AsideText => div.aside > p:fresh")
+];
+
+var options = {
+ styleMap: customStyles.concat(mammoth.standardOptions)
+};
+var result = mammoth.convertToHtml({path: "path/to/document.docx"}, options);
+```
+
## Writing styles
A style has two parts: