diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-07-07 21:39:11 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-07-07 21:39:11 +0100 |
| commit | 28a0e40b645c051d91626ca90959e847b061c8da (patch) | |
| tree | 8a0c166884056ffe012ce1c79ca4eb1ac55c181e /README.md | |
| parent | bf37d9d321dad98f3fa2ca99a5235d07cb66892e (diff) | |
Add documentation for comments
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -39,6 +39,8 @@ The following features are currently supported: * Text boxes. The contents of the text box are treated as a separate paragraph that appears after the paragraph containing the text box. +* Comments. + ## Web demo The easiest way to try out mammoth is to use the web demo: @@ -295,6 +297,27 @@ var options = { mammoth.convertToHtml({path: "path/to/document.docx"}, options); ``` +#### Comments + +By default, comments are ignored. +To include comments in the generated HTML, +add a style mapping for `comment-reference`. +For instance: + +```javascript +var mammoth = require("mammoth"); + +var options = { + styleMap: [ + "comment-reference => sup" + ] +}; +mammoth.convertToHtml({path: "path/to/document.docx"}, options); +``` + +Comments will be appended to the end of the document, +with links to the comments wrapped using the specified style mapping. + ### API #### `mammoth.convertToHtml(input, options)` |
