Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/move to sphinx-multiversion #104

Merged
merged 7 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Handle jenkins branch for release validation
name: Workflow for release branches
on:
push:
branches:
Expand Down
9 changes: 9 additions & 0 deletions docs/_templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Redirecting to master branch</title>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=./2.0.0/index.html">
<link rel="canonical" href="https://localhost:8081/2.0.0/index.html">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orviz Shoudn't the url here be with the real domain name for the documentation instead of localhost?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're absolutely right

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed we don't need this file anymore since we are not longer using html_additional_pages in conf.py

</head>
</html>
8 changes: 8 additions & 0 deletions docs/_templates/versioning.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% if versions %}
<h3>{{ _('Versions') }}</h3>
<ul>
{%- for item in versions %}
<li><a href="{{ item.url }}">{{ item.name }}</a></li>
{%- endfor %}
</ul>
{% endif %}
27 changes: 27 additions & 0 deletions docs/_templates/versions.html
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions docs/assets/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Redirecting to last stable tag</title>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=./2.0.0/index.html">
<link rel="canonical" href="https://indigo-dc.github.io/jenkins-pipeline-library/2.0.0/index.html">
</head>
</html>
6 changes: 5 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx_multiversion',
'sphinx_tabs.tabs',
'sphinx.ext.autosectionlabel'
]
Expand Down Expand Up @@ -184,7 +185,7 @@
# Additional templates that should be rendered to pages, maps page names to
# template names.
#
# html_additional_pages = {}
# html_additional_pages = {'index': 'index.html'}

# If false, no module index is generated.
#
Expand Down Expand Up @@ -344,3 +345,6 @@

# -- Options for sphinx-versioning -------------------------------------------
scv_whitelist_branches = ('(stable|release){1}/.+',)
# -- Options for sphinx-multiversion------------------------------------------
smv_branch_whitelist = r'(stable|release){1}/.+'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orviz is expected that master branch be excluded from the documentation releases? And what about tags x.y.z?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when testing the sphinx-multiversion the documentation for the tag 2.0.0 was automatically built, that's why I didn't include a specific definition for the tags. But, as you propose, it does no harm to provide a whitelist for tags too. I've tested it and works as expected.

smv_remote_whitelist = r'^.*$'
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
sphinx
sphinx-rtd-theme
sphinx-tabs
sphinx-multiversion
ghp-import