blob: e9cc615db24e092025297a1f10db27f32fc47f8b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
..
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)
|