curtin.readthedocs.io missing ToC and proper theme

Bug #2017041 reported by Bruce Elrick
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
curtin
New
Undecided
Unassigned

Bug Description

The built html docs at https://curtin.readthedocs.io/ (redirects to
https://curtin.readthedocs.io/en/latest/) have a truncated table of contents in the left-side
navigation. Further, the HTML theming does not match the RTD standard.

In comparison, locally-built docs have a correct ToC navigation on the left side and match the
RTD theme.

The problem appears to be this code in doc/conf.py:

# on_rtd is whether we are on readthedocs.org, this line of code grabbed from
# docs.readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd: # only import and set the theme if we're building docs locally
    import sphinx_rtd_theme
    html_theme = 'sphinx_rtd_theme'
    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# otherwise, readthedocs.org uses their theme by default, so no need to specify
# it

perhaps the RTD automatic theming used to work but no longer does.

I've tested the following change:

------
$ git diff master
diff --git a/doc/conf.py b/doc/conf.py
index d7a38ff5..fc0cd347 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -96,19 +96,15 @@ pygments_style = 'sphinx'

 # The theme to use for HTML and HTML Help pages. See the documentation for
 # a list of builtin themes.
-html_theme = 'classic'
+#html_theme = 'classic'

 # on_rtd is whether we are on readthedocs.org, this line of code grabbed from
 # docs.readthedocs.org
-on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+#on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

-if not on_rtd: # only import and set the theme if we're building docs locally
- import sphinx_rtd_theme
- html_theme = 'sphinx_rtd_theme'
- html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
-
-# otherwise, readthedocs.org uses their theme by default, so no need to specify
-# it
+import sphinx_rtd_theme
+html_theme = 'sphinx_rtd_theme'
+html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

 # Theme options are theme-specific and customize the look and feel of a theme
 # further. For a list of options available for each theme, see the
------

by connecting it to the following RTD project:
https://virtuous-sloth-curtin-docs.readthedocs.io/en/latest/

Tags: docs

Related branches

Revision history for this message
Bruce Elrick (virtuous-sloth) wrote :
Revision history for this message
Bruce Elrick (virtuous-sloth) wrote :

A GitHub PR https://github.com/canonical/curtin/pull/7 has been created (I'm not sure which is
the primary code repository, the github one or the one hosted here).

Revision history for this message
Bruce Elrick (virtuous-sloth) wrote :

I now see that you are using the LP git repo. I created an [LP MP](https://code.launchpad.net/~virtuous-sloth/curtin/+git/curtin/+merge/441502)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.