TDAP-help / TDAP

TDAP manual
https://TDDFT-TDAP.github.io
3 stars 1 forks source link

搭建过程 #1

Open cndaqiang opened 4 years ago

cndaqiang commented 4 years ago
conda install -n python37 sphinx
pip install sphinx-rtd-theme

install

(python37) cndaqiang@girl:~/code/TDAP-Manual.github.io/Source3.7$ sphinx-quickstart
欢迎使用 Sphinx 2.3.0 快速配置工具。

请输入接下来各项设置的值(如果方括号中指定了默认值,直接
按回车即可使用默认值)。

已选择根路径:.

布置用于保存 Sphinx 输出的构建目录,有两种选择。
一是在根路径下创建“_build”目录,二是在根路径下创建“source”
和“build”两个独立的目录。
> 独立的源文件和构建目录(y/n) [n]: y

项目名称会出现在文档的许多地方。
> 项目名称: TDAP Help
> 作者名称: Daqiang Chen
> 项目发行版本 []: stable

If the documents are to be written in a language other than English,
you can select a language here by its language code. Sphinx will then
translate text that it generates into that language.

For a list of supported codes, see
https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-language.
> 项目语种 [en]: 

创建文件 ./source/conf.py。
创建文件 ./source/index.rst。
创建文件 ./Makefile。
创建文件 ./make.bat。

完成:已创建初始目录结构。

你现在可以填写主文档文件 ./source/index.rst 并创建其他文档源文件了。 用 Makefile 构建文档,像这样:
 make builder
此处的“builder”是支持的构建器名,比如 html、latex 或 linkcheck。
cndaqiang commented 4 years ago

通过makefile进行创建

(python37) ~/code/TDAP-Manual.github.io/sphinx $ make
Sphinx v2.3.0
Please use `make target' where target is one of
  html        to make standalone HTML files
  dirhtml     to make HTML files named index.html in directories
  singlehtml  to make a single large HTML file
  pickle      to make pickle files
  json        to make JSON files
  htmlhelp    to make HTML files and an HTML help project
  qthelp      to make HTML files and a qthelp project
  devhelp     to make HTML files and a Devhelp project
  epub        to make an epub
  latex       to make LaTeX files, you can set PAPER=a4 or PAPER=letter
  latexpdf    to make LaTeX and PDF files (default pdflatex)
  latexpdfja  to make LaTeX files and run them through platex/dvipdfmx
  text        to make text files
  man         to make manual pages
  texinfo     to make Texinfo files
  info        to make Texinfo files and run them through makeinfo
  gettext     to make PO message catalogs
  changes     to make an overview of all changed/added/deprecated items
  xml         to make Docutils-native XML files
  pseudoxml   to make pseudoxml-XML files for display purposes
  linkcheck   to check all external links for integrity
  doctest     to run all doctests embedded in the documentation (if enabled)
  coverage    to run coverage check of the documentation (if enabled)

输入make html后就会在build目录生成html代码 预览

google-chrome build/html/index.html 
cndaqiang commented 4 years ago

复制代码到仓库,并禁用jekyll

touch .nojekyll
git add .
git commit .nojekyll -m "git add .nojekyll"
cndaqiang commented 4 years ago

主题

pip install sphinx_rtd_theme

Built with Sphinx using a theme provided by Read the Docs. 除额外注明的地方外,本文档按 CC BY-NC-SA 4.0 许可协议发布。 http://sphinx-doc.org/ https://github.com/rtfd/sphinx_rtd_theme https://readthedocs.org/

按照此文,修改./source/conf.py https://github.com/readthedocs/sphinx_rtd_theme

image

cndaqiang commented 4 years ago

支持markdown语法 https://sphinx-apidoc.readthedocs.io/zh_CN/latest/more/markdown.html 安装recommonmark::

pip install recommonmark 添加如下内容到conf.py中::

source_parsers = { '.md': 'recommonmark.parser.CommonMarkParser', } 添加Markdown的文件扩展名到配置文件的source_suffix变量::

source_suffix = ['.rst', '.md']

cndaqiang commented 4 years ago

https://sphinx-handbook.readthedocs.io/en/latest/rst-cheatsheet.html#id7

语法规则

cndaqiang commented 4 years ago

todo

:BlackArch 主页: https://blackarch.org
:收录的工具列表: https://blackarch.org/tools.html
cndaqiang commented 4 years ago
Schrödinger
cndaqiang commented 4 years ago

引入百度统计

<head>
    <link rel="import" href="page/Page_1.html" id="page1">
</head>
<body>
    <script>
        console.log(page1.import.body.innerHTML);
    </script>
</body>

———————————————— 版权声明:本文为CSDN博主「米粒003」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/arvin0/article/details/56839242