From 077db4f2789d050455306158d6fb126b85ff77f8 Mon Sep 17 00:00:00 2001 From: mingzhen <42059349@qq.comm> Date: Sun, 16 Feb 2020 16:48:39 +0800 Subject: [PATCH] bugfix --- conf.py | 56 ++++++++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/conf.py b/conf.py index d38c6fea..2fed645d 100644 --- a/conf.py +++ b/conf.py @@ -14,23 +14,20 @@ import sys import os -import shlex -from git_lfs import fetch #sys.path.insert(0, os.path.abspath('..')) import sphinx_rtd_theme -from recommonmark.parser import CommonMarkParser from recommonmark.transform import AutoStructify -DOC_SOURCES_DIR = os.path.dirname(os.path.abspath(__file__)) -PROJECT_ROOT_DIR = os.path.dirname(os.path.dirname(DOC_SOURCES_DIR)) -sys.path.insert(0, DOC_SOURCES_DIR) -print('PROJECT_ROOT_DIR', PROJECT_ROOT_DIR) -# If runs on ReadTheDocs environment -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' +DOC_SOURCES_DIR = os.path.dirname(os.path.abspath(__file__)) +PROJECT_ROOT_DIR = os.path.dirname(os.path.dirname(DOC_SOURCES_DIR)) +sys.path.insert(0, DOC_SOURCES_DIR) +print('PROJECT_ROOT_DIR', PROJECT_ROOT_DIR) + +# If runs on ReadTheDocs environment +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' -# Hack for lacking git-lfs support ReadTheDocs # Hack for lacking git-lfs support ReadTheDocs # Hack for lacking git-lfs support ReadTheDocs if on_rtd: print('Fetching files with git_lfs') @@ -60,6 +57,7 @@ def _patched_fetch_urls(lfs_url, oid_list): git_lfs.fetch_urls = _patched_fetch_urls git_lfs.fetch(DOC_SOURCES_DIR) + # The suffix of source filenames. source_parsers = { '.md': 'recommonmark.parser.CommonMarkParser', @@ -82,10 +80,10 @@ def _patched_fetch_urls(lfs_url, oid_list): # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx_markdown_tables', 'sphinx_copybutton', 'sphinxcontrib.mermaid', - + 'sphinx.ext.mathjax', + 'sphinx_markdown_tables', ] # Add any paths that contain templates here, relative to this directory. @@ -100,18 +98,18 @@ def _patched_fetch_urls(lfs_url, oid_list): master_doc = 'index' # General information about the project. -project = u'WeBASE' +project = u'FISCO BCOS' copyright = u'© 2019. All rights reserved.' -author = u'WeBankFinTech' +author = u'fisco-bcos-dev' # 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 = '1.2' +version = '2.2' # The full version, including alpha/beta/rc tags. -release = 'v1.2.2' +release = 'v2.2.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -157,7 +155,7 @@ def _patched_fetch_urls(lfs_url, oid_list): # -- Options for HTML output ---------------------------------------------- - +html_theme = 'sphinx_rtd_theme' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme_options = {'navigation_depth': 4,} @@ -168,7 +166,8 @@ def _patched_fetch_urls(lfs_url, oid_list): # VCS options: https://docs.readthedocs.io/en/latest/vcs.html#github html_context = { "display_github": True, # Integrate GitHub - "github_repo": "WeBASE-DOC", # Repo name + "github_repo": "FISCO-BCOS-DOC", # Repo name + "github_user": "FISCO-BCOS", "github_version": "master", # Version "conf_py_path": "/", # Path in the checkout to the docs root } @@ -264,12 +263,11 @@ def _patched_fetch_urls(lfs_url, oid_list): #html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. -htmlhelp_basename = 'WeBASE_doc' +htmlhelp_basename = 'FISCO_BCOS_doc' # -- Options for LaTeX output --------------------------------------------- -#latex_engine = 'pdflatex' -latex_engine = 'xelatex' +latex_engine = 'pdflatex' latex_use_xindy = False latex_elements = { # The paper size ('letterpaper' or 'a4paper'). @@ -283,7 +281,7 @@ def _patched_fetch_urls(lfs_url, oid_list): 'preamble': r''' \hypersetup{unicode=true} \usepackage{CJKutf8} -\DeclareUnicodeCharacter{00A0}{~} +\DeclareUnicodeCharacter{00A0}{\nobreakspace} \DeclareUnicodeCharacter{2203}{\ensuremath{\exists}} \DeclareUnicodeCharacter{2200}{\ensuremath{\forall}} \DeclareUnicodeCharacter{2286}{\ensuremath{\subseteq}} @@ -300,14 +298,12 @@ def _patched_fetch_urls(lfs_url, oid_list): #'figure_align': 'htbp', } - - # 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, 'WeBASE.tex', u'WeBASE Documentation', - u'WeBankFinTech', 'manual'), + (master_doc, 'FISCO-BCOS.tex', u'FISCO BCOS Documentation', + u'fisco-dev', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -336,7 +332,7 @@ def _patched_fetch_urls(lfs_url, oid_list): # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, 'WeBASE', u'WeBASE Documentation', + (master_doc, 'FISCO BCOS', u'FISCO BCOS Documentation', [author], 1) ] @@ -350,8 +346,8 @@ def _patched_fetch_urls(lfs_url, oid_list): # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'WeBASE', u'WeBASE Documentation', - author, 'WeBankFinTech', 'documents of WeBASE', + (master_doc, 'FISCO BCOS', u'FISCO BCOS Documentation', + author, 'fisco-dev', 'documents of FISCO BCOS', 'Miscellaneous'), ] @@ -381,4 +377,4 @@ def setup(app): app.add_transform(AutoStructify) app.add_stylesheet('css/custom.css') - + app.add_javascript('js/readthedocs-analytics.js')