diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-01-07 23:21:46 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-01-07 23:21:46 +0000 |
| commit | ff6325e5625893502cd211f5a21fe28c716575f4 (patch) | |
| tree | 0b0adcd09043c279a848b36acf07f564f451919a | |
| parent | b5960b8c6ae98f6db8ab058f47da4a7bdf963339 (diff) | |
Add example of `styleMap` as a string
| -rw-r--r-- | README.md | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -67,6 +67,17 @@ var options = { mammoth.convertToHtml({path: "path/to/document.docx"}, options); ``` +To more easily support style maps stored in text files, +`styleMap` can also be a string. +Each non-blank line is treated as a separate style mapping: + +```javascript +var options = { + styleMap: "p.SectionTitle => h1:fresh\n" + + "p.SubSectionTitle => h2:fresh" +}; +``` + User-defined style mappings are used in preference to the default style mappings. To stop using the default style mappings altogether, set `options.includeDefaultStyleMap` to `false`: |
