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. [z]Libevent使用例子,从简单到复杂

    [z]http://blog.csdn.net/luotuo44/article/details/39670221 本文从简单到复杂,展示如何使用libevent.网上的许多例子都是只有服务器端的,本 ...

  2. vmware磁盘空间扩展

    往vmware虚拟机中导入数据库或者文件以后经常出现磁盘空间不够用.这个时候就需要扩展一下磁盘的大小. 笔者本来60G,现在想扩展到100G 命令如下 D:\Program Files (x86)\V ...

  3. mysql 安装后出现 10061错误

    #服务器端  提示 The vervice already exists! The current server installed #mysqld 服务没有启动 解决办法 移除原来的mysql服务  ...

  4. Java并发-UncaughtExceptionHandler捕获线程异常信息并重新启动线程

    Java并发-UncaughtExceptionHandler捕获线程异常信息并重新启动线程 一.捕获异常并重新启用线程 public class Testun { public static voi ...

  5. 4A - 排序

    输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数 ...

  6. C# mysql 插入数据,中文乱码

    用C#操作mysql时, 插入数据中文都是乱码,只显示问号,数据库本身使用的是utf-8字符. 网上百度一下有两种解决办法: 一种是在执行语句前面设置,如:MySQLCommand mCommand ...

  7. (转)EasyUI 分页总结

      最近用到了easyui的分页和搜索栏功能,使用过程中由于运用不熟练导致其间也出现过一些问题,下面做个小结,供大家共同学习.1.首先使用EasyUI 的DataGrid分页,得加载其js类库:< ...

  8. Luogu 2812 校园网络 - Tarjan

    Description 给出一个有向图, 要求出至少从哪几个点出发, 能不漏地经过所有节点. 再求出至少加几条边, 才能使图变成一个强联通分量 Solution 求出所有强联通分量, 形成一个有向无环 ...

  9. Laravel 利用 observer 类基于状态属性,对进行删除和修改的控制

    1 我们知道 Observer 类可以监听模型类的相关事件 1.1 creating, created, updating, updated, saving, saved, deleting, del ...

  10. com_pc-mcu

    #include <REG52.H> unsigned char UART_buff; bit New_rec = , Send_ed = , Money = ; void main (v ...