From ff6325e5625893502cd211f5a21fe28c716575f4 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 7 Jan 2014 23:21:46 +0000 Subject: Add example of `styleMap` as a string --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index ff83a1a..71c51e8 100644 --- a/README.md +++ b/README.md @@ -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`: -- cgit v1.2.3