Package cubicweb :: Package ext :: Module rest
[hide private]
[frames] | no frames]

Module rest

source code

rest publishing functions

contains some functions and setup of docutils for cubicweb. Provides the following ReST directives:

Classes [hide private]
  CubicWebReSTParser
The (customized) reStructuredText parser.
  CWReSTPublisher
Functions [hide private]
 
eid_reference_role(role, rawtext, text, lineno, inliner, options={}, content=[]) source code
 
winclude_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)
Include a reST file as part of the content of this reST file.
source code
 
pygments_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine) source code
unicode
rest_publish(context, data)
publish a string formatted as ReStructured Text to HTML
source code
 
cw_rest_init() source code
Variables [hide private]
  LOGGER = getLogger('cubicweb.rest')
  _PYGMENTS_FORMATTER = HtmlFormatter()
  _INITIALIZED = False
return a boolean telling if it's triggered by a db-api query or by a session query.
  k = 'field_marker'
  v = ':(?![: ])([^:\\\\]|\\\\.)*(?<! ):( +|$)'
Function Details [hide private]

winclude_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)

source code 

Include a reST file as part of the content of this reST file.

same as standard include directive but using config.locate_doc_resource to get actual file to include.

Most part of this implementation is copied from include directive defined in docutils.parsers.rst.directives.misc

rest_publish(context, data)

source code 
publish a string formatted as ReStructured Text to HTML
Parameters:
  • data (str) - some ReST text
  • context (a cubicweb application object)
Returns: unicode
the data formatted as HTML or the original data if an error occurred