帮助手册-用Markdown写Sphinx

Sphinx 默认是使用reStructuredText(简称reST) 格式进行写作,喜欢Markdown格式可以使用Recommonmark插件来实现。

大部分情况,我们写普通的Markdown格式,如果需需要高级一些的用法,可以看看下面有没有想要的效果:

Markdown转reST

  1. Its a note! in markdown!
  1. Its a note! in markdown!
  1. Its a note! in markdown!

``` sidebar:: 侧边栏用法

emphasis-lines: highlights the lines. linenos: shows the line numbers as well. caption: shown at the top of the code block. name: may be referenced with :ref: later.

  1. ``` code-block::
  2. :linenos:
  3. :emphasize-lines: 3,5
  4. :caption: 使用code-block 高亮 第3 5行.
  5. :name: Full code-block example
  6. # 注释行
  7. import System
  8. System.run_emphasis_line
  9. # code ........................ 很长的代码会自动产生 水平 scrollbar
  10. System.exit!

数学公式

  1. E = m c^2
  2. y=\sum_{i=1}^n g(x_i)

参考