help: Enable and use the markdown admonition extension.

This allows us to add warnings and tips in the Zulip help documents.
This commit is contained in:
Tim Abbott 2016-12-21 10:50:48 -08:00
parent 4cbfac68ca
commit 753a25268c
3 changed files with 25 additions and 10 deletions

View File

@ -115,6 +115,20 @@ below.
### Supported features ### Supported features
* All the usual features of Markdown with raw HTML enabled so you can * All the usual features of Markdown with raw HTML enabled so you can
do custom things as needed. do custom things with HTML/CSS as needed. The goal is to make
* Code blocks with syntax highlighting. reusable markdown syntax for things we need often, though.
* Code blocks with syntax highlighting, similar to Zulip's own markdown.
* Anchor tags for linking to headers in other documents. * Anchor tags for linking to headers in other documents.
* You can create special highlight warning blocks using e.g.:
```
!!! warn "title of warning"
Body of warning
```
to create a special warning block with title "title of warning" to
highlight something important. The whitespace is important. Often,
we just use "" as the title. `!!! tip "title"` is useful for less
scary tips. See
[the python-markdown docs on this extension](https://pythonhosted.org/Markdown/extensions/admonition.html)
for details on how this extension works; essentially the value
`warn` or `tip` is an extra CSS class added to the admonition.

View File

@ -1,13 +1,12 @@
# Zulip User Documentation (draft) # Zulip User Documentation (draft)
<span class="warn"> !!! warn ""
**Caveat**: This file is intended to collect all proposed user **Caveat**: This file is intended to collect all proposed user
documentation into one place. Ultimately, a single file is probably documentation into one place. Ultimately, a single file is probably
not the best format for documentation when it is published to the not the best format for documentation when it is published to the
world, but for purposes of discussion it seems easiest to put world, but for purposes of discussion it seems easiest to put
everything into a solitary and linear page. everything into a solitary and linear page.
</span>
---
Zulip is a chat app. Its most distinctive characteristic is that Zulip is a chat app. Its most distinctive characteristic is that
conversation among a group of people can be divided according to conversation among a group of people can be divided according to

View File

@ -7,6 +7,7 @@ from zerver.lib.utils import force_text
import zerver.lib.bugdown.fenced_code import zerver.lib.bugdown.fenced_code
import markdown import markdown
import markdown.extensions.admonition
import markdown.extensions.codehilite import markdown.extensions.codehilite
import markdown.extensions.toc import markdown.extensions.toc
@ -65,6 +66,7 @@ def render_markdown_path(markdown_file_path):
if md_extensions is None: if md_extensions is None:
md_extensions = [ md_extensions = [
markdown.extensions.toc.makeExtension(), markdown.extensions.toc.makeExtension(),
markdown.extensions.admonition.makeExtension(),
markdown.extensions.codehilite.makeExtension( markdown.extensions.codehilite.makeExtension(
linenums=False, linenums=False,
guess_lang=False guess_lang=False