mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
* Implement Markdown indented code blocks
Additional indentation of 4 spaces makes a block an "indented code block"
(monospaced text without syntax highlighting).
Also `::` RST syntax for code blocks is disabled.
So instead of
```rst
see::
Some code
```
the code block should be written as
```markdown
see:
Some code
```
* Migrate RST literal blocks :: to Markdown's ones
52 lines
1.2 KiB
ReStructuredText
52 lines
1.2 KiB
ReStructuredText
..
|
|
Usage of this file:
|
|
Add this in the beginning of *.rst file:
|
|
|
|
.. default-role:: code
|
|
.. include:: rstcommon.rst
|
|
|
|
It's the current trick for brevity and compatibility with both Github and
|
|
rst2html.py, considering that Github cannot highlight Nim in
|
|
RST files anyway and it does not include files.
|
|
This way interpreted text is displayed with monospaced font in Github
|
|
and it's displayed an Nim code in both rst2html.py
|
|
(note ".. default-role:: Nim" above) and `nim rst2html`.
|
|
|
|
For files that are user manual and consist of stuff like cmdline
|
|
option description, use 'code' as a **real** default role:
|
|
|
|
.. include:: rstcommon.rst
|
|
.. default-role:: code
|
|
|
|
.. define language roles explicitly (for compatibility with rst2html.py):
|
|
|
|
.. role:: nim(code)
|
|
:language: nim
|
|
|
|
.. default-role:: nim
|
|
|
|
.. role:: c(code)
|
|
:language: c
|
|
|
|
.. role:: cpp(code)
|
|
:language: cpp
|
|
|
|
.. role:: yaml(code)
|
|
:language: yaml
|
|
|
|
.. role:: python(code)
|
|
:language: python
|
|
|
|
.. role:: java(code)
|
|
:language: java
|
|
|
|
.. role:: csharp(code)
|
|
:language: csharp
|
|
|
|
.. role:: cmd(code)
|
|
|
|
.. role:: program(code)
|
|
|
|
.. role:: option(code)
|
|
|