diff --git a/Jenkinsfile b/.Jenkinsfile
similarity index 100%
rename from Jenkinsfile
rename to .Jenkinsfile
diff --git a/docs/Makefile b/docs/Makefile
index d6c4f6b6..fd4035db 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -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
diff --git a/docs/requirements.txt b/docs/requirements.txt
index 45450867..91e78913 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,3 +1,4 @@
sphinx
sphinx_rtd_theme
-sphinx_autodoc_typehints
\ No newline at end of file
+sphinx_autodoc_typehints
+sphinx-multiversion
\ No newline at end of file
diff --git a/docs/source/_templates/versions.html b/docs/source/_templates/versions.html
new file mode 100644
index 00000000..476c8d19
--- /dev/null
+++ b/docs/source/_templates/versions.html
@@ -0,0 +1,27 @@
+{%- if current_version %}
+
+
+ Other Versions
+ v: {{ current_version.name }}
+
+
+
+ {%- if versions.tags %}
+
+ - Tags
+ {%- for item in versions.tags %}
+ - {{ item.name }}
+ {%- endfor %}
+
+ {%- endif %}
+ {%- if versions.branches %}
+
+ - Branches
+ {%- for item in versions.branches %}
+ - {{ item.name }}
+ {%- endfor %}
+
+ {%- endif %}
+
+
+{%- endif %}
\ No newline at end of file
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 2ed8ac96..01884ef7 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -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):