美文网首页
Windows下通过Sphinx生成EPUB文档

Windows下通过Sphinx生成EPUB文档

作者: 养猫的老鼠 | 来源:发表于2019-07-21 18:51 被阅读0次

前言

这个问题是在阅读李笑来的<自学是门手艺>中遇到的,因为我用的是Windows,他在书里基于MACos,无法完全照搬,需要做一个改变(make换sphinx-build)

步骤

以下步骤基于Python Tutorial制作

conda install -c anaconda sphinx #在Anaconda中安装sphinx
git clone https://github.com/python/cpython.git
cd cpython/Doc/tutorial
sphinx-quickstart -q output --sep -p "The Python Tutorial" -a "Guido van Rossum" -r "1.0" -v "1.0" -l "en" --suffix ".rst" --master "index" --ext-autodoc --ext-doctest --ext-intersphinx --ext-todo --ext-coverage --ext-imgmath --ext-mathjax --ext-ifconfig --ext-viewcode --makefile --no-batchfile --no-use-make-mode #制作目录结构配置文件,注意,这里是双引号
copy *.rst output\source\ #拷贝rst文件至source目录下
sphinx-build -b epub ./source/ ./build/ #制作Epub文档

忽略中间的警告,只要最后提示“build succeed”就代表制作成功了,可以在output\build下找到epub文件。
如果想制作HTML文档,只需将epub换为HTML。

相关文章

网友评论

      本文标题:Windows下通过Sphinx生成EPUB文档

      本文链接:https://www.haomeiwen.com/subject/nusvlctx.html