From 36f6aa74de3fe6520bfec59a6385f146e2594063 Mon Sep 17 00:00:00 2001 From: richteague Date: Wed, 25 Nov 2026 09:07:25 -0500 Subject: [PATCH] Docs: rename sections, drop search, add PFL code style - Rename the sidebar sections to Fitting Rotation Maps, Velocity Profiles and Velocity Fluctuations, retitle the FAQs to match, and list each FAQ last in its section as "FAQ". File names are unchanged so existing URLs keep working. - Remove the sidebar search box and its styling. - Add a Pygments style in the PFL palette (docs/_pygments/pfl.py) with bold near-black keywords, and use it for furo's dark code style too, so OS dark mode no longer gives charcoal code blocks on a light page. - Set furo's font and geometry variables on body rather than :root. Furo defines them on body, so the :root values never applied and the brand fonts (TeX Gyre Heros, JetBrains Mono) were not being used. Co-Authored-By: Claude Opus 5.5 --- docs/_pygments/pfl.py | 71 +++++++++++++++++++ docs/_static/css/eddy.css | 12 ++-- docs/conf.py | 13 ++-- docs/faq/annuli.rst | 4 +- docs/faq/structure_functions.rst | 4 +- docs/faq/velocity_maps.rst | 4 +- docs/index.rst | 12 ++-- .../structure_functions_coming_soon.rst | 2 +- 8 files changed, 95 insertions(+), 27 deletions(-) create mode 100644 docs/_pygments/pfl.py diff --git a/docs/_pygments/pfl.py b/docs/_pygments/pfl.py new file mode 100644 index 0000000..c2585e3 --- /dev/null +++ b/docs/_pygments/pfl.py @@ -0,0 +1,71 @@ +"""Pygments style in the Planet Formation Lab palette, for the eddy docs. + +Colours are the PFL tokens from _static/css/eddy.css. Only shades that +reach about 4.5:1 contrast on the paper background are used for text. +""" + +from pygments.style import Style +from pygments.token import (Comment, Error, Generic, Keyword, Name, Number, + Operator, Punctuation, String, Text, Whitespace) + +PAPER = '#FBFAF7' +N300 = '#ABA89B' +N500 = '#585548' +N700 = '#33312A' +N900 = '#1A1916' +DUST_600 = '#C24E00' +GAS_600 = '#136E7A' +MIT_RED = '#A31F34' + + +class PFLStyle(Style): + """Warm-neutral code on paper: bold near-black keywords, dust strings.""" + + name = 'pfl' + background_color = PAPER + highlight_color = '#FFF0E2' # dust-50, for emphasised lines + line_number_color = N300 + + styles = { + Text: N700, + Whitespace: '', + Error: MIT_RED, + + Comment: 'italic ' + N500, + Comment.Preproc: 'noitalic ' + N500, + + Keyword: 'bold ' + N900, + Keyword.Constant: 'bold ' + N900, + Keyword.Type: GAS_600, + + Operator: N500, + Operator.Word: 'bold ' + N900, + Punctuation: N500, + + Name: N700, + Name.Builtin: GAS_600, + Name.Builtin.Pseudo: 'italic ' + GAS_600, + Name.Function: GAS_600, + Name.Class: GAS_600, + Name.Namespace: N700, + Name.Decorator: DUST_600, + Name.Exception: MIT_RED, + + String: DUST_600, + String.Doc: 'italic ' + N500, + String.Escape: 'bold ' + DUST_600, + String.Interpol: 'bold ' + DUST_600, + + Number: MIT_RED, + + Generic.Prompt: N300, + Generic.Output: N700, + Generic.Traceback: MIT_RED, + Generic.Error: MIT_RED, + Generic.Heading: 'bold ' + N900, + Generic.Subheading: 'bold ' + N700, + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.Inserted: GAS_600, + Generic.Deleted: MIT_RED, + } diff --git a/docs/_static/css/eddy.css b/docs/_static/css/eddy.css index 3af308a..7efc71d 100644 --- a/docs/_static/css/eddy.css +++ b/docs/_static/css/eddy.css @@ -29,7 +29,11 @@ --pfl-gas-50:#E1F4F6; --pfl-gas-200:#9BDDE3; --pfl-gas-400:#2FB4C2; --pfl-gas-500:#1B93A2; --pfl-gas-600:#136E7A; --pfl-mit-red:#A31F34; +} +/* Furo sets its type and geometry variables on body, so they must be + overridden there too: on :root they lose to furo's own values. */ +body { /* Furo: type */ --font-stack:'TeX Gyre Heros', 'Helvetica Neue', Helvetica, Arial, sans-serif; --font-stack--headings:'TeX Gyre Heros', 'Helvetica Neue', Helvetica, Arial, sans-serif; @@ -69,8 +73,6 @@ body { --color-sidebar-item-background--current:transparent; --color-sidebar-item-background--hover:var(--pfl-n50); --color-sidebar-item-expander-background--hover:var(--pfl-n50); - --color-sidebar-search-border:var(--pfl-n100); - --color-sidebar-search-icon:var(--pfl-n300); --color-toc-title-text:#DD5C0C; --color-toc-item-text:var(--pfl-n400); @@ -157,12 +159,6 @@ article a:hover { text-decoration-color:currentColor; } .sidebar-logo-container { margin:0; flex:none; } .sidebar-brand-text { font-size:1.25rem; letter-spacing:-.01em; line-height:1; text-align:left; } -/* Search pinned at the foot of the sidebar: rule above instead of below */ -.sidebar-sticky > .sidebar-search-container { - border-top:1px solid var(--color-sidebar-search-border); - border-bottom:none; -} - /* ---------- Code ---------- */ .highlight { border:1px solid var(--color-background-border); border-radius:8px; } .highlight pre { padding:.9rem 1.1rem; font-size:.8125rem; line-height:1.7; } diff --git a/docs/conf.py b/docs/conf.py index b9cb830..30917f3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -69,9 +69,12 @@ def _get_version(): html_favicon = '_static/favicon.png' html_show_sourcelink = False -# Pygments: warm-neutral on paper. 'friendly' reads closest to the -# PFL palette out of the shipped styles. -pygments_style = 'friendly' +# Pygments: a custom style in the PFL palette (docs/_pygments/pfl.py), +# importable because this directory is on sys.path above. +pygments_style = '_pygments.pfl.PFLStyle' +# Furo still emits a dark code style for OS dark mode even though the rest +# of the page stays light, so point it at the same style. +pygments_dark_style = '_pygments.pfl.PFLStyle' # Light ("paper") only. Furo always ships a toggle, so the dark # variables are set to the light values and the toggle is hidden in @@ -86,8 +89,7 @@ def _get_version(): 'color-sidebar-background': '#FFFFFF', } -# Search sits at the foot of the left sidebar, below the navigation tree, -# rather than under the brand (furo's default order otherwise). +# No search box: furo's sidebar/search.html is left out of the sidebar. html_sidebars = { '**': [ 'sidebar/brand.html', @@ -95,7 +97,6 @@ def _get_version(): 'sidebar/navigation.html', 'sidebar/ethical-ads.html', 'sidebar/scroll-end.html', - 'sidebar/search.html', 'sidebar/variant-selector.html', ] } diff --git a/docs/faq/annuli.rst b/docs/faq/annuli.rst index 36266cc..c391fed 100644 --- a/docs/faq/annuli.rst +++ b/docs/faq/annuli.rst @@ -1,5 +1,5 @@ -Annuli FAQ -========== +Velocity Profiles FAQ +===================== Common questions about extracting velocities from annuli of spectra with :class:`eddy.linecube.linecube` and :class:`eddy.annulus.annulus`. For a diff --git a/docs/faq/structure_functions.rst b/docs/faq/structure_functions.rst index 8f7ca50..2ca60d3 100644 --- a/docs/faq/structure_functions.rst +++ b/docs/faq/structure_functions.rst @@ -1,5 +1,5 @@ -Structure Functions FAQ -======================= +Velocity Fluctuations FAQ +========================= Common questions about the :mod:`eddy.structurefunction` module. A worked :doc:`structure function tutorial ` diff --git a/docs/faq/velocity_maps.rst b/docs/faq/velocity_maps.rst index 8c5f694..c3b5438 100644 --- a/docs/faq/velocity_maps.rst +++ b/docs/faq/velocity_maps.rst @@ -1,5 +1,5 @@ -Velocity Maps FAQ -================= +Fitting Rotation Maps FAQ +========================= Common questions about fitting rotation maps with :class:`eddy.rotationmap.rotationmap`. For a walkthrough, start with diff --git a/docs/index.rst b/docs/index.rst index 8ac991c..530c640 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -41,27 +41,27 @@ Contents .. toctree:: :maxdepth: 2 - :caption: Velocity Maps + :caption: Fitting Rotation Maps - faq/velocity_maps tutorials/tutorial_1 tutorials/tutorial_2 tutorials/tutorial_5 + FAQ .. toctree:: :maxdepth: 2 - :caption: Annuli + :caption: Velocity Profiles - faq/annuli tutorials/tutorial_3 tutorials/tutorial_4 + FAQ .. toctree:: :maxdepth: 2 - :caption: Structure Functions + :caption: Velocity Fluctuations - faq/structure_functions tutorials/structure_functions_coming_soon + FAQ Support diff --git a/docs/tutorials/structure_functions_coming_soon.rst b/docs/tutorials/structure_functions_coming_soon.rst index afef50a..30b698c 100644 --- a/docs/tutorials/structure_functions_coming_soon.rst +++ b/docs/tutorials/structure_functions_coming_soon.rst @@ -6,6 +6,6 @@ Structure Function Tutorial **Coming soon.** A worked tutorial for the structure function module is being revised and will be added in a future update. -In the meantime, the :doc:`Structure Functions FAQ ` +In the meantime, the :doc:`Velocity Fluctuations FAQ ` covers what the module computes, how to run it on your own maps, and how to interpret the results.