From nobody Mon Apr 6 19:40:31 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 307C4C4332F for ; Thu, 13 Oct 2022 17:29:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229550AbiJMR3c (ORCPT ); Thu, 13 Oct 2022 13:29:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiJMR31 (ORCPT ); Thu, 13 Oct 2022 13:29:27 -0400 Received: from ms.lwn.net (ms.lwn.net [45.79.88.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7292C34E3; Thu, 13 Oct 2022 10:29:26 -0700 (PDT) Received: from meer.lwn.net (unknown [IPv6:2601:281:8300:73:8b7:7001:c8aa:b65f]) by ms.lwn.net (Postfix) with ESMTPA id 78173845; Thu, 13 Oct 2022 17:29:26 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 ms.lwn.net 78173845 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lwn.net; s=20201203; t=1665682166; bh=GPZZbukyBGUR5a86BzVdFY5tNFwcRKGUe05DCy1zk04=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iGsJwX2B2cftuZzw4pvOPmwBZ3A6w9DXtitUXVKpb9s/Qfj0kXgL8JzdDaGQ3iD2u W/KhRS6FQzv2ff2tkeZoYhT1MsLOJVEUYv/h3zChui0WEe1felJ7R4o+FMde4vDurV XLdNCZLqfC6v9MUg1YkXF/vHnQOE58AmsBK+wR9adKPjHcZ6D6CV3Cgn1BviuOeOaG gxrbqpD3aWinED2Edjp+xW/UipN+Gmd78L0gh9erHbaPlgxi91xRwahxXbmU0EOSu6 q1R2ita4AvqnubQmmUnb+eFSBEbZK3dISPacuFbI+GLkItM1xDFvgcvSvQOVQjAisQ caDFkNchGG60g== From: Jonathan Corbet To: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH v3 1/6] docs: Switch the default HTML theme to alabaster Date: Thu, 13 Oct 2022 11:29:13 -0600 Message-Id: <20221013172918.846856-2-corbet@lwn.net> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221013172918.846856-1-corbet@lwn.net> References: <20221013172918.846856-1-corbet@lwn.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The read-the-docs theme is not entirely attractive and doesn't give us control over the left column. "Alabaster" is deemed the default Sphinx theme, it is currently maintained and shipped bundled with Sphinx itself, so there is no need to install it separately. Switch over to this theme as the default for building kernel documentation; the DOCS_THEME environment variable can still be used to select a different theme. Acked-by: Mauro Carvalho Chehab Signed-off-by: Jonathan Corbet --- Documentation/conf.py | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/Documentation/conf.py b/Documentation/conf.py index b50c85083149..629f4afeb0eb 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -194,6 +194,24 @@ finally: else: version =3D release =3D "unknown version" =20 +# +# HACK: there seems to be no easy way for us to get at the version and +# release information passed in from the makefile...so go pawing through t= he +# command-line options and find it for ourselves. +# +def get_cline_version(): + c_version =3D c_release =3D '' + for arg in sys.argv: + if arg.startswith('version=3D'): + c_version =3D arg[8:] + elif arg.startswith('release=3D'): + c_release =3D arg[8:] + if c_version: + if c_release: + return c_version + '-' + c_release + return c_version + return version # Whatever we came up with before + # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # @@ -247,7 +265,7 @@ highlight_language =3D 'none' # a list of builtin themes. =20 # Default theme -html_theme =3D 'sphinx_rtd_theme' +html_theme =3D 'alabaster' html_css_files =3D [] =20 if "DOCS_THEME" in os.environ: @@ -324,6 +342,10 @@ if html_theme =3D=3D 'classic': 'bodyfont': "serif", 'headfont': "sans-serif", } +else: + html_theme_options =3D { + 'description': get_cline_version(), + } =20 sys.stderr.write("Using %s theme\n" % html_theme) =20 @@ -370,8 +392,8 @@ html_static_path =3D ['sphinx-static'] html_use_smartypants =3D False =20 # Custom sidebar templates, maps document names to template names. -# Note that the RTD theme ignores this. -html_sidebars =3D { '**': ['searchbox.html', 'localtoc.html', 'sourcelink.= html']} +# Note that the RTD theme ignores this +html_sidebars =3D { '**': ["about.html", 'searchbox.html', 'localtoc.html'= , 'sourcelink.html']} =20 # Additional templates that should be rendered to pages, maps page names to # template names. --=20 2.37.2