API Documentation¶
Docstring for markdown
-
class
tendril.utils.files.markdown.
TendrilMistuneRenderer
(**kwargs)[source]¶ Bases:
mistune.Renderer
-
placeholder
()[source]¶ Returns the default, empty output value for the renderer.
All renderer methods use the ‘+=’ operator to append to this value. Default is a string so rendering HTML can build up a result string with the rendered Markdown.
Can be overridden by Renderer subclasses to be types like an empty list, allowing the renderer to create a tree-like structure to represent the document (which can then be reprocessed later into a separate format like docx or pdf).
-
block_code
(code, lang=None)[source]¶ Rendering block level code.
pre > code
.- Parameters
code – text content of the code block.
lang – language of the given code.
-
block_quote
(text)[source]¶ Rendering <blockquote> with the given text.
- Parameters
text – text content of the blockquote.
-
block_html
(html)[source]¶ Rendering block level pure html content.
- Parameters
html – text content of the html snippet.
-
header
(text, level, raw=None)[source]¶ Rendering header/heading tags like
<h1>
<h2>
.- Parameters
text – rendered text content for the header.
level – a number for the header level, for example: 1.
raw – raw text content of the header.
-
list
(body, ordered=True)[source]¶ Rendering list tags like
<ul>
and<ol>
.- Parameters
body – body contents of the list.
ordered – whether this list is ordered or not.
-
table
(header, body)[source]¶ Rendering table element. Wrap header and body in it.
- Parameters
header – header part of the table.
body – body part of the table.
-
table_row
(content)[source]¶ Rendering a table row. Like
<tr>
.- Parameters
content – content of current table row.
-
table_cell
(content, **flags)[source]¶ Rendering a table cell. Like
<th>
<td>
.- Parameters
content – content of current table cell.
header – whether this is header or not.
align – align of current table cell.
-
strikethrough
(text)[source]¶ Rendering ~~strikethrough~~ text.
- Parameters
text – text content for strikethrough.
-
autolink
(link, is_email=False)[source]¶ Rendering a given link or email address.
- Parameters
link – link content or email address.
is_email – whether this is an email or not.
-
link
(link, title, text)[source]¶ Rendering a given link with content and title.
- Parameters
link – href link for
<a>
tag.title – title content for title attribute.
text – text content for description.
-
image
(src, title, text)[source]¶ Rendering a image with title and text.
- Parameters
src – source link of the image.
title – title text of the image.
text – alt text of the image.
-
inline_html
(html)[source]¶ Rendering span level pure html content.
- Parameters
html – text content of the html snippet.
-
footnote_ref
(key, index)[source]¶ Rendering the ref anchor of a footnote.
- Parameters
key – identity key for the footnote.
index – the index count of current footnote.
-