# HG changeset patch # User Thierry Florac # Date 1545987326 -3600 # Node ID fd0365f94a2c64eae62efab362e8a8d7f49cafc8 # Parent 6d48d5d397293097a96d30fafd322a504e87cd4b Updated docstrings diff -r 6d48d5d39729 -r fd0365f94a2c src/pyams_utils/text.py --- 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'):