--- a/src/pyams_utils/text.py Thu Dec 20 08:38:06 2018 +0100
+++ b/src/pyams_utils/text.py Fri Dec 28 09:55:26 2018 +0100
@@ -109,7 +109,7 @@
class ReStructuredTextRenderer(BaseHTMLRenderer):
"""reStructuredText HTML renderer
- This renderer is using *docutils* to render HTML output.
+ This renderer is using *docutils* to convert text to HTML output.
"""
def render(self, **kwargs):
@@ -132,18 +132,21 @@
class MarkdownTextRenderer(BaseHTMLRenderer):
"""Markdown HTML renderer
- This renderer is using *Markdown* HTML output.
+ This renderer is converting *Markdown* formatted text to HTML.
"""
def render(self, **kwargs):
- """Renderer Markdown code to HTML"""
+ """Render Markdown code to HTML"""
return markdown(self.context)
def text_to_html(text, renderer='text'):
"""Convert text to HTML using the given renderer
- Renderer name can be any registered HTML renderer adapter
+ Renderer name can be any registered HTML renderer adapter.
+
+ You can provide several renderers by giving their names separated by semicolon; renderers will then
+ act as in a pipe, each renderer transforming output of the previous one.
"""
request = check_request()
registry = request.registry
@@ -165,6 +168,9 @@
adapter can be found, this adapter is used to render the context to HTML; if *context* is a string,
it is converted to HTML using the renderer defined as second parameter; otherwise, context is just
converted to string using the :py:func:`str` function.
+
+ You can provide several renderers by giving their names separated by semicolon; renderers will then
+ act as in a pipe, each renderer transforming output of the previous one.
"""
def render(self, context=empty_marker, renderer='text'):