Template tags

rstview.templatetags.rstview_tags.rst_render(source, *args, **kwargs)[source]

Parse and render given string source using given parser option set.

Examples

Basic usage:

{% load rstview_tags %}

{% rst_render SOURCE_STRING %}

Using a specific config set:

{% load rstview_tags %}

{% rst_render SOURCE_STRING config='myconfig' %}

Muting error and warning from parser:

{% load rstview_tags %}

{% rst_render SOURCE_STRING silent=True %}

Everything joined:

{% load rstview_tags %}

{% rst_render SOURCE_STRING config='myconfig' silent=True %}

Tag signature:

{% rst_render SOURCE_STRING [config='default'] [silent=True] %}
Parameters:

source (string) – reStructuredText markup to parse.

Keyword Arguments:
 
  • config (string) – Name of an option set from settings.RSTVIEW_PARSER_FILTER_SETTINGS.
  • silent (bool) – Enable to override default silent mode behavior. Default value is the same as settings.RSTVIEW_PARSER_SILENT.
Returns:

Rendered source from parser.

Return type:

string