#362 Use readthedocs theme if it is installed
Merged 5 years ago by clime. Opened 5 years ago by frostyx.
copr/ frostyx/copr use-rtd-theme  into  master

file modified
+12
@@ -97,6 +97,18 @@ 

  #html_theme = 'alabaster'

  

  

+ # Use readthedocs theme if it is installed

+ # Ideally, we want to develop the documentation in the same theme

+ # that will be used in the production

+ try:

+     import sphinx_rtd_theme

+     html_theme = "sphinx_rtd_theme"

+     html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

+ except ImportError:

+     print("Please install the readthedocs theme with:")

+     print("dnf install python*-sphinx_rtd_theme")

This is just meant to be warning, right? Can we rather throw it to stderr?

Yep. I thought, that using sys.stderr.write(...) will print it in red, but it fails and stops the builds there. That's not what I wanted to do. I would like to use the theme if it is possible, but not force anyone to install it.

+ 

+ 

  # 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

  # documentation.

Ideally, we want to develop the documentation in the same theme, that will be used in the production

This is just meant to be warning, right? Can we rather throw it to stderr?

Yep. I thought, that using sys.stderr.write(...) will print it in red, but it fails and stops the builds there. That's not what I wanted to do. I would like to use the theme if it is possible, but not force anyone to install it.

Pull-Request has been merged by clime

5 years ago
Metadata