Permalink
Browse files

update sphinx to v1.4.5

  • Loading branch information...
1 parent dfeba8b commit 811a76be3642046ed072088676beeede2c99b08e @seisman seisman committed Aug 13, 2016
Showing with 106 additions and 49 deletions.
  1. +22 −7 Makefile
  2. +1 −1 requirements.txt
  3. +83 −41 source/conf.py
View
@@ -6,6 +6,7 @@ SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
+DOCNAME = GMT_modules
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
@@ -25,11 +26,12 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
- @echo " latex to make LaTeX files"
@echo " xelatexpdf to make LaTeX files and run them through xelatex"
@echo " linkcheck to check all external links for integrity"
@echo " figures to update all figures"
- @echo " github to push the generated html to github "
+ @echo " latex to make LaTeX files"
+ @echo " dummy to check syntax errors of document sources"
+ @echo " deploy to deploy html, zip and PDF to github"
clean:
rm -rf $(BUILDDIR)/*
@@ -44,10 +46,17 @@ linkcheck:
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
-github: html
- @echo "Push build/html to github/gh-pages"
+deploy: html xelatexpdf
+ @echo "Deploy HTML, ZIP and PDF"
ghp-import -b gh-pages -n build/html -m "Update at `date +'%Y-%m-%d %H:%M:%S'`"
- git push github gh-pages:gh-pages
+ git push origin gh-pages:gh-pages --force
+
+ mkdir -p build/doc-dev && cd build && \
+ cp -r html $(DOCNAME)-dev && zip -r doc-dev/$(DOCNAME)-dev.zip $(DOCNAME)-dev && \
+ cp latex/$(DOCNAME).pdf doc-dev/$(DOCNAME)-dev.pdf && \
+ ghp-import -b doc-dev doc-dev -m 'Update by travis automatically' && \
+ git push origin doc-dev:doc-dev --force
+
## Builers
html: figures
@@ -68,7 +77,13 @@ xelatexpdf: figures
cd $(BUILDDIR)/latex; latexmk -xelatex -shell-escape -interaction=nonstopmode
@echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex."
+dummy:
+ $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
+ @echo
+ @echo "Build finished. Dummy builder generates no files."
+
+
release: html xelatexpdf
- cd $(BUILDDIR) && mv html GMT_modules && zip -r ../GMT_modules.zip GMT_modules/
- mv $(BUILDDIR)/latex/GMT_modules.pdf .
+ cd $(BUILDDIR) && mv html $(DOCNAME) && zip -r ../$(DOCNAME).zip $(DOCNAME)/
+ mv $(BUILDDIR)/latex/$(DOCNAME).pdf .
rm -rf $(BUILDDIR)/*
View
@@ -1,3 +1,3 @@
-sphinx>=1.4
+sphinx==1.4.5
ghp-import
cloud_sptheme
View
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
-# GMT模块手册 documentation build configuration file, created by
+# GMT模块手册 build configuration file, created by
# sphinx-quickstart on Tue Mar 22 20:21:30 2016.
#
# This file is execfile()d with the current directory set to its
@@ -13,19 +13,18 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
-import sys
-import os
-sys.path.insert(0, os.path.abspath('_extension'))
-
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
+#
+import os
+import sys
+sys.path.insert(0, os.path.abspath('_extension'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
-needs_sphinx = '1.4'
+needs_sphinx = '1.4.5'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -46,11 +45,13 @@
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
+#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The encoding of source files.
-source_encoding = 'utf-8'
+#
+source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
@@ -78,8 +79,11 @@
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
-#today = ''
+#
+# today = ''
+#
# Else, today_fmt is used as the format for a strftime call.
+#
today_fmt = u'%Y年%m月%d'
# List of patterns, relative to source directory, that match files and
@@ -89,28 +93,32 @@
# The reST default role (used for this markup: `text`) to use for all
# documents.
-#default_role = None
+#
+# default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
+#
+# add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
-#add_module_names = True
+#
+# add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
-#show_authors = False
+#
+# show_authors = False
-highlight_language = 'bash'
# The name of the Pygments (syntax highlighting) style to use.
+highlight_language = 'bash'
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
+# modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
-#keep_warnings = False
+# keep_warnings = False
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
@@ -120,12 +128,14 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
+#
import cloud_sptheme
html_theme = 'cloud'
# 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
# documentation.
+#
html_theme_options = {
"roottarget": "index",
"sidebar_localtoc_title": u"目录",
@@ -137,21 +147,25 @@
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [cloud_sptheme.get_theme_dir()]
-# The name for this set of Sphinx documents. If None, it defaults to
-# "<project> v<release> documentation".
+# The name for this set of Sphinx documents.
+# "<project> v<release> documentation" by default.
+#
html_title = project
# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
+#
+# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
-#html_logo = None
+#
+# html_logo = None
# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
-#html_favicon = None
+#
+# html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
@@ -161,63 +175,79 @@
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
+#
html_extra_path = ['CNAME']
# If not None, a 'Last updated on:' timestamp is inserted at every page
# bottom, using the given strftime format.
# The empty string is equivalent to '%b %d, %Y'.
+#
html_last_updated_fmt = u'%Y年%m月%d'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
-#html_use_smartypants = True
+#
+# html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
+#
+# html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
-#html_additional_pages = {}
+#
+# html_additional_pages = {}
# If false, no module index is generated.
-#html_domain_indices = True
+#
+# html_domain_indices = True
# If false, no index is generated.
-#html_use_index = True
+#
+# html_use_index = True
# If true, the index is split into individual pages for each letter.
-#html_split_index = False
+#
+# html_split_index = False
# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
+#
+# html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
+#
+# html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
+#
+# html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
+#
+# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
+# html_file_suffix = None
# Language to be used for generating the HTML full-text search index.
# Sphinx supports the following languages:
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh'
+#
html_search_language = 'zh'
# A dictionary with options for the search language support, empty by default.
-# Now only 'ja' uses this config value
-#html_search_options = {'type': 'default'}
+# 'ja' uses this config value.
+# 'zh' user can custom change `jieba` dictionary path.
+#
+# html_search_options = {'type': 'default'}
# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
-#html_search_scorer = 'scorer.js'
+#
+# html_search_scorer = 'scorer.js'
# Output file base name for HTML help builder.
htmlhelp_basename = 'GMT_modules'
@@ -259,23 +289,35 @@
# The name of an image file (relative to this directory) to place at the top of
# the title page.
-#latex_logo = None
+#
+# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
-#latex_use_parts = False
+#
+# latex_use_parts = False
# If true, show page references after internal links.
-#latex_show_pagerefs = False
+#
+# latex_show_pagerefs = False
# If true, show URL addresses after external links.
-#latex_show_urls = False
+#
+# latex_show_urls = False
# Documents to append as an appendix to all manuals.
-#latex_appendices = []
+#
+# latex_appendices = []
+
+# It false, will not define \strong, \code, itleref, \crossref ... but only
+# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
+# packages.
+#
+# latex_keep_old_macro_names = True
# If false, no module index is generated.
-#latex_domain_indices = True
+#
+# latex_domain_indices = True
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {

0 comments on commit 811a76b

Please sign in to comment.