Exemplo n.º 1
0
    def raw_to_html(self, raw, debug=0, suppress_tooltip=0):
        """Convert raw test to HTML and return it.
        
        Pass a non-zero numeric value to debug: none/5, info/1, warning/2, error/3, severe/4, or
        zero for no debug (same as 5).
        """
        from qon.ui.blocks.wiki import rst_to_html
        reader = Reader()

        html = rst_to_html(raw, wiki=self.page.wiki, container=self.page, reader=reader,
            debug=debug,
            suppress_tooltip=suppress_tooltip,
            )
        
        # rst parser keeps track of outbound wiki links. extract them
        # and store them in version, for use by Wiki
        refs = getattr(reader.document, '_qon_references', None)
        if refs:
            self._v_references = unique_items(refs)

        return html
Exemplo n.º 2
0
 def _update_html_cache(self):
     from qon.ui.blocks.wiki import rst_to_html
     return CompressedText(str(rst_to_html(self.get_description(),
         wiki=self.container.ihb.get_wiki(),
         container=self)))