Skip to content

Commit

Permalink
Merge pull request #65 from laixintao/bugfix-chinese
Browse files Browse the repository at this point in the history
Fix Chinese character
  • Loading branch information
laixintao authored Aug 30, 2019
2 parents 1b62f2b + 4c0032c commit 9ad74c1
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 50 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
From python:3

WORKDIR /app

COPY requirements.txt ./requirements.txt

RUN pip3 install -r requirements.txt

RUN apt-get update && \
apt-get install -y git mercurial texlive-full xzdec && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
123 changes: 73 additions & 50 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,46 +33,46 @@
# ones.

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = ".rst"
source_suffix = ".rst"

# The master toctree document.
master_doc = "index"
master_doc = "index"

# General information about the project.
project = u"python-parallel-programming-cookbook-cn"
copyright = u"2017, laixintao"
author = u"laixintao"
project = u"python-parallel-programming-cookbook-cn"
copyright = u"2017, laixintao"
author = u"laixintao"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u"1.0"
version = u"1.0"

# The full version, including alpha/beta/rc tags.
release = u"1.0"
release = u"1.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = "zh_CN"
language = "zh_CN"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
pygments_style = "sphinx"

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
Expand All @@ -83,7 +83,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -102,57 +102,69 @@
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
"**": [
"about.html",
"navigation.html",
"relations.html", # needs "show_related": True theme option to display
"searchbox.html",
"donate.html",
"**": [
"about.html",
"navigation.html",
"relations.html", # needs "show_related": True theme option to display
"searchbox.html",
"donate.html",
]
}


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = "python-parallel-programming-cookbook-cndoc"
htmlhelp_basename = "python-parallel-programming-cookbook-cndoc"


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#'preamble': '',
'preamble': r'''
\hypersetup{unicode=true}
\usepackage{CJKutf8}
\DeclareUnicodeCharacter{00A0}{\nobreakspace}
\DeclareUnicodeCharacter{2203}{\ensuremath{\exists}}
\DeclareUnicodeCharacter{2200}{\ensuremath{\forall}}
\DeclareUnicodeCharacter{2286}{\ensuremath{\subseteq}}
\DeclareUnicodeCharacter{2713}{x}
\DeclareUnicodeCharacter{27FA}{\ensuremath{\Longleftrightarrow}}
\DeclareUnicodeCharacter{221A}{\ensuremath{\sqrt{}}}
\DeclareUnicodeCharacter{221B}{\ensuremath{\sqrt[3]{}}}
\DeclareUnicodeCharacter{2295}{\ensuremath{\oplus}}
\DeclareUnicodeCharacter{2297}{\ensuremath{\otimes}}
\begin{CJK}{UTF8}{gbsn}
\AtEndDocument{\end{CJK}}
''',
"preamble": """
\\hypersetup{unicode=true}
\\usepackage{CJKutf8}
\\AtBeginDocument{\\begin{CJK}{UTF8}{gbsn}}
\\AtEndDocument{\\end{CJK}}
"""
}

# latex_elements = {
# # The paper size ('letterpaper' or 'a4paper').
# # 'papersize': 'letterpaper',
# # The font size ('10pt', '11pt' or '12pt').
# # 'pointsize': '10pt',
# # Additional stuff for the LaTeX preamble.
# # 'preamble': '',
# "preamble": r"""
# \hypersetup{unicode=true}
# \usepackage{CJKutf8}
# \DeclareUnicodeCharacter{00A0}{\nobreakspace}
# \DeclareUnicodeCharacter{2203}{\ensuremath{\exists}}
# \DeclareUnicodeCharacter{2200}{\ensuremath{\forall}}
# \DeclareUnicodeCharacter{2286}{\ensuremath{\subseteq}}
# \DeclareUnicodeCharacter{2713}{x}
# \DeclareUnicodeCharacter{27FA}{\ensuremath{\Longleftrightarrow}}
# \DeclareUnicodeCharacter{221A}{\ensuremath{\sqrt{}}}
# \DeclareUnicodeCharacter{221B}{\ensuremath{\sqrt[3]{}}}
# \DeclareUnicodeCharacter{2295}{\ensuremath{\oplus}}
# \DeclareUnicodeCharacter{2297}{\ensuremath{\otimes}}
# \begin{CJK}{UTF8}{gbsn}
# \AtEndDocument{\end{CJK}}
# """
# }

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'python-parallel-programming-cookbook-cn.tex', u'python-parallel-programming-cookbook-cn Documentation',
u'laixintao', 'manual'),
(
master_doc,
"python-parallel-programming-cookbook-cn.tex",
u"python-parallel-programming-cookbook-cn Documentation",
u"laixintao",
"manual",
)
]


Expand All @@ -161,8 +173,13 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'python-parallel-programming-cookbook-cn', u'python-parallel-programming-cookbook-cn Documentation',
[author], 1)
(
master_doc,
"python-parallel-programming-cookbook-cn",
u"python-parallel-programming-cookbook-cn Documentation",
[author],
1,
)
]


Expand All @@ -172,9 +189,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'python-parallel-programming-cookbook-cn', u'python-parallel-programming-cookbook-cn Documentation',
author, 'python-parallel-programming-cookbook-cn', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"python-parallel-programming-cookbook-cn",
u"python-parallel-programming-cookbook-cn Documentation",
author,
"python-parallel-programming-cookbook-cn",
"One line description of project.",
"Miscellaneous",
)
]

rst_epilog = u"""
Expand Down

0 comments on commit 9ad74c1

Please sign in to comment.