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. 使用go语言的list实现一个简单的LRU缓存

    package main; import ( "container/list" "errors" "sync" "fmt" ...

  2. ROS安装

    本文参考地址:http://ros.exbot.net/wiki/cn(2f)indigo(2f)Installation(2f)Ubuntu.html http://wiki.ros.org/ind ...

  3. IDEA安装小配置

    1. view-->toolbar+toolbuttons 2. 根据大小写IDEA能准确提示 配置自动导入包 定义代码模板 提示忽略大小写 配置虚拟机内存,修改idea64.exe.vmopt ...

  4. opencv 双边模糊,膨胀腐蚀 开 闭操作

    #include <opencv2/opencv.hpp> #include <iostream> using namespace cv; int main(int argc, ...

  5. docker 运行 elasticsearch + kibana

    一.elasticsearch的安装 1.从官网上拉取 elasticsearch 的镜像 docker pull elasticsearch:5.6.11docker images 2.运行容器 m ...

  6. 超强干货,11个灰常实用的AI设计小技巧!

    11个超级实用的AI设计小技巧!涉及到很多的实用操作,纯干货经验总结,灰常值得收藏,赶快转走学起来吧! ​编辑:千锋UI设计

  7. Linq去重 不用实现IEqualityComparer接口的方法超级简单

    RskFactorRelation.Instance.GetCache<RskFactorRelation>(true).Where(x => !string.IsNullOrEmp ...

  8. iphone手机safari浏览器访问网站滚动条不显示问题解决办法

    近排有公司同事出差在外需使用OA系统,发现iphone手机safari浏览器在该出现滚动条的页面没有显示滚动条,导致无法正常使用. 系统前端页面是采用jeasyui搭建的框架,使用iframe变更主页 ...

  9. windows 2003端口80system进程占用的情况

    1.首先是http服务 a. 位置 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTPb. 把 REG_DWORD 类型的项 Start ...

  10. django网页图片验证码功能

    在一个正常的登录系统中,验证码是非常重要的,用于识别人机,毕竟我们都知道,这个世界中存在着万恶的爬虫,验证码有很多种方式,有图片的,有邮件的,有短信的,有拼图的,不管什么样的验证码,目的都是验证访问用 ...