最近写的将 markdown 文件转化成 html,并且支持目录生成的工具---mdtogh

2014-03-03 18:43:14 +08:00
 marchtea
最近在github上参与了The Art Of Programming By July的项目, 参与了生成电子书脚本的编写. 由于发现pandoc生成的html文件不太理想,因此就开始自己写了一个转化工具--mdtogh.

Github repo: https://github.com/marchtea/mdtogh

转换生成的效果: http://taop.marchtea.com
内容是The Art Of Programming By July中的文档.

相较于pandoc,优势在于:

1. 每个md文件对应一个html
2. 每个html文件中具有上一章,下一章, 首页链接.
3. 采用github api, 显示效果和github是一致的.
4. 有一个主页index.html,里面显示了书的基本信息以及目录
5. 安装简单.工具托管在pypi中,直接使用pip install mdtogh就可以安装了.

欢迎大家使用.有任何问题欢迎open issue, 能有pull request就更好不过了 :)
4053 次点击
所在节点    分享创造
9 条回复
bitbegin
2014-03-03 19:17:05 +08:00
貌似不错,就是没时间玩
jakwings
2014-03-03 21:08:35 +08:00
不错,遇见有趣的书。
marchtea
2014-03-03 21:20:41 +08:00
@bitbegin @jakwings 感谢送上.
slixurd
2014-03-03 21:57:03 +08:00
报个问题= =
不是生成器的,是内容的
你的第三章和第三章续是同个html同个anchor
marchtea
2014-03-03 22:04:51 +08:00
@slixurd 这个应该是我生成器的bug.我去看看.
marchtea
2014-03-03 22:16:16 +08:00
@slixurd bug修复了.已更新到github. pypi最近抽风.服务好了就上传上去. 感谢送上.
pharaohnie
2014-03-04 10:07:35 +08:00
加toc参数的时候报错了。

<code>
mdtogh --toc
Github css files are not cached. Download First
Fetching css url from https://github.com/marchtea/md_to_github_html ......done
Download css file: github-adb8493796a61d936498dd1a4b4e778c3423de88.css ... done
Download css file: github2-9d4a20ad5262fb38bc67f83e9dcc9faf7d35d7f5.css ... done
2 files in render list...
1 / 2 : Rendering: ./服务.md Error: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128)
</code>
marchtea
2014-03-04 10:30:08 +08:00
@pharaohnie 可能是文件名是中文导致的.我试试.
marchtea
2014-03-04 11:07:18 +08:00
@pharaohnie 确实是中文名引起的.bug已修复,推到github上了.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/102703

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX