qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, berrange@redhat.com
Subject: Re: [PATCH v5] sphinx: adopt kernel readthedoc theme
Date: Fri, 26 Mar 2021 15:28:09 -0400	[thread overview]
Message-ID: <37fc3214-9979-79d7-bfaa-9a5dea2f2676@redhat.com> (raw)
In-Reply-To: <20210323115328.4146052-1-marcandre.lureau@redhat.com>

On 3/23/21 7:53 AM, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> The default "alabaster" sphinx theme has a couple shortcomings:
> - the navbar moves along the page
> - the search bar is not always at the same place
> - it lacks some contrast and colours
> 
> The "rtd" theme from readthedocs.org is a popular third party theme used
> notably by the kernel, with a custom style sheet. I like it better,
> perhaps others do too. It also simplifies the "Edit on Gitlab" links.
> 
> Tweak a bit the custom theme to match qemu.org style, use the
> QEMU logo, and favicon etc.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Tested-by: Bin Meng <bmeng.cn@gmail.com>

Looks good in my opinion! I think it's definitely simpler to not try and 
maintain two themes to mixed results.

Reviewed-by: John Snow <jsnow@redhat.com>

> ---
> v5:
>   - raise an error if rtd theme is missing (also at configure time)
>   - commit message tweaks
> 
>   docs/_templates/editpage.html              |   5 -
>   docs/conf.py                               |  51 ++++---
>   docs/devel/_templates/editpage.html        |   5 -
>   docs/interop/_templates/editpage.html      |   5 -
>   docs/meson.build                           |   5 +-
>   docs/specs/_templates/editpage.html        |   5 -
>   docs/sphinx-static/theme_overrides.css     | 161 +++++++++++++++++++++
>   docs/system/_templates/editpage.html       |   5 -
>   docs/tools/_templates/editpage.html        |   5 -
>   docs/user/_templates/editpage.html         |   5 -
>   tests/docker/dockerfiles/debian10.docker   |   1 +
>   tests/docker/dockerfiles/fedora.docker     |   1 +
>   tests/docker/dockerfiles/ubuntu.docker     |   1 +
>   tests/docker/dockerfiles/ubuntu1804.docker |   1 +
>   tests/docker/dockerfiles/ubuntu2004.docker |   1 +
>   15 files changed, 198 insertions(+), 59 deletions(-)
>   delete mode 100644 docs/_templates/editpage.html
>   delete mode 100644 docs/devel/_templates/editpage.html
>   delete mode 100644 docs/interop/_templates/editpage.html
>   delete mode 100644 docs/specs/_templates/editpage.html
>   create mode 100644 docs/sphinx-static/theme_overrides.css
>   delete mode 100644 docs/system/_templates/editpage.html
>   delete mode 100644 docs/tools/_templates/editpage.html
>   delete mode 100644 docs/user/_templates/editpage.html
> 
> diff --git a/docs/_templates/editpage.html b/docs/_templates/editpage.html
> deleted file mode 100644
> index 4319b0f5ac..0000000000
> --- a/docs/_templates/editpage.html
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -<div id="editpage">
> -  <ul>
> -    <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/{{pagename}}.rst">Page source</a></li>
> -  </ul>
> -</div>
> diff --git a/docs/conf.py b/docs/conf.py
> index 2ee6111872..3802b70d62 100644
> --- a/docs/conf.py
> +++ b/docs/conf.py
> @@ -150,38 +150,47 @@
>   # The theme to use for HTML and HTML Help pages.  See the documentation for
>   # a list of builtin themes.
>   #
> -html_theme = 'alabaster'
> +try:
> +    import sphinx_rtd_theme
> +except ImportError:
> +    raise ConfigError(
> +        'The Sphinx \'sphinx_rtd_theme\' HTML theme was not found.\n'
> +    )
> +
> +html_theme = 'sphinx_rtd_theme'
>   

Try using ModuleNotFoundError here, just in case. ImportError will also 
catch stuff like when the module *is* found, but breaks for other 
reasons, and may obscure the underlying reason, depending.

(Don't worry about it if there's no reason to re-spin, though, I think 
it's an extremely minor point. My RB is with or without the change.)

--js


Off-topic: Do you know how we go about enabling the version drop-down on 
the RTD site so we can refer back to older documents?



      parent reply	other threads:[~2021-03-26 19:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 11:53 [PATCH v5] sphinx: adopt kernel readthedoc theme marcandre.lureau
2021-03-23 12:25 ` Thomas Lamprecht
2021-03-23 12:34   ` Marc-André Lureau
2021-03-25 20:05     ` Marc-André Lureau
2021-03-25 20:10 ` Marc-André Lureau
2021-03-26 19:28 ` John Snow [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37fc3214-9979-79d7-bfaa-9a5dea2f2676@redhat.com \
    --to=jsnow@redhat.com \
    --cc=berrange@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).