Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions docs/_pygments/pfl.py
Original file line number Diff line number Diff line change
@@ -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,
}
12 changes: 4 additions & 8 deletions docs/_static/css/eddy.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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; }
Expand Down
13 changes: 7 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -86,16 +89,14 @@ 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',
'sidebar/scroll-start.html',
'sidebar/navigation.html',
'sidebar/ethical-ads.html',
'sidebar/scroll-end.html',
'sidebar/search.html',
'sidebar/variant-selector.html',
]
}
Expand Down
4 changes: 2 additions & 2 deletions docs/faq/annuli.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/faq/structure_functions.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Structure Functions FAQ
=======================
Velocity Fluctuations FAQ
=========================

Common questions about the :mod:`eddy.structurefunction` module. A
worked :doc:`structure function tutorial </tutorials/structure_functions_coming_soon>`
Expand Down
4 changes: 2 additions & 2 deletions docs/faq/velocity_maps.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <faq/velocity_maps>

.. toctree::
:maxdepth: 2
:caption: Annuli
:caption: Velocity Profiles

faq/annuli
tutorials/tutorial_3
tutorials/tutorial_4
FAQ <faq/annuli>

.. toctree::
:maxdepth: 2
:caption: Structure Functions
:caption: Velocity Fluctuations

faq/structure_functions
tutorials/structure_functions_coming_soon
FAQ <faq/structure_functions>


Support
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/structure_functions_coming_soon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 </faq/structure_functions>`
In the meantime, the :doc:`Velocity Fluctuations FAQ </faq/structure_functions>`
covers what the module computes, how to run it on your own maps, and how to
interpret the results.
Loading