Files
res_text/source/conf.py
2021-08-18 18:36:05 +08:00

195 lines
6.8 KiB
Python

# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# 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.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
project = '凝思安全操作系统V6.0技术说明书'
copyright = '2020, 北京凝思软件股份有限公司'
author = '北京凝思软件股份有限公司'
# The full version, including alpha/beta/rc tags
release = ''
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.graphviz',
'sphinx.ext.githubpages',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
# 'sphinx.ext.imgmath',
# 'sphinx.ext.mathjax',
#'sphinxcontrib.bibtex', # https://sphinxcontrib-bibtex.readthedocs.io/en/latest/
'sphinxcontrib.blockdiag',
'sphinxcontrib.mermaid',
#'sphinxcontrib.nwdiag',
#'sphinxcontrib.rackdiag',
#'sphinxcontrib.packdiag',
#'sphinxcontrib.seqdiag',
#'sphinxcontrib.actdiag',
# 'sphinx.ext.viewcode',
# 'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
#'numsec', # https://github.com/jterrace/sphinxtr/tree/master/extensions
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# 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'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
# 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,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
latex_elements = {
'releasename': '',
'papersize': 'a4paper',
'pointsize': '12pt',
'figure_align': 'htbp',
'maketitle': r'''
\pagenumbering{Roman} %%% to avoid page 1 conflict with actual page 1
\begin{titlepage}
\vspace*{40mm} %%% * is used to give space from top
\begin{minipage}[c]{4cm}
\begin{center}
\includegraphics[scale=0.5]{./linx.png}
\end{center}
\end{minipage}
\hfill
\begin{minipage}[c]{14.7cm}
\fontsize{36pt}{\baselineskip}\selectfont 凝思安全操作系统
\normalsize \\
\rule[2mm]{10.1cm}{0.5mm} \\
\bfseries\fontsize{28pt}{\baselineskip}\selectfont V6.0 {\hspace{2.8cm}} 技术说明书
\end{minipage}
\hfill
\\ \vspace{12cm}
\centering
%% \small \textit{北京凝思软件股份有限公司}
\Large \textbf{{北京凝思软件股份有限公司}}
\vfill
\small 创建时间 : \today
\end{titlepage}
''',
'tableofcontents':r'''
\pagenumbering{roman}
\tableofcontents
\listoffigures
\listoftables
\clearpage
\pagenumbering{arabic}
''',
'preamble':r'''
\usepackage{xeCJK}
\usepackage{indentfirst}
\setlength{\parindent}{2em} %%首行缩进
\hypersetup{unicode=true}
\usepackage{CJKutf8}
%%\today format
\usepackage{datetime} % 日期格式
\renewcommand{\today}{\number\year 年 \number\month 月}
%% \renewcommand{\today}{\number\year 年 \number\month 月 \number\day 日}
%% keyboard sytle
\renewcommand{\sphinxkeyboard}[1]{\raisebox{0.2ex}[0pt]{\fbox{\rule[-0.2ex]{0cm}{1ex}\footnotesize #1}}}
\RequirePackage{tocbibind} %%% comment this to remove page number for following
\addto\captionsenglish{\renewcommand{\contentsname}{目录}}
\addto\captionsenglish{\renewcommand{\listfigurename}{插图}}
\addto\captionsenglish{\renewcommand{\listtablename}{表格}}
\titleformat{\chapter}[display]
{\bfseries\Huge}
{\filleft \Huge 第 \hspace{2 mm} \thechapter \hspace{4 mm} 章}
{4ex}
{\titlerule
\vspace{2ex}%
\filright}
[\vspace{2ex}%
\titlerule]
%\definecolor{VerbatimBorderColor}{rgb}{0.2,0.2,0.2}
\definecolor{VerbatimColor}{rgb}{0.95,0.95,0.95}
\titleformat*{\section}{\Large\bfseries}
\titleformat*{\subsection}{\large\bfseries}
\titleformat*{\subsubsection}{\large\bfseries}
\usepackage{sphinx}
\sphinxsetup{TitleColor={rgb}{0,0,0}} %%标题颜色黑色
%\sphinxsetup{noteBorderColor={rgb}{0,0,0}}
\sphinxsetup{InnerLinkColor={rgb}{0,0,0}}
\sphinxsetup{OuterLinkColor={rgb}{0,0,0}}
%\sphinxsetup{warningBorderColor={rgb}{0,0,0}}
%\sphinxsetup{cautionBorderColor={rgb}{0,0,0}}
\makeatletter
\fancypagestyle{normal}{
\fancyhf{}
%\fancyhead[L]{{\py@HeaderFamily\nouppercase{\rightmark}}}
%\fancyhead[R]{{\py@HeaderFamily\nouppercase{\leftmark}}}
\renewcommand{\chaptername}[1]{}
\fancyhead[RE,LO]{{\nouppercase{\large\leftmark}}}
\fancyhead[LE,RO]{{\nouppercase{\rightmark}}}
\fancyfoot[CO]{\includegraphics[scale=0.06]{./linx.png} 北京凝思软件股份有限公司}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
}
\makeatother
''',
}
latex_documents = [
('index', '凝思安全操作系统V6.0技术说明书.tex', '凝思安全操作系统V6.0技术说明书',
'北京凝思软件股份公司', 'manual', True),
]
numfig=True
#numfig_format=
numfig_secnum_depth=1