【问题标题】:Use pandoc as documentation generator使用 pandoc 作为文档生成器
【发布时间】:2014-07-20 23:36:01
【问题描述】:

我在维基百科页面 (Comparison of documentation generators) 中看到 pandoc 可以用作文档生成器(就像 doxygen 一样)。

但是我没有在 pandoc 的文档或它的站点中找到一种从源代码 cmets 中提取文档的方法,就像其他文档生成器那样。

那么我该如何使用 pandoc 来做到这一点呢?有没有办法从代码 cmets 中提取 pandoc 的标记语言并从中创建 PDF 或 HTML 文档?还是维基百科的对比列表有误?

【问题讨论】:

标签: comments markdown documentation-generation pandoc code-documentation


【解决方案1】:

采用http://www.ucalgary.ca/rzach/blog/2014/05/simple-way-to-document-code-with-markdown-grep-and-pandoc.html 中描述的方法作为 mb21 提到了一个像下面这样的 bash 脚本来完成这项工作

"makedoc"

#!/bin/bash

grep -e "^%" -e "^$$" $1.tex | cut --bytes=3-| pandoc -f markdown  -o $1.pdf

【讨论】:

    猜你喜欢
    • 2021-01-09
    • 2016-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-27
    • 2021-06-21
    • 2016-10-23
    • 1970-01-01
    相关资源
    最近更新 更多