Write Markdown Syntax Online Document with Sphinx and Pandoc
There is no doubt that we have to write doc while we are developing software. But How do you
write doc? I learnt a method to build a document by using markdown syntax with sphinx and pandoc.
It is quite elegant and convenient to use it. I am sure you will like it.
Firstly, I write the markdown doc in .md file, then I will convert it to .rst file. After converting the file,
I will use sphinx to convert it into HTML file, you can see the doc online. Here is the way as following on ubuntu:
1.To run doc and convert file, pakcages should be installed:
apt-get install pandoc
apt-get install python-sphinx
2.Run command to configure environment:
sphinx-quickstart
After configuration, we can popluate master file source/index.rst and create other document source .rst file. Use the
Makefile to build the docs, like so:
make builder
"builder" is one te supported buidlers, e.g. html, latex or linkcheck.
Here is the turtorial:
3. Write doc
Under the directory ./source, we create source .md files, such as
doc1.md
doc2.md
...
docn.md
Add the .md file name above in the file ./source/index.rst
doc1
doc2
...
docn
4. Convert .md files to .rst files
We can write a script run_doc.sh:
#!/bin/bash
## run_doc.sh files=./source/*.md for file in $files
do
pandoc "$file" -o "${file%.md}.rst"
done
After converting files, we can see doc1.rst, doc2.rst ... in the directory ./source
5. Convert .rst files to html files
make html
You can see the html files under the directory: build/html
Attachment:
#!/bin/bash ## run_doc.sh files=./source/*.md for file in $files
do
pandoc "$file" -o "${file%.md}.rst"
done make html
6. Visit online doc
Add configuration in Nginx:
location /doc/ {
alias [direcotry]/build/html/;
}
Replace [directory] with your own home directory. Visit online doc:
http://[website]/doc/index.html
Replace [website] with your own website.
7. Online markdown editor
http://mahua.jser.me
Link: http://www.cnblogs.com/zhuangzebo/p/6268964.html
Write Markdown Syntax Online Document with Sphinx and Pandoc的更多相关文章
- 【445】Markdown Syntax
ref: Markdown基本语法 ref: Markdown Guide ref: Markdown Cheatsheet ref: Markdown Tutorial Lists Basic Sy ...
- Markdown: Syntax Text
Markdown: Syntax Text https://daringfireball.net/projects/markdown/syntax.text Markdown: Syntax ==== ...
- Markdown Syntax Images
Markdown Syntax Images Admittedly, it's fairly difficult to devise a "natural" syntax for ...
- Markdown syntax guide and writing on MWeb
Philosophy Markdown is intended to be as easy-to-read and easy-to-write as is feasible.Readability, ...
- markdown syntax
Markdown 语法 转载自https://zh.mweb.im/markdown.html 首先应该了解的 每一个 Markdwon 使用者都应该了解的,是 Markdown 最基本的版本,也就是 ...
- Markdown语法说明(详解版)
####date: 2016-05-26 20:38:58 tags: Markdown tags && Syntax ##Markdown语法说明(详解版)杨帆发表于 2011-11 ...
- New UWP Community Toolkit - Markdown
概述 前面 New UWP Community Toolkit 文章中,我们对 V2.2.0 版本的重要更新做了简单回顾,其中简单介绍了 MarkdownTextBlock 和 MarkdownDoc ...
- Markdown语法说明(转)
Markdown语法说明(转) Markdown创始人John Gruber的语法说明 附上本文链接 NOTE: This is Simplelified Chinese Edition Docume ...
- Sphinx 2.2.11-release reference manual
1. Introduction 1.1. About 1.2. Sphinx features 1.3. Where to get Sphinx 1.4. License 1.5. Credits 1 ...
随机推荐
- 整站变灰CSS代码
* { filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); -webkit-filter: grayscale(100% ...
- [z]nativeSql
http://blog.csdn.net/chenallen1025/article/details/9169543 EntityManager API 提供了创建 Query 实例以执行原生 SQL ...
- vue缓存之keep-alive,设置想要缓存的页面
由于项目需求从a页面跳转到b页面,返回a页面,a页面数据不能被刷新掉,方法很多列举12 方法1 a页面通过学期按钮切换学期,该学期里more进入b页面,返回a页面,返回回到对应a页面进入的高亮按钮设置 ...
- 10.15 JS日记
1.JS 介绍 js的全称是JavaScript,它是一门前台语言 Java是一门后台语言 ,它们两个之间毫无关系 JavaScript的作者是布兰登,艾奇 前台语言:运行在客户端 后台语言:与数据库 ...
- json等序列化模块 异常处理
今日学习内容如下: 1.序列化模块 什么叫序列化——将原本的字典.列表等内容转换成一个字符串的过程就叫做序列化. 比如,我们在python代码中计算的一个数据需要给另外一段程序使用,那我们怎么给? 现 ...
- (转)android:inputType参数类型说明
android:inputType参数类型说明 android:inputType="none"--输入普通字符 android:inputType="text" ...
- hdu 5418 (Floyd+哈密顿) 飞向世界
http://acm.hdu.edu.cn/showproblem.php?pid=5418 题目大意是城市的编号是1到n,给出m条路线,表示从a城市飞到b城市飞机要耗多少油,最后问飞机从1出发飞过所 ...
- iOS一段文字设置多种颜色格式
调用 [self fuwenbenLabel:contentLabel FontNumber:[UIFont systemFontOfSize:] AndRange:NSMakeRange(, ) A ...
- 采用RedisLive监控Redis服务——安装手册
#1.gcc编译环境确认 .tgz cd Python- ./configure /bin/python2. /usr/bin/python #运行python查看版本 python -V #进行更改 ...
- 如何实现HashMap的同步
HashMap可以通过Map m = Collections.synchronizedMap(new HashMap())来达到同步的效果.具体而言,该方法会返回一个同步的Map,该Map封装了底层的 ...