summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-07-03 15:42:39 +0100
committerMichael Williamson <mike@zwobble.org>2016-07-03 15:42:39 +0100
commit204ceaec854c9a1dfeefb8b5b6243493321ff0f2 (patch)
treee18e25a8e9600e2ff9005531851d856455079013 /README.md
parent9ac6745ae4257c8f73c2c5682e1ce74407e1d886 (diff)
Add documentation for comments
Diffstat (limited to 'README.md')
-rw-r--r--README.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/README.md b/README.md
index 53f5e48..428cf8a 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.
+
## Installation
pip install mammoth
@@ -239,6 +241,23 @@ with open("document.docx", "rb") as docx_file:
result = mammoth.convert_to_html(docx_file, style_map=style_map)
```
+#### Comments
+
+By default, comments are ignored.
+To include comments in the generated HTML,
+add a style mapping for `comment-reference`.
+For instance:
+
+```python
+style_map = "comment-reference => sup"
+
+with open("document.docx", "rb") as docx_file:
+ result = mammoth.convert_to_html(docx_file, style_map=style_map)
+```
+
+Comments will be appended to the end of the document,
+with links to the comments wrapped using the specified style mapping.
+
### API
#### `mammoth.convert_to_html(fileobj, **kwargs)`