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的更多相关文章

  1. 【445】Markdown Syntax

    ref: Markdown基本语法 ref: Markdown Guide ref: Markdown Cheatsheet ref: Markdown Tutorial Lists Basic Sy ...

  2. Markdown: Syntax Text

    Markdown: Syntax Text https://daringfireball.net/projects/markdown/syntax.text Markdown: Syntax ==== ...

  3. Markdown Syntax Images

    Markdown Syntax Images Admittedly, it's fairly difficult to devise a "natural" syntax for ...

  4. 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, ...

  5. markdown syntax

    Markdown 语法 转载自https://zh.mweb.im/markdown.html 首先应该了解的 每一个 Markdwon 使用者都应该了解的,是 Markdown 最基本的版本,也就是 ...

  6. Markdown语法说明(详解版)

    ####date: 2016-05-26 20:38:58 tags: Markdown tags && Syntax ##Markdown语法说明(详解版)杨帆发表于 2011-11 ...

  7. New UWP Community Toolkit - Markdown

    概述 前面 New UWP Community Toolkit 文章中,我们对 V2.2.0 版本的重要更新做了简单回顾,其中简单介绍了 MarkdownTextBlock 和 MarkdownDoc ...

  8. Markdown语法说明(转)

    Markdown语法说明(转) Markdown创始人John Gruber的语法说明 附上本文链接 NOTE: This is Simplelified Chinese Edition Docume ...

  9. 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 ...

随机推荐

  1. WebApi的过滤器

    代码: using System; using System.Collections.Generic; using System.IO; using System.Linq; using System ...

  2. PAT 1081 检查密码(15) (代码+思路)

    1081 检查密码(15 分) 本题要求你帮助某网站的用户注册模块写一个密码合法性检查的小功能.该网站要求用户设置的密码必须由不少于6个字符组成,并且只能有英文字母.数字和小数点 .,还必须既有字母也 ...

  3. PHP 异步使用swoole的可行性测试

    PHP的异步.并行.高性能网络通信引擎swoole框架,在一开始我就比较注意,原因无他,php在swoole未出的情况下在多线程调度上确实算得上没有较好的解决方案. 我以系统的注册流程举例,在比较复杂 ...

  4. [转载] Linux中的搜索文件命令

    搜索文件用处很大,我们往往需要知道一个文件存放在什么地方,我们又知道Linux是命令强大的一个系统,所以也有好多非常优秀的搜索命令.通常find不常用,因为速度慢,耗费硬盘空间.通常我们先使用wher ...

  5. POJ2230 Watchcow

    原题链接 类欧拉回路,要求每条边被正反各经过一次,且从\(1\)出发并回到\(1\). 只需每次搜索该点的边时,将该点的边对应的邻接表头及时修改为下一条即可,因为邻接表恰好储存了正反方向的边,所以及时 ...

  6. Intellij idea 系列教程目录

    Intellij idea 系列教程目录 Intellij idea 系列教程之破解方法 Intellij idea 系列教程之常用快捷键 Intellij idea 系列教程之常用配置项 每天用心记 ...

  7. Mysql 注入load_file常用路径

    WINDOWS下: c:/boot.ini //查看系统版本 c:/windows/php.ini //php配置信息 c:/windows/my.ini //MYSQL配置文件,记录管理员登陆过的M ...

  8. tomcat+servlet例子

    在C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\app\WEB-INF文件夹下建立文件夹classes. 在C:\Pro ...

  9. unity在一个对象上挂多个一样的脚本怎么获取

    使用GetComponents获取,存到一个该类的数组里

  10. Hibernate 的Configuration、sessionFactory和session和transaction对象解释

    1.Configuration对象: Configuration conf=new Configuration(); conf.configure(); 1.1 到 src下面找到名称hibernat ...