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

Updates to documentation build for maint56 #3455

Merged
merged 7 commits into from
Mar 16, 2020

Conversation

billsacks
Copy link
Member

Includes the changes in #3439 and #3454 , but for the maint-5.6 branch.

Test suite: none
Test baseline: n/a
Test namelist changes: none
Test status: bit for bit

Fixes none

User interface changes?: none

Update gh-pages html (Y/N)?: Y (already done)

Code review:

This changes the documentation theme to use the readthedocs theme, with
some JavaScript that provides capabilities for a dropdown menu allowing
you to select between different versions.

This mimics the changes in
ESCOMP/CISM-wrapper#23

The changes in this commit assume that sphinx_rtd_theme is installed in
_themes. However, we are not going to do this here: instead, we'll rely
on a pip install of an appropriate branch of sphinx_rtd_theme, using:

pip install git+https://github.com/esmci/sphinx_rtd_theme.git@version-dropdown-with-fixes

A follow-up commit will fix that.
I don't like having this theme as a subtree for two reasons:
- Bloats the cime repo
- If we do this in all projects that need it, that's a maintenance issue
  if we need to update it. It would be better if we could just make
  updates to the themes in one place.

This assumes that we have done a pip install of the correct branch:

pip install git+https://github.com/esmci/sphinx_rtd_theme.git@version-dropdown-with-fixes
When it was in the list of extensions, I got this warning when building
documentation:

WARNING: extension 'sphinx_rtd_theme' has no setup() function; is it really a Sphinx extension module?

I'm thinking that we're using an older version of sphinx_rtd_theme that
doesn't support this. From the documentation, I see:

   Adding this theme as an extension is what enables localization of
   theme strings in your translated output. If these strings are not
   translated in your output, either we lack the localized strings for
   your locale, or you are using an old version of the theme.
Add pip install commands, remove some pieces that are no longer correct.
Rationale: The api documentation is built in the source tree. This leads
to a high potential for accidentally building the documentation using a
different version of the api documentation, if you have a build already
sitting around from a different branch and you forget to run 'make api'
before running 'make html' (I find myself making that mistake). We
mitigate this risk by ensuring that 'clean_api' is run whenever 'make
clean' is run, and having 'clean_api' remove any pre-existing generated
api documentation.
This way we don't need to remember to rerun 'make api' before running
'make html'. This is also needed when using
https://github.com/ESMCI/versioned-doc-builder with the '--clean' flag
(with the last commit, that made 'make clean' also run 'clean_api'):
otherwise, the api documentation gets cleaned and never rebuilt in time
to make the html documentation.

This makes the new 'clean_api' somewhat less important, but it still
seems good to have that in place, so that a 'make clean' also cleans out
the generated api documentation.
@billsacks
Copy link
Member Author

@jedwards4b note that these changes are identical to ones that have already been approved for master.

@jedwards4b jedwards4b merged commit 3bde85f into ESMCI:maint-5.6 Mar 16, 2020
@billsacks billsacks deleted the versioned_docs_for_maint56 branch March 16, 2020 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants