restructuredtext

reStructuredText - 一个比MarkDown更好用的标记语言

假如想象 提交于 2020-04-06 08:01:17
文档和教程 http://docutils.sourceforge.net/rst.html http://zh-sphinx-doc.readthedocs.io/en/latest/rest.html http://blog.useasp.net/archive/2014/09/05/rst-file-restructuredtext-markup-syntax-quikstart.aspx http://www.cnblogs.com/seayxu/p/5603876.html http://www.jianshu.com/p/f60e9be4781d http://docutils.sourceforge.net/docs/user/rst/quickstart.html sublime text 插件: OmniMarkupPreviewer reStructuredText reStructuredText snippet 家里的电脑上使用了手动安装 git clone https://github.com/timonwong/OmniMarkupPreviewer 整个项目copy到你的package目录下,浏览插件会自动打开这个目录 Sphinx + reStructuredText 生成API文档/带目录层次结构 http://www.sphinxsearch

markdown、word、pdf文件之间相互转换

女生的网名这么多〃 提交于 2020-03-26 10:17:37
3 月,跳不动了?>>> 现实需求 平常会用markdown去写一些文档,这可以说是程序员的 最爱,但是在实际工作过程中与产品、需求人员以及客户交流更多还是使用word以及pdf等官方文档,直至发现了 Pandoc,它可以将文档在 Markdown、LaTeX、reStructuredText、HTML、Word docx 等多种标记格式之间相互转换,并支持输出 PDF、EPUB、HTML 幻灯片等多种格式。该程序被称为格式转换界的 “瑞士军刀”。 功能介绍 Pandoc 的作者是 John MacFarlane,他是加州大学伯克利分校的哲学系教授。Pandoc 使用 Haskell 语言编写,被作者用来生成讲义、课件和网站等。该程序开源免费,目前以 GPL 协议托管在 Github 网站上。 安装Pandoc 可以直接访问pandoc的官网 https://www.pandoc.org/installing.html ,由于我本地使用的mac系统所以直接找到对应mac版本,然后执行 brew install pandoc brew install pandoc-citeproc 使用文档转换 打开终端直接执行如下命令,如将word转为markdown文档,其他例旧即可,这里注意pandoc不能转换doc格式的需要docx格式的 pandoc project.docx -o

Sphinx: Use a different directive for a different output format

。_饼干妹妹 提交于 2020-03-15 07:15:06
问题 Assume you have a reStructuredText document and want to export it in two formats using Sphinx 2.x: HTML and PDF. You want to put some slightly different contents in these two formats. For example, the text "I am HTML" appears in the HTML version whereas "I am PDF" appears in the PDF version in the same location of the document. Use a replace directive like below will give you "I am HTML" regardless of the export format. .. |foo| replace:: HTML ⋮ I am |foo| Can you use a different directive

Sphinx - insert argument documentation from parent method

十年热恋 提交于 2020-02-25 22:37:05
问题 I have some classes that inherit from each other. All classes contain the same method (let us call it mymethod ), whereby the children overwrite the base class method. I want to generate a documentation for mymethod in all classes using sphinx. Suppose mymethod takes an argument myargument . This argument has the same type and meaning for both the base method as well as the inherited method. To minimize redundancies, I would like to write the documentation for myargument only for the base

How to create a custom HTML div in Sphinx that isn't automatically nested within a subsubsection?

此生再无相见时 提交于 2020-02-02 10:14:11
问题 I'm using the wonderful Sphinx tool to create some documentation and I need to create a custom HTML div so that I can style it apart from Sphinx's other, automatically-created, divs. This is possible to do using the container directive, but the problem is that if I use this directive below a subsubsection, it automatically nests the div created with the container directive within the subsubsection, like so: <div id="automatically-created sphinx subsubsection"> ... <div id="my custom container

Is it possible to reuse hyperlink defined in another file in restructuredtext (or sphinx)

会有一股神秘感。 提交于 2020-01-30 08:26:26
问题 Suppose I have two files a.rst and b.rst in the same folder, and a.rst looks like this .. _foo: http://stackoverflow.com `foo`_ is a website It seems using foo in b.rst is not allowed. Is there a way to define hyperlinks and use them in multiple files? Followup I used the extlinks extension as Steve Piercy suggested. Its implementation and docstring can be seen here on github. In my case, I define wikipedia link in my conf.py extlinks = {'wiki': ('https://en.wikipedia.org/wiki/%s', '')} and

Prevent section heading to subtitle transformation in reStructuredText

被刻印的时光 ゝ 提交于 2020-01-25 07:13:07
问题 In reStructuredText, a heading followed by a lower-level heading is read as a subtitle: Section 1 ========= Subtitle -------- However, what if I actually want a subsection heading to follow immediately after a section heading? According to the the docs, an empty comment "serves to terminate a preceding construct" , but this doesn't seem to apply here, as Section 1 ========= .. Section 2 --------- still gets turned into a heading for Section 1 , followed by a subtitle Section 2 by, for example

Prevent section heading to subtitle transformation in reStructuredText

社会主义新天地 提交于 2020-01-25 07:12:24
问题 In reStructuredText, a heading followed by a lower-level heading is read as a subtitle: Section 1 ========= Subtitle -------- However, what if I actually want a subsection heading to follow immediately after a section heading? According to the the docs, an empty comment "serves to terminate a preceding construct" , but this doesn't seem to apply here, as Section 1 ========= .. Section 2 --------- still gets turned into a heading for Section 1 , followed by a subtitle Section 2 by, for example

Prevent section heading to subtitle transformation in reStructuredText

空扰寡人 提交于 2020-01-25 07:11:40
问题 In reStructuredText, a heading followed by a lower-level heading is read as a subtitle: Section 1 ========= Subtitle -------- However, what if I actually want a subsection heading to follow immediately after a section heading? According to the the docs, an empty comment "serves to terminate a preceding construct" , but this doesn't seem to apply here, as Section 1 ========= .. Section 2 --------- still gets turned into a heading for Section 1 , followed by a subtitle Section 2 by, for example