Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support render pdf #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,8 @@ doctest:

livehtml:
sphinx-autobuild -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html

pdf:
$(SPHINXBUILD) -b pdf $(ALLSPHINXOPTS) $(BUILDDIR)/pdf
@echo
@echo "generate pdf is in $(BUILDDIR)/pdf."
11 changes: 10 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = []
# extensions = []
extensions = ['rst2pdf.pdfbuilder']

pdf_documents = [('index', u'Real_World_Haskell_zh_cn', u'Real World Haskell 中文版', u'jiahut@gmail.com'),]
pdf_language = "zh_CN"
pdf_fit_mode = "shrink"
pdf_toc_depth = 2
pdf_fit_background_mode = 'scale'
pdf_stylesheets = ['a3','zh_CN']


# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
33 changes: 33 additions & 0 deletions zh_CN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"embeddedFonts": [
"chinese.msyh.ttf"
],
"fontsAlias": {
"stdFont": "Microsoft YaHei",
"stdBold": "Microsoft YaHei",
"stdItalic": "Microsoft YaHei",
"stdBoldItalic": "Microsoft YaHei",
"stdMono": "Microsoft YaHei",
"stdMonoBold": "Microsoft YaHei",
"stdMonoItalic": "Microsoft YaHei",
"stdMonoBoldItalic": "Microsoft YaHei",
"stdSans": "Microsoft YaHei",
"stdSansBold": "Microsoft YaHei",
"stdSansItalic": "Microsoft YaHei",
"stdSansBoldItalic": "Microsoft YaHei"
},
"styles": [
[
"base",
{
"wordWrap": "CJK"
}
],
[
"literal",
{
"wordWrap": "None"
}
]
]
}