update README

This commit is contained in:
Dongdong Tian 2015-11-09 10:33:05 +08:00
parent 35288dbcd8
commit c60add68e7

View File

@ -11,33 +11,39 @@
相关 相关
---- ----
- 书的文字部分来自于\ `Andriki`_\ 提供的Mediawiki源码 - 书的文字部分来自于 `Andriki`_ 提供的Mediawiki源码
- 使用\ `Sphinx`_\ 制作文档 - 使用 `Sphinx`_ 制作文档
- 项目主页https://github.com/seisman/how-to-write-makefile - 项目主页https://github.com/seisman/how-to-write-makefile
- 网页在线版http://htwm.readthedocs.org/zh_CN/latest/ - 网页在线版http://htwm.readthedocs.org/zh_CN/latest/
- PDF下载http://seisman.qiniudn.com/downloads/Makefile.pdf - PDF下载http://seisman.qiniudn.com/downloads/Makefile.pdf
- epub下载http://seisman.qiniudn.com/downloads/Makefile.epub - epub下载http://seisman.qiniudn.com/downloads/Makefile.epub
本地编译
--------
#. Clone项目到本地::
$ git clone https://github.com/seisman/how-to-write-makefile.git
#. 安装依赖::
$ pip install sphinx sphinx_rtd_theme pygments
#. 编译生成HTML::
$ make html
$ firefox build/html/index.html&
#. 编译生成PDF要求安装TeXLive 2015::
$ make xelatexpdf
$ evince build/latex/GMT5_Docs.pdf&
sphinx中文支持 sphinx中文支持
-------------- --------------
sphinx在利用LaTeX生成PDF时对中文支持不够因而修改sphinx如下: sphinx和readthedocs网站默认是不支持中文的因为对 ``conf.py````Makefile`` 做了些许修改。详情参考 `sphinx生成中文PDF <http://seisman.info/chinese-support-for-sphinx.html>`_`Commit 35288db <https://github.com/seisman/how-to-write-makefile/commit/35288dbcd859abf5107dd6900dca25f0d1b44db7>`_
#. 将\ ``sphinx/texinputs/Makefile``\ 中的\ ``pdflatex``\ 替换成\ ``xelatex``;
#. 修改\ ``sphinx/writers/latex.py``\ 在231行左右对中文做特殊处理
.. code-block:: python
if builder.config.language == 'zh_CN':
self.elements['babel'] = ''
self.elements['inputenc'] = ''
self.elements['utf8extra'] = ''
#. 修改\ ``conf.py``\.
.. _`陈皓`: http://coolshell.cn/haoel .. _`陈皓`: http://coolshell.cn/haoel
.. _`Andriki`: http://andriki.com/mediawiki/index.php?title=Linux:%E8%B7%9F%E6%88%91%E4%B8%80%E8%B5%B7%E5%86%99Makefile .. _`Andriki`: http://andriki.com/mediawiki/index.php?title=Linux:%E8%B7%9F%E6%88%91%E4%B8%80%E8%B5%B7%E5%86%99Makefile
.. _`Sphinx`: http://sphinx-doc.org/ .. _`Sphinx`: http://sphinx-doc.org/