repos: 220716822
This data as json
id | node_id | name | full_name | private | owner | html_url | description | fork | created_at | updated_at | pushed_at | homepage | size | stargazers_count | watchers_count | language | has_issues | has_projects | has_downloads | has_wiki | has_pages | forks_count | archived | disabled | open_issues_count | license | topics | forks | open_issues | watchers | default_branch | permissions | temp_clone_token | organization | network_count | subscribers_count | readme | readme_html | allow_forking | visibility | is_template | template_repository | web_commit_signoff_required | has_discussions |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
220716822 | MDEwOlJlcG9zaXRvcnkyMjA3MTY4MjI= | datasette-render-markdown | simonw/datasette-render-markdown | 0 | 9599 | https://github.com/simonw/datasette-render-markdown | Datasette plugin for rendering Markdown | 0 | 2019-11-09T23:28:31Z | 2022-05-26T04:58:56Z | 2022-07-18T19:35:10Z | 57 | 11 | 11 | Python | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | apache-2.0 | ["datasette", "datasette-io", "datasette-plugin", "markdown"] | 0 | 1 | 11 | main | {"admin": false, "maintain": false, "push": false, "triage": false, "pull": false} | 0 | 2 | # datasette-render-markdown [](https://pypi.org/project/datasette-render-markdown/) [](https://github.com/simonw/datasette-render-markdown/releases) [](https://github.com/simonw/datasette-render-markdown/actions?query=workflow%3ATest) [](https://github.com/simonw/datasette-render-markdown/blob/main/LICENSE) Datasette plugin for rendering Markdown. ## Installation Install this plugin in the same environment as Datasette to enable this new functionality: $ pip install datasette-render-markdown ## Usage You can explicitly list the columns you would like to treat as Markdown using [plugin configuration](https://datasette.readthedocs.io/en/stable/plugins.html#plugin-configuration) in a `metadata.json` file. Add a `"datasette-render-markdown"` configuration block and use a `"columns"` key to list the columns you would like to treat as Markdown values: ```json { "plugins": { "datasette-render-markdown": { "columns": ["body"] } } } ``` This will cause any `body` column in any table to be treated as markdown and safely rendered using [Python-Markdown](https://python-markdown.github.io/). The resulting HTML is then run through [Bleach](https://bleach.readthedocs.io/) to avoid the risk of XSS security problems. Save this to `metadata.json` and run Datasette with the `--metadata` flag to load this configuration: $ datasette serve mydata.db --metadata metadata.json The configuration block can be used at the top level, or it can be applied just to specific databases or tables. Here's how to apply it to just the `entries` table in the `news.db` database: ```json { "databases": { "news": { "tables": { "entries": { "plugins": { "datasette-render-markdown": { "columns": ["body"] } } } } } } } ``` And here's how to apply it to every `body` column in every table in the `news.db` database: ```json { "databases": { "news": { "plugins": { "datasette-render-markdown": { "columns": ["body"] } } } } } ``` ## Columns that match a naming convention This plugin can also render markdown in any columns that match a specific naming convention. By default, columns that have a name ending in `_markdown` will be rendered. You can try this out using the following query: ```sql select '# Hello there * This is a list * of items [And a link](https://github.com/simonw/datasette-render-markdown).' as demo_markdown ``` You can configure a different list of wildcard patterns using the `"patterns"` configuration key. Here's how to render columns that end in either `_markdown` or `_md`: ```json { "plugins": { "datasette-render-markdown": { "patterns": ["*_markdown", "*_md"] } } } ``` To disable wildcard column matching entirely, set `"patterns": []` in your plugin metadata configuration. ## Markdown extensions The [Python-Markdown library](https://python-markdown.github.io/) that powers this plugin supports extensions, both [bundled](https://python-markdown.github.io/extensions/) and [third-party](https://github.com/Python-Markdown/markdown/wiki/Third-Party-Extensions). These can be used to enable additional Markdown features such as [table support](https://python-markdown.github.io/extensions/tables/). You can configure support for extensions using the `"extensions"` key in your plugin metadata configuration. Since extensions may introduce new HTML tags, you will also need to add those tags to the list of tags that are allowed by the [Bleach](https://bleach.readthedocs.io/) sanitizer. You can do that using the `"extra_tags"` key, and you can whitelist additional HTML attributes using `"extra_attrs"`. See [the Bleach documentation](https://bleach.readthedocs.io/en/latest/clean.html#allowed-tags-tags) for more information on this. Here's how to enable support for [Markdown tables](https://python-markdown.github.io/extensions/tables/): ```json { "plugins": { "datasette-render-markdown": { "extensions": ["tables"], "extra_tags": ["table", "thead", "tr", "th", "td", "tbody"] } } } ``` ### GitHub-Flavored Markdown Enabling [GitHub-Flavored Markdown](https://help.github.com/en/github/writing-on-github) (useful for if you are working with data imported from GitHub using [github-to-sqlite](https://github.com/dogsheep/github-to-sqlite)) is a little more complicated. First, you will need to install the [py-gfm](https://py-gfm.readthedocs.io) package: $ pip install py-gfm Note that `py-gfm` has [a bug](https://github.com/Zopieux/py-gfm/issues/13) that causes it to pin to `Markdown<3.0` - so if you are using it you should install it _before_ installing `datasette-render-markdown` to ensure you get a compatibly version of that dependency. Now you can configure it like this. Note that the extension name is `mdx_gfm:GithubFlavoredMarkdownExtension` and you need to whitelist several extra HTML tags and attributes: ```json { "plugins": { "datasette-render-markdown": { "extra_tags": [ "hr", "br", "details", "summary", "input" ], "extra_attrs": { "input": [ "type", "disabled", "checked" ], }, "extensions": [ "mdx_gfm:GithubFlavoredMarkdownExtension" ] } } } ``` The `<input type="" checked disabled>` attributes are needed to support rendering checkboxes in issue descriptions. ## Markdown in templates The plugin also adds a new template function: `render_markdown(value)`. You can use this in your templates like so: ```html+jinja {{ render_markdown(""" # This is markdown * One * Two * Three """) }} ``` You can load additional extensions and whitelist tags by passing extra arguments to the function like this: ```html+jinja {{ render_markdown(""" ## Markdown table First Header | Second Header ------------- | ------------- Content Cell | Content Cell Content Cell | Content Cell """, extensions=["tables"], extra_tags=["table", "thead", "tr", "th", "td", "tbody"])) }} ``` | <div id="readme" class="md" data-path="README.md"><article class="markdown-body entry-content container-lg" itemprop="text"><h1 dir="auto"><a id="user-content-datasette-render-markdown" class="anchor" aria-hidden="true" href="#user-content-datasette-render-markdown"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>datasette-render-markdown</h1> <p dir="auto"><a href="https://pypi.org/project/datasette-render-markdown/" rel="nofollow"><img src="https://camo.githubusercontent.com/624f87a070fbf68882456039073cd2f330c4b412199efd1bd7308c97c3b30c40/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f6461746173657474652d72656e6465722d6d61726b646f776e2e737667" alt="PyPI" data-canonical-src="https://img.shields.io/pypi/v/datasette-render-markdown.svg" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-render-markdown/releases"><img src="https://camo.githubusercontent.com/5b3b13cdd601c70ee249e42c3fb43fce5b707eff875d49f19b1460a319cc42d6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f73696d6f6e772f6461746173657474652d72656e6465722d6d61726b646f776e3f696e636c7564655f70726572656c6561736573266c6162656c3d6368616e67656c6f67" alt="Changelog" data-canonical-src="https://img.shields.io/github/v/release/simonw/datasette-render-markdown?include_prereleases&label=changelog" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-render-markdown/actions?query=workflow%3ATest"><img src="https://github.com/simonw/datasette-render-markdown/workflows/Test/badge.svg" alt="Tests" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-render-markdown/blob/main/LICENSE"><img src="https://camo.githubusercontent.com/1698104e976c681143eb0841f9675c6f802bb7aa832afc0c7a4e719b1f3cf955/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322e302d626c75652e737667" alt="License" data-canonical-src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" style="max-width: 100%;"></a></p> <p dir="auto">Datasette plugin for rendering Markdown.</p> <h2 dir="auto"><a id="user-content-installation" class="anchor" aria-hidden="true" href="#user-content-installation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Installation</h2> <p dir="auto">Install this plugin in the same environment as Datasette to enable this new functionality:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ pip install datasette-render-markdown"><pre class="notranslate"><code>$ pip install datasette-render-markdown </code></pre></div> <h2 dir="auto"><a id="user-content-usage" class="anchor" aria-hidden="true" href="#user-content-usage"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Usage</h2> <p dir="auto">You can explicitly list the columns you would like to treat as Markdown using <a href="https://datasette.readthedocs.io/en/stable/plugins.html#plugin-configuration" rel="nofollow">plugin configuration</a> in a <code>metadata.json</code> file.</p> <p dir="auto">Add a <code>"datasette-render-markdown"</code> configuration block and use a <code>"columns"</code> key to list the columns you would like to treat as Markdown values:</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ "plugins": { "datasette-render-markdown": { "columns": ["body"] } } }"><pre>{ <span class="pl-ent">"plugins"</span>: { <span class="pl-ent">"datasette-render-markdown"</span>: { <span class="pl-ent">"columns"</span>: [<span class="pl-s"><span class="pl-pds">"</span>body<span class="pl-pds">"</span></span>] } } }</pre></div> <p dir="auto">This will cause any <code>body</code> column in any table to be treated as markdown and safely rendered using <a href="https://python-markdown.github.io/" rel="nofollow">Python-Markdown</a>. The resulting HTML is then run through <a href="https://bleach.readthedocs.io/" rel="nofollow">Bleach</a> to avoid the risk of XSS security problems.</p> <p dir="auto">Save this to <code>metadata.json</code> and run Datasette with the <code>--metadata</code> flag to load this configuration:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ datasette serve mydata.db --metadata metadata.json"><pre class="notranslate"><code>$ datasette serve mydata.db --metadata metadata.json </code></pre></div> <p dir="auto">The configuration block can be used at the top level, or it can be applied just to specific databases or tables. Here's how to apply it to just the <code>entries</code> table in the <code>news.db</code> database:</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ "databases": { "news": { "tables": { "entries": { "plugins": { "datasette-render-markdown": { "columns": ["body"] } } } } } } }"><pre>{ <span class="pl-ent">"databases"</span>: { <span class="pl-ent">"news"</span>: { <span class="pl-ent">"tables"</span>: { <span class="pl-ent">"entries"</span>: { <span class="pl-ent">"plugins"</span>: { <span class="pl-ent">"datasette-render-markdown"</span>: { <span class="pl-ent">"columns"</span>: [<span class="pl-s"><span class="pl-pds">"</span>body<span class="pl-pds">"</span></span>] } } } } } } }</pre></div> <p dir="auto">And here's how to apply it to every <code>body</code> column in every table in the <code>news.db</code> database:</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ "databases": { "news": { "plugins": { "datasette-render-markdown": { "columns": ["body"] } } } } }"><pre>{ <span class="pl-ent">"databases"</span>: { <span class="pl-ent">"news"</span>: { <span class="pl-ent">"plugins"</span>: { <span class="pl-ent">"datasette-render-markdown"</span>: { <span class="pl-ent">"columns"</span>: [<span class="pl-s"><span class="pl-pds">"</span>body<span class="pl-pds">"</span></span>] } } } } }</pre></div> <h2 dir="auto"><a id="user-content-columns-that-match-a-naming-convention" class="anchor" aria-hidden="true" href="#user-content-columns-that-match-a-naming-convention"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Columns that match a naming convention</h2> <p dir="auto">This plugin can also render markdown in any columns that match a specific naming convention.</p> <p dir="auto">By default, columns that have a name ending in <code>_markdown</code> will be rendered.</p> <p dir="auto">You can try this out using the following query:</p> <div class="highlight highlight-source-sql notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="select '# Hello there * This is a list * of items [And a link](https://github.com/simonw/datasette-render-markdown).' as demo_markdown"><pre><span class="pl-k">select</span> <span class="pl-s"><span class="pl-pds">'</span># Hello there</span> <span class="pl-s"></span> <span class="pl-s">* This is a list</span> <span class="pl-s">* of items</span> <span class="pl-s"></span> <span class="pl-s">[And a link](https://github.com/simonw/datasette-render-markdown).<span class="pl-pds">'</span></span> <span class="pl-k">as</span> demo_markdown</pre></div> <p dir="auto">You can configure a different list of wildcard patterns using the <code>"patterns"</code> configuration key. Here's how to render columns that end in either <code>_markdown</code> or <code>_md</code>:</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ "plugins": { "datasette-render-markdown": { "patterns": ["*_markdown", "*_md"] } } }"><pre>{ <span class="pl-ent">"plugins"</span>: { <span class="pl-ent">"datasette-render-markdown"</span>: { <span class="pl-ent">"patterns"</span>: [<span class="pl-s"><span class="pl-pds">"</span>*_markdown<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>*_md<span class="pl-pds">"</span></span>] } } }</pre></div> <p dir="auto">To disable wildcard column matching entirely, set <code>"patterns": []</code> in your plugin metadata configuration.</p> <h2 dir="auto"><a id="user-content-markdown-extensions" class="anchor" aria-hidden="true" href="#user-content-markdown-extensions"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Markdown extensions</h2> <p dir="auto">The <a href="https://python-markdown.github.io/" rel="nofollow">Python-Markdown library</a> that powers this plugin supports extensions, both <a href="https://python-markdown.github.io/extensions/" rel="nofollow">bundled</a> and <a href="https://github.com/Python-Markdown/markdown/wiki/Third-Party-Extensions">third-party</a>. These can be used to enable additional Markdown features such as <a href="https://python-markdown.github.io/extensions/tables/" rel="nofollow">table support</a>.</p> <p dir="auto">You can configure support for extensions using the <code>"extensions"</code> key in your plugin metadata configuration.</p> <p dir="auto">Since extensions may introduce new HTML tags, you will also need to add those tags to the list of tags that are allowed by the <a href="https://bleach.readthedocs.io/" rel="nofollow">Bleach</a> sanitizer. You can do that using the <code>"extra_tags"</code> key, and you can whitelist additional HTML attributes using <code>"extra_attrs"</code>. See <a href="https://bleach.readthedocs.io/en/latest/clean.html#allowed-tags-tags" rel="nofollow">the Bleach documentation</a> for more information on this.</p> <p dir="auto">Here's how to enable support for <a href="https://python-markdown.github.io/extensions/tables/" rel="nofollow">Markdown tables</a>:</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ "plugins": { "datasette-render-markdown": { "extensions": ["tables"], "extra_tags": ["table", "thead", "tr", "th", "td", "tbody"] } } }"><pre>{ <span class="pl-ent">"plugins"</span>: { <span class="pl-ent">"datasette-render-markdown"</span>: { <span class="pl-ent">"extensions"</span>: [<span class="pl-s"><span class="pl-pds">"</span>tables<span class="pl-pds">"</span></span>], <span class="pl-ent">"extra_tags"</span>: [<span class="pl-s"><span class="pl-pds">"</span>table<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>thead<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>tr<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>th<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>td<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>tbody<span class="pl-pds">"</span></span>] } } }</pre></div> <h3 dir="auto"><a id="user-content-github-flavored-markdown" class="anchor" aria-hidden="true" href="#user-content-github-flavored-markdown"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>GitHub-Flavored Markdown</h3> <p dir="auto">Enabling <a href="https://help.github.com/en/github/writing-on-github">GitHub-Flavored Markdown</a> (useful for if you are working with data imported from GitHub using <a href="https://github.com/dogsheep/github-to-sqlite">github-to-sqlite</a>) is a little more complicated.</p> <p dir="auto">First, you will need to install the <a href="https://py-gfm.readthedocs.io" rel="nofollow">py-gfm</a> package:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ pip install py-gfm"><pre class="notranslate"><code>$ pip install py-gfm </code></pre></div> <p dir="auto">Note that <code>py-gfm</code> has <a href="https://github.com/Zopieux/py-gfm/issues/13" data-hovercard-type="issue" data-hovercard-url="/zopieux/py-gfm/issues/13/hovercard">a bug</a> that causes it to pin to <code>Markdown<3.0</code> - so if you are using it you should install it <em>before</em> installing <code>datasette-render-markdown</code> to ensure you get a compatibly version of that dependency.</p> <p dir="auto">Now you can configure it like this. Note that the extension name is <code>mdx_gfm:GithubFlavoredMarkdownExtension</code> and you need to whitelist several extra HTML tags and attributes:</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ "plugins": { "datasette-render-markdown": { "extra_tags": [ "hr", "br", "details", "summary", "input" ], "extra_attrs": { "input": [ "type", "disabled", "checked" ], }, "extensions": [ "mdx_gfm:GithubFlavoredMarkdownExtension" ] } } }"><pre>{ <span class="pl-ent">"plugins"</span>: { <span class="pl-ent">"datasette-render-markdown"</span>: { <span class="pl-ent">"extra_tags"</span>: [ <span class="pl-s"><span class="pl-pds">"</span>hr<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>br<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>details<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>summary<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>input<span class="pl-pds">"</span></span> ], <span class="pl-ent">"extra_attrs"</span>: { <span class="pl-ent">"input"</span>: [ <span class="pl-s"><span class="pl-pds">"</span>type<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>disabled<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>checked<span class="pl-pds">"</span></span> ], }, <span class="pl-ent">"extensions"</span>: [ <span class="pl-s"><span class="pl-pds">"</span>mdx_gfm:GithubFlavoredMarkdownExtension<span class="pl-pds">"</span></span> ] } } }</pre></div> <p dir="auto">The <code><input type="" checked disabled></code> attributes are needed to support rendering checkboxes in issue descriptions.</p> <h2 dir="auto"><a id="user-content-markdown-in-templates" class="anchor" aria-hidden="true" href="#user-content-markdown-in-templates"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Markdown in templates</h2> <p dir="auto">The plugin also adds a new template function: <code>render_markdown(value)</code>. You can use this in your templates like so:</p> <div class="highlight highlight-text-html-django notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{{ render_markdown(""" # This is markdown * One * Two * Three """) }}"><pre>{{ render_markdown(""" # This is markdown * One * Two * Three """) }}</pre></div> <p dir="auto">You can load additional extensions and whitelist tags by passing extra arguments to the function like this:</p> <div class="highlight highlight-text-html-django notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{{ render_markdown(""" ## Markdown table First Header | Second Header ------------- | ------------- Content Cell | Content Cell Content Cell | Content Cell """, extensions=["tables"], extra_tags=["table", "thead", "tr", "th", "td", "tbody"])) }}"><pre>{{ render_markdown(""" ## Markdown table First Header | Second Header ------------- | ------------- Content Cell | Content Cell Content Cell | Content Cell """, extensions=["tables<span class="pl-smi">"]</span>, extra_tags=["table", "thead", "tr", "th", "td", "tbody<span class="pl-smi">"]</span>)) }}</pre></div> </article></div> | 1 | public | 0 | 0 |
Links from other tables
- 9 rows from repo in releases