1*61c4878aSAndroid Build Coastguard Worker.. _seed-0130: 2*61c4878aSAndroid Build Coastguard Worker 3*61c4878aSAndroid Build Coastguard Worker========================= 4*61c4878aSAndroid Build Coastguard Worker0130: Update Sphinx theme 5*61c4878aSAndroid Build Coastguard Worker========================= 6*61c4878aSAndroid Build Coastguard Worker.. seed:: 7*61c4878aSAndroid Build Coastguard Worker :number: 130 8*61c4878aSAndroid Build Coastguard Worker :name: Update Sphinx theme 9*61c4878aSAndroid Build Coastguard Worker :status: Accepted 10*61c4878aSAndroid Build Coastguard Worker :proposal_date: 2024-08-28 11*61c4878aSAndroid Build Coastguard Worker :cl: 232591 12*61c4878aSAndroid Build Coastguard Worker :authors: Kayce Basques 13*61c4878aSAndroid Build Coastguard Worker :facilitator: Anthony DiGirolamo 14*61c4878aSAndroid Build Coastguard Worker 15*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-summary: 16*61c4878aSAndroid Build Coastguard Worker 17*61c4878aSAndroid Build Coastguard Worker------- 18*61c4878aSAndroid Build Coastguard WorkerSummary 19*61c4878aSAndroid Build Coastguard Worker------- 20*61c4878aSAndroid Build Coastguard Worker.. _pydata-sphinx-theme: https://pydata-sphinx-theme.readthedocs.io/en/stable/ 21*61c4878aSAndroid Build Coastguard Worker 22*61c4878aSAndroid Build Coastguard WorkerOur current ``pigweed.dev`` theme (``furo``) has served us well over the 23*61c4878aSAndroid Build Coastguard Workerlast few years but we are starting to outgrow it. This SEED proposes adopting 24*61c4878aSAndroid Build Coastguard Worker`pydata-sphinx-theme`_ (``pydata`` for short) as the new theme for 25*61c4878aSAndroid Build Coastguard Worker``pigweed.dev``. 26*61c4878aSAndroid Build Coastguard Worker 27*61c4878aSAndroid Build Coastguard WorkerThe primary purpose of this seed is to document the thought process behind 28*61c4878aSAndroid Build Coastguard Workerchoosing one theme over another. Switching themes is a fairly reversible 29*61c4878aSAndroid Build Coastguard Workerdecision; switching from the current theme to ``pydata`` was 2-4 days of 30*61c4878aSAndroid Build Coastguard Workerwork for example. 31*61c4878aSAndroid Build Coastguard Worker 32*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-motivation: 33*61c4878aSAndroid Build Coastguard Worker 34*61c4878aSAndroid Build Coastguard Worker---------- 35*61c4878aSAndroid Build Coastguard WorkerMotivation 36*61c4878aSAndroid Build Coastguard Worker---------- 37*61c4878aSAndroid Build Coastguard Worker.. inclusive-language: disable 38*61c4878aSAndroid Build Coastguard Worker.. _Sphinx: https://www.sphinx-doc.org/en/master/ 39*61c4878aSAndroid Build Coastguard Worker.. _theme API: https://www.sphinx-doc.org/en/master/usage/theming.html 40*61c4878aSAndroid Build Coastguard Worker.. inclusive-language: enable 41*61c4878aSAndroid Build Coastguard Worker.. _PyPI: https://pypi.org/search/?q=&o=&c=Framework+%3A%3A+Sphinx+%3A%3A+Theme 42*61c4878aSAndroid Build Coastguard Worker 43*61c4878aSAndroid Build Coastguard Worker``pigweed.dev`` is powered by `Sphinx`_. Sphinx does not enforce a single 44*61c4878aSAndroid Build Coastguard WorkerUI. Rather, it provides a `theme API`_ and lets the Sphinx community 45*61c4878aSAndroid Build Coastguard Workerdevelop and share customized UIs. There are now hundreds of themes we can 46*61c4878aSAndroid Build Coastguard Workerchoose from on `PyPI`_. Our choice of theme has a big effect on the usability 47*61c4878aSAndroid Build Coastguard Workerand maintenance workload of ``pigweed.dev``. 48*61c4878aSAndroid Build Coastguard Worker 49*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-motivation-usability: 50*61c4878aSAndroid Build Coastguard Worker 51*61c4878aSAndroid Build Coastguard WorkerUsability 52*61c4878aSAndroid Build Coastguard Worker========= 53*61c4878aSAndroid Build Coastguard WorkerThe user interface of ``pigweed.dev`` needs to be easy to use and intuitive 54*61c4878aSAndroid Build Coastguard Workerso that people can find the information they need as quickly and efficiently 55*61c4878aSAndroid Build Coastguard Workeras possible. The main criteria are UI elements and layout. 56*61c4878aSAndroid Build Coastguard Worker 57*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-motivation-ui: 58*61c4878aSAndroid Build Coastguard Worker 59*61c4878aSAndroid Build Coastguard WorkerUser interface elements 60*61c4878aSAndroid Build Coastguard Worker----------------------- 61*61c4878aSAndroid Build Coastguard WorkerIf the theme does not provide critical UI elements like search modals or 62*61c4878aSAndroid Build Coastguard Workerbreadcrumbs, then we must implement and maintain these UI elements 63*61c4878aSAndroid Build Coastguard Workerourselves. 64*61c4878aSAndroid Build Coastguard Worker 65*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-motivation-layout: 66*61c4878aSAndroid Build Coastguard Worker 67*61c4878aSAndroid Build Coastguard WorkerLayout 68*61c4878aSAndroid Build Coastguard Worker------ 69*61c4878aSAndroid Build Coastguard WorkerBy "layout" we mean the positioning of key UI elements like the search box, 70*61c4878aSAndroid Build Coastguard Workerthe top-level nav, the page nav, breadcrumbs, etc. We should align the 71*61c4878aSAndroid Build Coastguard Workerlayout of ``pigweed.dev`` with the layouts of docs sites that are widely 72*61c4878aSAndroid Build Coastguard Workerregarded as being easy to use. 73*61c4878aSAndroid Build Coastguard Worker 74*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-motivation-maintenance: 75*61c4878aSAndroid Build Coastguard Worker 76*61c4878aSAndroid Build Coastguard WorkerMaintenance workload 77*61c4878aSAndroid Build Coastguard Worker==================== 78*61c4878aSAndroid Build Coastguard WorkerSome themes are a lot more work to maintain than others. Time 79*61c4878aSAndroid Build Coastguard Workerspent hacking on our theme is time *not* spent writing docs, creating code 80*61c4878aSAndroid Build Coastguard Workersamples, or improving upstream Pigweed. The two main criteria are 81*61c4878aSAndroid Build Coastguard Workerinternationalization and community. 82*61c4878aSAndroid Build Coastguard Worker 83*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-motivation-internationalization: 84*61c4878aSAndroid Build Coastguard Worker 85*61c4878aSAndroid Build Coastguard WorkerInternationalization 86*61c4878aSAndroid Build Coastguard Worker-------------------- 87*61c4878aSAndroid Build Coastguard Worker.. _UI string localization: https://lingoport.com/i18n-term/ui-strings/ 88*61c4878aSAndroid Build Coastguard Worker 89*61c4878aSAndroid Build Coastguard WorkerSoon we may want to start delivering ``pigweed.dev`` content in different 90*61c4878aSAndroid Build Coastguard Workerlanguages. Our theme needs to support basic internationalization features 91*61c4878aSAndroid Build Coastguard Workerlike `UI string localization`_ so that we can begin figuring out an 92*61c4878aSAndroid Build Coastguard Workerinternationalization pipeline that works for us. 93*61c4878aSAndroid Build Coastguard Worker 94*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-motivation-community: 95*61c4878aSAndroid Build Coastguard Worker 96*61c4878aSAndroid Build Coastguard WorkerCommunity 97*61c4878aSAndroid Build Coastguard Worker--------- 98*61c4878aSAndroid Build Coastguard WorkerIf a theme is used by lots of big projects, then there's a better chance 99*61c4878aSAndroid Build Coastguard Workerthat the theme will keep improving over time. I.e. it's more likely that 100*61c4878aSAndroid Build Coastguard Workerbugs will get fixed quickly and new features will be continuously added. 101*61c4878aSAndroid Build Coastguard WorkerLikewise, as we inevitably fix bugs and implement new features ourselves, 102*61c4878aSAndroid Build Coastguard Workerit would be great to be able to let other projects benefit from our work. 103*61c4878aSAndroid Build Coastguard Worker 104*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-proposal: 105*61c4878aSAndroid Build Coastguard Worker 106*61c4878aSAndroid Build Coastguard Worker-------- 107*61c4878aSAndroid Build Coastguard WorkerProposal 108*61c4878aSAndroid Build Coastguard Worker-------- 109*61c4878aSAndroid Build Coastguard Worker.. _change #226172: https://pwrev.dev/226172 110*61c4878aSAndroid Build Coastguard Worker 111*61c4878aSAndroid Build Coastguard WorkerAdopt ``pydata`` as the new ``pigweed.dev`` theme by merging 112*61c4878aSAndroid Build Coastguard Worker`change #226172`_. 113*61c4878aSAndroid Build Coastguard Worker 114*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-problem: 115*61c4878aSAndroid Build Coastguard Worker 116*61c4878aSAndroid Build Coastguard Worker--------------------- 117*61c4878aSAndroid Build Coastguard WorkerProblem investigation 118*61c4878aSAndroid Build Coastguard Worker--------------------- 119*61c4878aSAndroid Build Coastguard Worker 120*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-problem-ui: 121*61c4878aSAndroid Build Coastguard Worker 122*61c4878aSAndroid Build Coastguard WorkerUI elements 123*61c4878aSAndroid Build Coastguard Worker=========== 124*61c4878aSAndroid Build Coastguard WorkerThe most important UI element missing from the current ``pigweed.dev`` theme 125*61c4878aSAndroid Build Coastguard Workeris a search modal. By "search modal" we mean the ability to see search results 126*61c4878aSAndroid Build Coastguard Workerimmediately after typing something into the search box. ``pigweed.dev`` has 127*61c4878aSAndroid Build Coastguard Workerthis feature now but we had to implement it ourselves: 128*61c4878aSAndroid Build Coastguard Worker 129*61c4878aSAndroid Build Coastguard Worker.. figure:: https://storage.googleapis.com/pigweed-media/seeds/theme/current_search_modal.png 130*61c4878aSAndroid Build Coastguard Worker 131*61c4878aSAndroid Build Coastguard Worker The current search modal on ``pigweed.dev`` 132*61c4878aSAndroid Build Coastguard Worker 133*61c4878aSAndroid Build Coastguard WorkerImplementing a search modal from scratch is a lot of work to maintain: 134*61c4878aSAndroid Build Coastguard Worker 135*61c4878aSAndroid Build Coastguard Worker* The current search box (i.e. the input that you click to open the search 136*61c4878aSAndroid Build Coastguard Worker modal) is hidden on narrow viewports. I.e. when you visit 137*61c4878aSAndroid Build Coastguard Worker ``pigweed.dev`` on a smartphone you can't access the search box unless you 138*61c4878aSAndroid Build Coastguard Worker open the site nav menu. This will require significant theme customization 139*61c4878aSAndroid Build Coastguard Worker to fix. 140*61c4878aSAndroid Build Coastguard Worker* Search modal UIs can have tricky bugs. See :bug:`349475063`. 141*61c4878aSAndroid Build Coastguard Worker 142*61c4878aSAndroid Build Coastguard Worker.. note:: 143*61c4878aSAndroid Build Coastguard Worker 144*61c4878aSAndroid Build Coastguard Worker Search is a critical part of the ``pigweed.dev`` user experience. Our website 145*61c4878aSAndroid Build Coastguard Worker analytics data shows that ``/search.html`` is our second-most-visited page, 146*61c4878aSAndroid Build Coastguard Worker meaning that people use in-site search a lot. 147*61c4878aSAndroid Build Coastguard Worker 148*61c4878aSAndroid Build Coastguard Worker.. _a5038af: https://cs.opensource.google/pigweed/pigweed/+/a5038affded6feab2522a7dcc781c21c4f16cc1e 149*61c4878aSAndroid Build Coastguard Worker 150*61c4878aSAndroid Build Coastguard WorkerA breadcrumbs component is another key UI element missing from the current 151*61c4878aSAndroid Build Coastguard Workertheme. We implemented our own custom breadcrumbs element in `a5038af`_. 152*61c4878aSAndroid Build Coastguard WorkerAdmittedly, this was not much work to create, but we really shouldn't need 153*61c4878aSAndroid Build Coastguard Workerto implement core navigational elements like this ourselves. 154*61c4878aSAndroid Build Coastguard Worker 155*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-problem-layout: 156*61c4878aSAndroid Build Coastguard Worker 157*61c4878aSAndroid Build Coastguard WorkerLayout 158*61c4878aSAndroid Build Coastguard Worker====== 159*61c4878aSAndroid Build Coastguard Worker.. _MDN: https://developer.mozilla.org/ 160*61c4878aSAndroid Build Coastguard Worker.. _Stripe: https://docs.stripe.com/ 161*61c4878aSAndroid Build Coastguard Worker 162*61c4878aSAndroid Build Coastguard WorkerThe current ``pigweed.dev`` layout differs noticeably from two documentation 163*61c4878aSAndroid Build Coastguard Workersites that are widely renowned for being helpful and easy to use: `MDN`_ and 164*61c4878aSAndroid Build Coastguard Worker`Stripe`_. 165*61c4878aSAndroid Build Coastguard Worker 166*61c4878aSAndroid Build Coastguard Worker.. admonition:: How to choose what websites to index against? 167*61c4878aSAndroid Build Coastguard Worker 168*61c4878aSAndroid Build Coastguard Worker There is no annual survey of "best documentation websites" that we can rely 169*61c4878aSAndroid Build Coastguard Worker on. Maybe we should make that survey! Until then, we have to make an educated 170*61c4878aSAndroid Build Coastguard Worker guess. When discussions about great documentation sites come up, Stripe and 171*61c4878aSAndroid Build Coastguard Worker MDN are frequently mentioned. Other docs sites are sometimes mentioned, but not 172*61c4878aSAndroid Build Coastguard Worker as consistently as Stripe and MDN. 173*61c4878aSAndroid Build Coastguard Worker 174*61c4878aSAndroid Build Coastguard Worker Another factor is scope. Stripe has ~20 products. MDN documents the entire 175*61c4878aSAndroid Build Coastguard Worker web platform. These sites have spent a lot of time figuring out how to 176*61c4878aSAndroid Build Coastguard Worker keep thousands of docs pages usable and discoverable. As Pigweed's 177*61c4878aSAndroid Build Coastguard Worker offerings continue to grow in size and variety, ``pigweed.dev`` will 178*61c4878aSAndroid Build Coastguard Worker face similar challenges. In other words, Stripe and MDN have already thought 179*61c4878aSAndroid Build Coastguard Worker through the scaling challenges that we'll face in the coming years. 180*61c4878aSAndroid Build Coastguard Worker 181*61c4878aSAndroid Build Coastguard Worker One of our critical assumptions (which could be wrong!) is that the layouts 182*61c4878aSAndroid Build Coastguard Worker of MDN and Stripe *contribute* to their reputations of being helpful and 183*61c4878aSAndroid Build Coastguard Worker easy-to-use. It's possible that people only consider the *content* of these 184*61c4878aSAndroid Build Coastguard Worker sites to be high-quality, not necessarily the layouts (and UIs more 185*61c4878aSAndroid Build Coastguard Worker generally). 186*61c4878aSAndroid Build Coastguard Worker 187*61c4878aSAndroid Build Coastguard WorkerTo unpack the layout problem we need to look at color-coded diagrams of where 188*61c4878aSAndroid Build Coastguard WorkerStripe, MDN, and Pigweed place key UI elements: 189*61c4878aSAndroid Build Coastguard Worker 190*61c4878aSAndroid Build Coastguard Worker.. _typical Stripe doc: https://storage.googleapis.com/pigweed-media/seeds/theme/stripe2.png 191*61c4878aSAndroid Build Coastguard Worker 192*61c4878aSAndroid Build Coastguard Worker.. _typical MDN doc: https://storage.googleapis.com/pigweed-media/seeds/theme/mdn2.png 193*61c4878aSAndroid Build Coastguard Worker 194*61c4878aSAndroid Build Coastguard Worker.. _typical Pigweed doc: https://storage.googleapis.com/pigweed-media/seeds/theme/pigweed.png 195*61c4878aSAndroid Build Coastguard Worker 196*61c4878aSAndroid Build Coastguard Worker.. figure:: https://storage.googleapis.com/pigweed-media/seeds/theme/stripe-layout.png 197*61c4878aSAndroid Build Coastguard Worker 198*61c4878aSAndroid Build Coastguard Worker Layout of a `typical Stripe doc`_ 199*61c4878aSAndroid Build Coastguard Worker 200*61c4878aSAndroid Build Coastguard Worker.. figure:: https://storage.googleapis.com/pigweed-media/seeds/theme/mdn-layout.png 201*61c4878aSAndroid Build Coastguard Worker 202*61c4878aSAndroid Build Coastguard Worker Layout of a `typical MDN doc`_ 203*61c4878aSAndroid Build Coastguard Worker 204*61c4878aSAndroid Build Coastguard Worker.. figure:: https://storage.googleapis.com/pigweed-media/seeds/theme/pigweed_layout_2.png 205*61c4878aSAndroid Build Coastguard Worker 206*61c4878aSAndroid Build Coastguard Worker Layout of a `typical Pigweed doc`_ 207*61c4878aSAndroid Build Coastguard Worker 208*61c4878aSAndroid Build Coastguard WorkerBoth Stripe and MDN have the same key UI elements. The location of some 209*61c4878aSAndroid Build Coastguard Workerkey UI elements like the search box varies a little, but not much. 210*61c4878aSAndroid Build Coastguard Worker 211*61c4878aSAndroid Build Coastguard Worker.. _previous research on searchboxes: https://web.archive.org/web/20240823151546/https://technicalwriting.dev/ux/searchboxes.html 212*61c4878aSAndroid Build Coastguard Worker 213*61c4878aSAndroid Build Coastguard WorkerPigweed's layout, on the other hand, differs significantly from the layouts 214*61c4878aSAndroid Build Coastguard Workerof Stripe and MDN: 215*61c4878aSAndroid Build Coastguard Worker 216*61c4878aSAndroid Build Coastguard Worker* The concepts of "top-level nav" and "section nav" don't exist on 217*61c4878aSAndroid Build Coastguard Worker ``pigweed.dev``. Instead, there's only a global nav that's basically a 218*61c4878aSAndroid Build Coastguard Worker combination of top-level nav and section nav. This is discussed more in 219*61c4878aSAndroid Build Coastguard Worker :ref:`seed-0130-problem-globalnav`. 220*61c4878aSAndroid Build Coastguard Worker* The search box is positioned far to the left, below the logo, whereas 221*61c4878aSAndroid Build Coastguard Worker Stripe and MDN put the search box in the header. My `previous research on 222*61c4878aSAndroid Build Coastguard Worker searchboxes`_ suggests that most docs sites put the search box in the header. 223*61c4878aSAndroid Build Coastguard Worker ``pigweed.dev`` is therefore probably not meeting readers expectations of 224*61c4878aSAndroid Build Coastguard Worker where to find the search box. 225*61c4878aSAndroid Build Coastguard Worker* The logo element is much taller. 226*61c4878aSAndroid Build Coastguard Worker 227*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-problem-globalnav: 228*61c4878aSAndroid Build Coastguard Worker 229*61c4878aSAndroid Build Coastguard WorkerGlobal nav 230*61c4878aSAndroid Build Coastguard Worker---------- 231*61c4878aSAndroid Build Coastguard Worker``pigweed.dev`` does not have a concept of a top-level nav and section nav 232*61c4878aSAndroid Build Coastguard Workerlike what you see on Stripe and MDN. Instead, it combines the top-level nav 233*61c4878aSAndroid Build Coastguard Workerand section nav into a global nav. 234*61c4878aSAndroid Build Coastguard Worker 235*61c4878aSAndroid Build Coastguard WorkerOver time, this global nav gradually builds up and becomes an overwhelmingly 236*61c4878aSAndroid Build Coastguard Workerlong list of links: 237*61c4878aSAndroid Build Coastguard Worker 238*61c4878aSAndroid Build Coastguard Worker.. figure:: https://storage.googleapis.com/pigweed-media/seeds/theme/old_global_nav_2.png 239*61c4878aSAndroid Build Coastguard Worker 240*61c4878aSAndroid Build Coastguard Worker Global nav circa Q1 2024 241*61c4878aSAndroid Build Coastguard Worker 242*61c4878aSAndroid Build Coastguard WorkerThat screenshot is from Q1 2024. The current global nav (next screenshot) is a 243*61c4878aSAndroid Build Coastguard Workerlittle more tidy, but will probably grow and become messy again. 244*61c4878aSAndroid Build Coastguard Worker 245*61c4878aSAndroid Build Coastguard WorkerAccessing some links requires navigating through 5 or more layers of nesting: 246*61c4878aSAndroid Build Coastguard Worker 247*61c4878aSAndroid Build Coastguard Worker.. figure:: https://storage.googleapis.com/pigweed-media/seeds/theme/global_nav_2.png 248*61c4878aSAndroid Build Coastguard Worker 249*61c4878aSAndroid Build Coastguard Worker The ``pw_assert`` docs are an example of 5 levels of nesting in the 250*61c4878aSAndroid Build Coastguard Worker current global nav 251*61c4878aSAndroid Build Coastguard Worker 252*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-problem-internationalization: 253*61c4878aSAndroid Build Coastguard Worker 254*61c4878aSAndroid Build Coastguard WorkerInternationalization 255*61c4878aSAndroid Build Coastguard Worker==================== 256*61c4878aSAndroid Build Coastguard Worker.. _documentation: https://pradyunsg.me/furo/quickstart/ 257*61c4878aSAndroid Build Coastguard Worker.. _template: https://github.com/pradyunsg/furo/blob/696ceb13f060dc505053f91ac4d46f0915c261be/src/furo/theme/furo/page.html 258*61c4878aSAndroid Build Coastguard Worker 259*61c4878aSAndroid Build Coastguard WorkerThe `documentation`_ for our current theme does not mention any support 260*61c4878aSAndroid Build Coastguard Workerfor internationalization. The core ``page.html`` `template`_ does not have 261*61c4878aSAndroid Build Coastguard Workerany logic suggesting that `UI string localization`_ is supported. 262*61c4878aSAndroid Build Coastguard Worker 263*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-problem-community: 264*61c4878aSAndroid Build Coastguard Worker 265*61c4878aSAndroid Build Coastguard WorkerCommunity 266*61c4878aSAndroid Build Coastguard Worker========= 267*61c4878aSAndroid Build Coastguard Worker.. _Pulse: https://github.com/pradyunsg/furo/pulse/monthly 268*61c4878aSAndroid Build Coastguard Worker 269*61c4878aSAndroid Build Coastguard WorkerOur current theme's repository is not very active. Summary of 270*61c4878aSAndroid Build Coastguard Worker1-month activity from the repo's `Pulse`_ page: 271*61c4878aSAndroid Build Coastguard Worker 272*61c4878aSAndroid Build Coastguard Worker Excluding merges, 3 authors have pushed 7 commits to main and 10 commits 273*61c4878aSAndroid Build Coastguard Worker to all branches. On main, 5 files have changed and there have been 24 274*61c4878aSAndroid Build Coastguard Worker additions and 14 deletions. 275*61c4878aSAndroid Build Coastguard Worker 276*61c4878aSAndroid Build Coastguard WorkerThe repo has had 49 contributors in total. 277*61c4878aSAndroid Build Coastguard Worker 278*61c4878aSAndroid Build Coastguard Worker.. _1.383M downloads: https://pypistats.org/packages/furo 279*61c4878aSAndroid Build Coastguard Worker 280*61c4878aSAndroid Build Coastguard WorkerPyPI Stats says that the theme got `1.383M downloads`_ last month. 281*61c4878aSAndroid Build Coastguard Worker 282*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-design: 283*61c4878aSAndroid Build Coastguard Worker 284*61c4878aSAndroid Build Coastguard Worker--------------- 285*61c4878aSAndroid Build Coastguard WorkerDetailed design 286*61c4878aSAndroid Build Coastguard Worker--------------- 287*61c4878aSAndroid Build Coastguard Worker 288*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-design-ui: 289*61c4878aSAndroid Build Coastguard Worker 290*61c4878aSAndroid Build Coastguard WorkerUser interface elements 291*61c4878aSAndroid Build Coastguard Worker======================= 292*61c4878aSAndroid Build Coastguard Worker``pydata`` provides a built-in search modal: 293*61c4878aSAndroid Build Coastguard Worker 294*61c4878aSAndroid Build Coastguard Worker.. figure:: https://storage.googleapis.com/pigweed-media/seeds/pydata-sphinx-theme/search_modal.png 295*61c4878aSAndroid Build Coastguard Worker 296*61c4878aSAndroid Build Coastguard Worker.. _Change #226172: https://pwrev.dev/226172 297*61c4878aSAndroid Build Coastguard Worker 298*61c4878aSAndroid Build Coastguard Worker``pydata`` does **not** currently provide an inline search experience. 299*61c4878aSAndroid Build Coastguard WorkerI.e. after typing text in the search modal, you do not immediately see 300*61c4878aSAndroid Build Coastguard Workersearch results. You have to press :kbd:`Enter` to view the search 301*61c4878aSAndroid Build Coastguard Workerresults page. `Change #226172`_ introduces custom logic 302*61c4878aSAndroid Build Coastguard Workerin ``//docs/_static/js/pigweed.js`` and ``//docs/_static/css/pigweed.css`` 303*61c4878aSAndroid Build Coastguard Workerto enable an inline search experience. We will attempt to contribute this 304*61c4878aSAndroid Build Coastguard Workerinline search feature to the upstream ``pydata`` repo. The existing custom 305*61c4878aSAndroid Build Coastguard Workersearch features at ``//pw_docgen/py/pw_docgen/sphinx/inlinesearch`` will be 306*61c4878aSAndroid Build Coastguard Workerdeleted as part of `change #226172`_. 307*61c4878aSAndroid Build Coastguard Worker 308*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-design-layout: 309*61c4878aSAndroid Build Coastguard Worker 310*61c4878aSAndroid Build Coastguard WorkerLayout 311*61c4878aSAndroid Build Coastguard Worker====== 312*61c4878aSAndroid Build Coastguard WorkerThe layout of the ``pydata`` theme is much closer to the MDN and Stripe 313*61c4878aSAndroid Build Coastguard Workerlayouts than the current Pigweed theme: 314*61c4878aSAndroid Build Coastguard Worker 315*61c4878aSAndroid Build Coastguard Worker.. _typical Pigweed doc when using pydata: https://storage.googleapis.com/pigweed-media/seeds/theme/pigweed_pydata.png 316*61c4878aSAndroid Build Coastguard Worker 317*61c4878aSAndroid Build Coastguard Worker.. figure:: https://storage.googleapis.com/pigweed-media/seeds/theme/pydata-layout.png 318*61c4878aSAndroid Build Coastguard Worker 319*61c4878aSAndroid Build Coastguard Worker Layout of a `typical Pigweed doc when using pydata`_ 320*61c4878aSAndroid Build Coastguard Worker 321*61c4878aSAndroid Build Coastguard WorkerHere are the Stripe and MDN layouts again for comparison: 322*61c4878aSAndroid Build Coastguard Worker 323*61c4878aSAndroid Build Coastguard Worker.. figure:: https://storage.googleapis.com/pigweed-media/seeds/theme/stripe-layout.png 324*61c4878aSAndroid Build Coastguard Worker 325*61c4878aSAndroid Build Coastguard Worker Layout of a `typical Stripe doc`_ 326*61c4878aSAndroid Build Coastguard Worker 327*61c4878aSAndroid Build Coastguard Worker.. figure:: https://storage.googleapis.com/pigweed-media/seeds/theme/mdn-layout.png 328*61c4878aSAndroid Build Coastguard Worker 329*61c4878aSAndroid Build Coastguard Worker Layout of a `typical MDN doc`_ 330*61c4878aSAndroid Build Coastguard Worker 331*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-design-globalnav: 332*61c4878aSAndroid Build Coastguard Worker 333*61c4878aSAndroid Build Coastguard WorkerGlobal nav 334*61c4878aSAndroid Build Coastguard Worker---------- 335*61c4878aSAndroid Build Coastguard WorkerBy adopting ``pydata`` we will get rid of the global nav and switch to a 336*61c4878aSAndroid Build Coastguard Workertop-level nav and section nav, very similar to the layouts of MDN and Stripe. 337*61c4878aSAndroid Build Coastguard WorkerFirst-level links in the current global nav move to the top-level nav in 338*61c4878aSAndroid Build Coastguard Workerthe header: 339*61c4878aSAndroid Build Coastguard Worker 340*61c4878aSAndroid Build Coastguard Worker.. figure:: https://storage.googleapis.com/pigweed-media/seeds/theme/nav_changes.png 341*61c4878aSAndroid Build Coastguard Worker 342*61c4878aSAndroid Build Coastguard Worker The box on the left is the old global nav. The box on the right is the new 343*61c4878aSAndroid Build Coastguard Worker top-level nav. The first-level links in the global nav become the links in 344*61c4878aSAndroid Build Coastguard Worker the new top-level nav. (The ordering and names of the links have changed 345*61c4878aSAndroid Build Coastguard Worker slightly.) 346*61c4878aSAndroid Build Coastguard Worker 347*61c4878aSAndroid Build Coastguard WorkerAfter clicking a top-level link like ``Modules`` the section nav shows 348*61c4878aSAndroid Build Coastguard Workerall the links related to that section: 349*61c4878aSAndroid Build Coastguard Worker 350*61c4878aSAndroid Build Coastguard Worker.. figure:: https://storage.googleapis.com/pigweed-media/seeds/theme/modules.png 351*61c4878aSAndroid Build Coastguard Worker 352*61c4878aSAndroid Build Coastguard Worker After clicking the ``Modules`` link in the header, the list of modules 353*61c4878aSAndroid Build Coastguard Worker appear as first-level links in the section nav 354*61c4878aSAndroid Build Coastguard Worker 355*61c4878aSAndroid Build Coastguard WorkerIn other words, second-level links in the global nav (next screenshot) get 356*61c4878aSAndroid Build Coastguard Workerpromoted to top-level links in the new section nav: 357*61c4878aSAndroid Build Coastguard Worker 358*61c4878aSAndroid Build Coastguard Worker.. figure:: https://storage.googleapis.com/pigweed-media/seeds/theme/modules_old.png 359*61c4878aSAndroid Build Coastguard Worker 360*61c4878aSAndroid Build Coastguard Worker Second-level links like ``Module Structure``, ``pw_alignment``, etc. become 361*61c4878aSAndroid Build Coastguard Worker first-level links in the new section nav 362*61c4878aSAndroid Build Coastguard Worker 363*61c4878aSAndroid Build Coastguard WorkerTherefore, top-down navigation is still possible in the new theme. 364*61c4878aSAndroid Build Coastguard WorkerThere's just a little more friction. This new friction will probably be the 365*61c4878aSAndroid Build Coastguard Workermost noticeable change for long-time ``pigweed.dev`` readers. 366*61c4878aSAndroid Build Coastguard Worker 367*61c4878aSAndroid Build Coastguard WorkerThe main reason to try the top-level nav and section nav approach is that 368*61c4878aSAndroid Build Coastguard Workerwe will probably need to get rid of the global nav soon anyways: 369*61c4878aSAndroid Build Coastguard Worker 370*61c4878aSAndroid Build Coastguard Worker.. _Every Page Is Page One: https://everypageispageone.com/the-book/ 371*61c4878aSAndroid Build Coastguard Worker 372*61c4878aSAndroid Build Coastguard Worker* :ref:`Problem investigation: Global nav <seed-0130-problem-globalnav>` 373*61c4878aSAndroid Build Coastguard Worker demonstrated how our global nav has already become overwhelming and 374*61c4878aSAndroid Build Coastguard Worker deeply nested. 375*61c4878aSAndroid Build Coastguard Worker* Global navs are not common on big docs sites. E.g. Stripe, MDN, Firebase, 376*61c4878aSAndroid Build Coastguard Worker Android, and AWS do not use global navs. `Every Page Is Page One`_ 377*61c4878aSAndroid Build Coastguard Worker explains why most sites give up on global navs after exceeding a certain 378*61c4878aSAndroid Build Coastguard Worker size: 379*61c4878aSAndroid Build Coastguard Worker 380*61c4878aSAndroid Build Coastguard Worker Sites like Amazon and Wikipedia make little use of top-down navigation... Both 381*61c4878aSAndroid Build Coastguard Worker sites are far too big to cover effectively, and most of what they contain is not 382*61c4878aSAndroid Build Coastguard Worker of immediate interest to the person viewing the page. Instead, they link to 383*61c4878aSAndroid Build Coastguard Worker things related to the current situation of the reader, the current subject of 384*61c4878aSAndroid Build Coastguard Worker interest, and immediately related subjects. In other words, the navigation that 385*61c4878aSAndroid Build Coastguard Worker these pages provide is local. 386*61c4878aSAndroid Build Coastguard Worker 387*61c4878aSAndroid Build Coastguard Worker.. get some data on global nav usage 388*61c4878aSAndroid Build Coastguard Worker 389*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-design-internationalization: 390*61c4878aSAndroid Build Coastguard Worker 391*61c4878aSAndroid Build Coastguard WorkerInternationalization 392*61c4878aSAndroid Build Coastguard Worker==================== 393*61c4878aSAndroid Build Coastguard Worker.. _Internationalization: https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/i18n.html 394*61c4878aSAndroid Build Coastguard Worker 395*61c4878aSAndroid Build Coastguard Worker``pydata`` supports `UI string localization`_ and has documentation detailing 396*61c4878aSAndroid Build Coastguard Workerthe theme's `Internationalization`_ support. This is sufficient for unblocking 397*61c4878aSAndroid Build Coastguard Workerour work to start figuring out an internationalization strategy. 398*61c4878aSAndroid Build Coastguard Worker 399*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-design-community: 400*61c4878aSAndroid Build Coastguard Worker 401*61c4878aSAndroid Build Coastguard WorkerCommunity 402*61c4878aSAndroid Build Coastguard Worker========= 403*61c4878aSAndroid Build Coastguard WorkerThe ``pydata`` repo has been more active than the current theme over the last 404*61c4878aSAndroid Build Coastguard Workermonth. From `Pulse <https://github.com/pydata/pydata-sphinx-theme/pulse>`__: 405*61c4878aSAndroid Build Coastguard Worker 406*61c4878aSAndroid Build Coastguard Worker Excluding merges, 8 authors have pushed 8 commits to main and 18 commits to 407*61c4878aSAndroid Build Coastguard Worker all branches. On main, 20 files have changed and there have been 148 408*61c4878aSAndroid Build Coastguard Worker additions and 132 deletions. 409*61c4878aSAndroid Build Coastguard Worker 410*61c4878aSAndroid Build Coastguard WorkerHere is the current theme's pulse data again for comparison: 411*61c4878aSAndroid Build Coastguard Worker 412*61c4878aSAndroid Build Coastguard Worker Excluding merges, 3 authors have pushed 7 commits to main and 10 commits 413*61c4878aSAndroid Build Coastguard Worker to all branches. On main, 5 files have changed and there have been 24 414*61c4878aSAndroid Build Coastguard Worker additions and 14 deletions. 415*61c4878aSAndroid Build Coastguard Worker 416*61c4878aSAndroid Build Coastguard Worker``pydata`` has had 126 contributors in total whereas the current theme has 417*61c4878aSAndroid Build Coastguard Workerhad 49. 418*61c4878aSAndroid Build Coastguard Worker 419*61c4878aSAndroid Build Coastguard Worker.. _1.316M downloads: https://pypistats.org/packages/pydata-sphinx-theme 420*61c4878aSAndroid Build Coastguard Worker 421*61c4878aSAndroid Build Coastguard WorkerPyPI Stats says that ``pydata`` got `1.316M downloads`_ last month, slightly 422*61c4878aSAndroid Build Coastguard Workerless than the current theme (1.383M downloads) but definitely in the same 423*61c4878aSAndroid Build Coastguard Workerballpark. 424*61c4878aSAndroid Build Coastguard Worker 425*61c4878aSAndroid Build Coastguard Worker.. _gallery: https://pydata-sphinx-theme.readthedocs.io/en/stable/examples/gallery.html 426*61c4878aSAndroid Build Coastguard Worker 427*61c4878aSAndroid Build Coastguard Worker`Gallery`_ shows that ``pydata`` is used by many extremely popular and 428*61c4878aSAndroid Build Coastguard Workerimportant projects: 429*61c4878aSAndroid Build Coastguard Worker 430*61c4878aSAndroid Build Coastguard Worker* Jupyter 431*61c4878aSAndroid Build Coastguard Worker* Matplotlib 432*61c4878aSAndroid Build Coastguard Worker* NumPy 433*61c4878aSAndroid Build Coastguard Worker* Pandas 434*61c4878aSAndroid Build Coastguard Worker* SciPy 435*61c4878aSAndroid Build Coastguard Worker 436*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-alternatives: 437*61c4878aSAndroid Build Coastguard Worker 438*61c4878aSAndroid Build Coastguard Worker------------ 439*61c4878aSAndroid Build Coastguard WorkerAlternatives 440*61c4878aSAndroid Build Coastguard Worker------------ 441*61c4878aSAndroid Build Coastguard Worker 442*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-alternatives-create: 443*61c4878aSAndroid Build Coastguard Worker 444*61c4878aSAndroid Build Coastguard WorkerCreate our own Sphinx theme 445*61c4878aSAndroid Build Coastguard Worker=========================== 446*61c4878aSAndroid Build Coastguard WorkerCreating our own Sphinx theme that aligns with a Google design 447*61c4878aSAndroid Build Coastguard Workersystem like Material Design could be worthwhile one day but would be 448*61c4878aSAndroid Build Coastguard Workermonths of work. We would have to fix all the problems described in 449*61c4878aSAndroid Build Coastguard Worker:ref:`seed-0130-problem` ourselves and build up our own theme community. 450*61c4878aSAndroid Build Coastguard WorkerWe should first find 5-10 other Google projects using Sphinx that will 451*61c4878aSAndroid Build Coastguard Workeradopt the theme and maybe share the workload with us. 452*61c4878aSAndroid Build Coastguard Worker 453*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-alternatives-adopt: 454*61c4878aSAndroid Build Coastguard Worker 455*61c4878aSAndroid Build Coastguard WorkerAdopt a different Sphinx theme 456*61c4878aSAndroid Build Coastguard Worker============================== 457*61c4878aSAndroid Build Coastguard WorkerWe did a fairly comprehensive review of other Sphinx themes, but 458*61c4878aSAndroid Build Coastguard Workerit's worth mentioning again that switching Sphinx themes is not 459*61c4878aSAndroid Build Coastguard Workerusually that much work. I.e. if we find another theme that's even 460*61c4878aSAndroid Build Coastguard Workerbetter suited than ``pydata``, then it should only be a few days 461*61c4878aSAndroid Build Coastguard Workerof work to switch to the new theme. 462*61c4878aSAndroid Build Coastguard Worker 463*61c4878aSAndroid Build Coastguard Worker.. inclusive-language: disable 464*61c4878aSAndroid Build Coastguard Worker.. _official theme documentation: https://www.sphinx-doc.org/en/master/usage/theming.html 465*61c4878aSAndroid Build Coastguard Worker.. inclusive-language: enable 466*61c4878aSAndroid Build Coastguard Worker.. _sphinx-themes: https://sphinx-themes.org/ 467*61c4878aSAndroid Build Coastguard Worker.. _Framework\:\:Sphinx\:\:Theme: https://pypi.org/search/?q=&o=&c=Framework+%3A%3A+Sphinx+%3A%3A+Theme 468*61c4878aSAndroid Build Coastguard Worker.. _PyPI Stats: https://pypistats.org/ 469*61c4878aSAndroid Build Coastguard Worker 470*61c4878aSAndroid Build Coastguard WorkerNotes about the methodology for finding other themes: 471*61c4878aSAndroid Build Coastguard Worker 472*61c4878aSAndroid Build Coastguard Worker* The `official theme documentation`_ mentions `sphinx-themes`_ as a place for 473*61c4878aSAndroid Build Coastguard Worker discovering new themes. 474*61c4878aSAndroid Build Coastguard Worker* The `Framework::Sphinx::Theme`_ tag on PyPI provides a comprehensive 475*61c4878aSAndroid Build Coastguard Worker list of themes, but you can only sort by "relevance" and last update. 476*61c4878aSAndroid Build Coastguard Worker* `PyPI Stats`_ provides statistics on monthly downloads. 477*61c4878aSAndroid Build Coastguard Worker* When a theme is hosted on GitHub, the Insights page on the theme's 478*61c4878aSAndroid Build Coastguard Worker repository provides more granular information about how active or 479*61c4878aSAndroid Build Coastguard Worker inactive the repository is. 480*61c4878aSAndroid Build Coastguard Worker 481*61c4878aSAndroid Build Coastguard WorkerSummary of other notable themes: 482*61c4878aSAndroid Build Coastguard Worker 483*61c4878aSAndroid Build Coastguard Worker.. _python-docs-theme: https://github.com/python/python-docs-theme 484*61c4878aSAndroid Build Coastguard Worker.. _sphinx-rtd-theme: https://github.com/readthedocs/sphinx_rtd_theme 485*61c4878aSAndroid Build Coastguard Worker.. _sphinx-book-theme: https://github.com/executablebooks/sphinx-book-theme 486*61c4878aSAndroid Build Coastguard Worker.. _piccolo-theme: https://github.com/piccolo-orm/piccolo_theme 487*61c4878aSAndroid Build Coastguard Worker.. _sphinx-material: https://github.com/bashtage/sphinx-material 488*61c4878aSAndroid Build Coastguard Worker.. _shibuya: https://github.com/lepture/shibuya 489*61c4878aSAndroid Build Coastguard Worker 490*61c4878aSAndroid Build Coastguard Worker.. csv-table:: 491*61c4878aSAndroid Build Coastguard Worker :header: "Name", "Monthly Downloads", "UI elements", "Layout", "i18n" 492*61c4878aSAndroid Build Coastguard Worker 493*61c4878aSAndroid Build Coastguard Worker "`python-docs-theme`_", "80K", "❌", "✅", "✅" 494*61c4878aSAndroid Build Coastguard Worker "`sphinx-rtd-theme`_", "6.6M", "❌", "❌", "✅" 495*61c4878aSAndroid Build Coastguard Worker "`sphinx-book-theme`_", "560K", "❌", "❌", "❌" 496*61c4878aSAndroid Build Coastguard Worker "`piccolo-theme`_", "11K", "❌", "❌", "❌" 497*61c4878aSAndroid Build Coastguard Worker "`sphinx-material`_", "33K", "❌", "❌", "❌" 498*61c4878aSAndroid Build Coastguard Worker "`shibuya`_", "7K", "❌", "❌", "❌" 499*61c4878aSAndroid Build Coastguard Worker 500*61c4878aSAndroid Build Coastguard Worker`shibuya <https://shibuya.lepture.com/>`__ has a pleasant UI. If 501*61c4878aSAndroid Build Coastguard Workerits community grows and support for breadcrumbs and internationalization 502*61c4878aSAndroid Build Coastguard Workeris added then we might want to consider switching to that one 503*61c4878aSAndroid Build Coastguard Workerin the future. 504*61c4878aSAndroid Build Coastguard Worker 505*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-alternatives-fork: 506*61c4878aSAndroid Build Coastguard Worker 507*61c4878aSAndroid Build Coastguard WorkerFork the current theme 508*61c4878aSAndroid Build Coastguard Worker====================== 509*61c4878aSAndroid Build Coastguard WorkerForking the current theme would give us the freedom to customize 510*61c4878aSAndroid Build Coastguard Workerthe theme to meet our needs, but we would have to fix all the problems 511*61c4878aSAndroid Build Coastguard Workerdescribed in :ref:`seed-0130-problem` ourselves. We would also have to 512*61c4878aSAndroid Build Coastguard Workerbuild up our own theme community. 513*61c4878aSAndroid Build Coastguard Worker 514*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-alternatives-ssg: 515*61c4878aSAndroid Build Coastguard Worker 516*61c4878aSAndroid Build Coastguard WorkerUse a different static site generator 517*61c4878aSAndroid Build Coastguard Worker===================================== 518*61c4878aSAndroid Build Coastguard WorkerSphinx at large is working well for Pigweed. We have simply outgrown our 519*61c4878aSAndroid Build Coastguard Workercurrent theme. Migrating to a different static site generator would be 520*61c4878aSAndroid Build Coastguard Workerweeks or months of work for highly uncertain ROI. Docs site migrations 521*61c4878aSAndroid Build Coastguard Workerare often extremely disruptive to both authors and readers. 522*61c4878aSAndroid Build Coastguard Worker 523*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-alternatives-continue: 524*61c4878aSAndroid Build Coastguard Worker 525*61c4878aSAndroid Build Coastguard WorkerContinue with the current theme 526*61c4878aSAndroid Build Coastguard Worker=============================== 527*61c4878aSAndroid Build Coastguard WorkerThe maintainers of the current theme might be receptive to the 528*61c4878aSAndroid Build Coastguard Workerfeatures we need, but we would have to wait weeks or months for 529*61c4878aSAndroid Build Coastguard Workerthem to implement the changes or implement them ourselves. ``pydata`` 530*61c4878aSAndroid Build Coastguard Workeralready provides everything we need now. 531*61c4878aSAndroid Build Coastguard Worker 532*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-questions: 533*61c4878aSAndroid Build Coastguard Worker 534*61c4878aSAndroid Build Coastguard Worker-------------- 535*61c4878aSAndroid Build Coastguard WorkerOpen questions 536*61c4878aSAndroid Build Coastguard Worker-------------- 537*61c4878aSAndroid Build Coastguard Worker 538*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-questions-community: 539*61c4878aSAndroid Build Coastguard Worker 540*61c4878aSAndroid Build Coastguard WorkerCommunity 541*61c4878aSAndroid Build Coastguard Worker========= 542*61c4878aSAndroid Build Coastguard WorkerIt's unknown whether ``pydata`` will accept our inline search feature. 543*61c4878aSAndroid Build Coastguard WorkerIf they don't, we'll have to continue maintaining that custom logic. 544*61c4878aSAndroid Build Coastguard WorkerIn general, we don't know how receptive the ``pydata`` maintainers will 545*61c4878aSAndroid Build Coastguard Workerbe to our feature requests, bug reports, etc. 546*61c4878aSAndroid Build Coastguard Worker 547*61c4878aSAndroid Build Coastguard Worker.. _seed-0130-questions-themes: 548*61c4878aSAndroid Build Coastguard Worker 549*61c4878aSAndroid Build Coastguard WorkerThemes 550*61c4878aSAndroid Build Coastguard Worker====== 551*61c4878aSAndroid Build Coastguard WorkerWe did not meticulously study every Sphinx theme in existence. It's 552*61c4878aSAndroid Build Coastguard Workerpossible (but unlikely) that there's an even better theme for us 553*61c4878aSAndroid Build Coastguard Workerout there somewhere. 554