README.md in sablon-0.0.18 vs README.md in sablon-0.0.19.beta1
- old
+ new
@@ -98,11 +98,11 @@
IMPORTANT: This feature is very much *experimental*. Currently, the insertion
will replace the containing paragraph. This means that other content in the same
paragraph is discarded.
-##### Markdown
+##### Markdown [experimental]
Similar to WordProcessingML it's possible to use markdown while processing the
tempalte. You don't need to modify your templates, a simple insertion operation
is sufficient:
@@ -138,10 +138,42 @@
supported. Normal text paragraphs use the style `Paragraph`. It's not necessary
to have that style in the template. Word will fall back to using the `Normal` style.
IMPORTANT: This feature is very much *experimental*. Currently, the insertion
will replace the containing paragraph. This means that other content in the same
+ paragraph is discarded. In the near future this feature will most likely be
+ implemented on top of HTML insertion.
+
+##### HTML [experimental]
+
+Similar to WordProcessingML it's possible to use html as input while processing the
+tempalte. You don't need to modify your templates, a simple insertion operation
+is sufficient:
+
+```
+«=article.body»
+```
+
+To use HTML insertion prepare the context like so:
+
+```ruby
+html_body = <<-HTML
+<div>This text can contain <em>additional formatting</em>
+according to the <strong>Markdown</strongstrong> specification.</div>
+HTML
+context = {
+ article: { html_body: Sablon.content(:html, html_body) }
+}
+template.render_to_file File.expand_path("~/Desktop/output.docx"), context
+```
+
+Currently HTML insertion is very limited and strongly focused on the HTML
+generated by [Trix editor](https://github.com/basecamp/trix).
+
+IMPORTANT: This feature is very much *experimental*. Currently, the insertion
+ will replace the containing paragraph. This means that other content in the same
paragraph is discarded.
+
#### Conditionals
Sablon can render parts of the template conditonally based on the value of a
context variable. Conditional fields are inserted around the content.