Skip to content
Snippets Groups Projects
  1. Dec 19, 2023
    • Vegard Nossum's avatar
      docs: translations: add translations links when they exist · 7418ec5b
      Vegard Nossum authored
      
      Add a new Sphinx extension that knows about the translations of kernel
      documentation and can insert links to the translations at the top of
      the document.
      
      It basically works like this:
      
      1. Register a new node type, LanguagesNode.
      
      2. Register a new transform, TranslationsTransform, that inserts a new
         LanguageNode at the top of every document. The LanguageNode contains
         "pending references" to translations of the document. The key here
         is that these are pending (i.e. unresolved) references that may or
         may not actually exist.
      
      3. Register a 'doctree-resolved' event that iterates over all the
         LanguageNode nodes. Any unresolved references are filtered out; the
         list of resolved references is passed to the 'translations.html'
         template and rendered as an HTML node (if HTML output is selected).
      
      Testing: make htmldocs, make latexdocs with Sphinx v4.3.2 and Firefox.
      
      v2:
      - changed bar into a drop-down menu
      - fixed language labels
      - fixed hysteresis reported by Akira Yokosawa
      
      Cc: Federico Vaga <federico.vaga@vaga.pv.it>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Akira Yokosawa <akiyks@gmail.com>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      Link: https://lore.kernel.org/r/20231215123701.2712807-1-vegard.nossum@oracle.com
      7418ec5b
  2. Dec 15, 2023
  3. Nov 17, 2023
  4. Feb 08, 2023
  5. Nov 01, 2022
    • Jonathan Corbet's avatar
      docs: Don't wire font sizes for HTML output · bd5d1cc8
      Jonathan Corbet authored
      
      The alabaster theme likes to provide explicit sizes for fonts, which
      overrides the users's own browser settings and is guaranteed to displease
      folks.  Set the font size to "inherit" so that the users browser settings
      control the font size they get.  We can use the font_size configuration
      option for the main body font (changing the size I'd already put there),
      but the sidebar size can only be set via custom CSS.
      
      Reported-by: default avatarBagas Sanjaya <bagasdotme@gmail.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      bd5d1cc8
  6. Oct 18, 2022
  7. Oct 13, 2022
  8. Dec 10, 2021
    • Mauro Carvalho Chehab's avatar
      docs: add support for RTD dark mode · a6fb8b5a
      Mauro Carvalho Chehab authored
      
      This is actually an overlay on the top of the RTD theme, which
      requires to include first the RTD theme.
      
      It should be noticed that, when the dark theme is used, the
      DOCS_CSS files won't be the last CSS themes. So, it won't
      override the dark.css style by default. So, it is needed
      to force the them override with "!important".
      
      This small script, for instance, produces a nice output with
      the RTD dark theme:
      
      	DOCS_THEME=sphinx_rtd_dark_mode
      	cat << EOF > dark_override.css
      	  html body {
      	    font-family: arial,helvetica,sans-serif;
      	  }
      	  html[data-theme='dark'] body {
      	    color: white !important;
      	  }
      	  html[data-theme='dark'] .sig-name {
      	    color: green !important;
      	  }
      	  html[data-theme='dark'] .wy-menu-vertical a {
      	    color: #ffcc00 !important;
      	  }
      	  html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3 {
      	    color: #ffcc00 !important;
      	  }
      	  html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 {
      	    color: #ffcc00 !important;
      	  }
      	  html[data-theme="dark"] h7, html[data-theme="dark"] h8, html[data-theme="dark"] h9 {
      	    color: #ffcc00 !important;
      	  }
      	  html[data-theme="dark"] .wy-nav-content a, html[data-theme="dark"] .wy-nav-content a:visited {
      	    color: #ffcc00 !important;
      	  }
      	EOF
      
      	make DOCS_CSS=dark_override.css DOCS_THEME=sphinx_rtd_dark_mode htmldocs
      
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Link: https://lore.kernel.org/r/90d316e055ef7f4c9021b9eada8f8d3b2e750a66.1638870323.git.mchehab+huawei@kernel.org
      
      
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      a6fb8b5a
  9. Oct 02, 2019
  10. Oct 07, 2018
  11. Jul 17, 2017
  12. Sep 21, 2016
  13. Aug 14, 2016
  14. Jul 19, 2016
  15. Jul 05, 2016
Loading