Browse Source

1.增加构建多分支文档的命令和文件 2.重命名Jenkinsfile为.Jenkinsfile

tags/v1.0.0alpha
x54-729 2 years ago
parent
commit
be94e5b686
5 changed files with 42 additions and 4 deletions
  1. +0
    -0
      .Jenkinsfile
  2. +4
    -1
      docs/Makefile
  3. +2
    -1
      docs/requirements.txt
  4. +27
    -0
      docs/source/_templates/versions.html
  5. +9
    -2
      docs/source/conf.py

Jenkinsfile → .Jenkinsfile View File


+ 4
- 1
docs/Makefile View File

@@ -9,7 +9,7 @@ SPHINXPROJ = fastNLP
SPHINXEXCLUDE = ../fastNLP/transformers/*
SOURCEDIR = source
BUILDDIR = build
PORT = 9000
PORT = 8000

# Put it first so that "make" without argument is like "make help".
help:
@@ -30,6 +30,9 @@ web:
dev:
make delete && make apidoc && make html && make server

versions:
sphinx-multiversion "$(SOURCEDIR)" "$(BUILDDIR)" && cd build && python -m http.server $(PORT)

prod:
make apidoc && make html



+ 2
- 1
docs/requirements.txt View File

@@ -1,3 +1,4 @@
sphinx
sphinx_rtd_theme
sphinx_autodoc_typehints
sphinx_autodoc_typehints
sphinx-multiversion

+ 27
- 0
docs/source/_templates/versions.html View File

@@ -0,0 +1,27 @@
{%- if current_version %}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Other Versions</span>
v: {{ current_version.name }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
{%- if versions.tags %}
<dl>
<dt>Tags</dt>
{%- for item in versions.tags %}
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
{%- endfor %}
</dl>
{%- endif %}
{%- if versions.branches %}
<dl>
<dt>Branches</dt>
{%- for item in versions.branches %}
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
{%- endfor %}
</dl>
{%- endif %}
</div>
</div>
{%- endif %}

+ 9
- 2
docs/source/conf.py View File

@@ -43,7 +43,8 @@ extensions = [
'sphinx.ext.autosummary',
'sphinx.ext.mathjax',
'sphinx.ext.todo',
'sphinx_autodoc_typehints'
'sphinx_autodoc_typehints',
'sphinx_multiversion',
]

autodoc_default_options = {
@@ -116,7 +117,11 @@ html_static_path = ['_static']
# 'searchbox.html']``.
#
# html_sidebars = {}

html_sidebars = {
'**': [
'versions.html',
],
}

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

@@ -168,6 +173,8 @@ texinfo_documents = [
'Miscellaneous'),
]

# -- Options for Multiversions ----------------------------------------------
smv_latest_version = 'dev0.8.0'

# -- Extension configuration -------------------------------------------------
def maybe_skip_member(app, what, name, obj, skip, options):


Loading…
Cancel
Save