From ceb3e9770eaf466710a93c0a66daa11f2721c9df Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 7 Jan 2014 22:08:10 +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 96bac69..135c7bf 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 mappings 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" +}; +``` + To extend the standard style map: ```javascript -- cgit v1.2.3