Skip to content

Commit

Permalink
doc: Make a ZIP tarball for the HTML documentation and add its link t…
Browse files Browse the repository at this point in the history
…o the sidebar (#7650)

* Temporarily enable the docs workflow in the current branch

* Temporarily disable pushing to gh-page branch

* Add a zip file

* Temporarily enable it in the current branch

* Revert "Temporarily disable pushing to gh-page branch"

This reverts commit 48776e3.

* Add a link to the Zipfile

* Fix link to the zipfile

* Fix

* Use fa-download instead

* Revert unnecessary changes
  • Loading branch information
seisman authored Jul 20, 2023
1 parent 50e0d05 commit e56e8c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ci/deploy-gh-pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ echo -e "\nRemoving old files from previous builds of ${version}:"
rm -rvf ${version}
echo -e "\nCopying HTML files to ${version}:"
cp -Rvf ../build/doc/rst/html/ ${version}/
# Make a ZIP file for the HTML documentation
cd ${version}
zip -r ../gmt-docs-${version}.zip *
mv ../gmt-docs-${version}.zip .
cd ..
# If this is a new release, update the link from /latest to it
if [[ "${version}" != "dev" ]]; then
echo -e "\nSetup link from ${version} to 'latest'."
Expand Down
8 changes: 8 additions & 0 deletions doc/rst/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ copyright = "@GMT_VERSION_YEAR@, The GMT Team"
version = '@GMT_PACKAGE_VERSION_MAJOR@.@GMT_PACKAGE_VERSION_MINOR@'
# The full version shown in the page title
release = '@GMT_PACKAGE_VERSION@'
if len('@GMT_PACKAGE_VERSION_WITH_GIT_REVISION@'.split("_")) == 3:
doc_version = "dev"
else:
doc_version = version

# -- Options for HTML output ---------------------------------------------------
html_theme = 'rtd'
Expand All @@ -60,6 +64,10 @@ html_context = {
'<i class="fa fa-github fa-fw"></i> Source Code',
"https://github.com/GenericMappingTools/gmt",
),
(
'<i class="fa fa-download fa-fw"></i> Download HTML zip',
f"/{doc_version}/gmt-docs-{doc_version}.zip",
),
],
# Show the "Edit on Github" link
# https://docs.readthedocs.io/en/latest/guides/vcs.html
Expand Down

0 comments on commit e56e8c7

Please sign in to comment.