From 28a0e40b645c051d91626ca90959e847b061c8da Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 7 Jul 2016 21:39:11 +0100 Subject: Add documentation for comments --- NEWS | 4 ++++ README.md | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/NEWS b/NEWS index ea86620..07e8ee6 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +# 1.1.0 + +* Add support for comments. + # 1.0.4 * Add support for w:sdt elements. This allows the bodies of content controls, diff --git a/README.md b/README.md index 2b6bac2..4f310a0 100644 --- a/README.md +++ b/README.md @@ -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)` -- cgit v1.2.3