Skip to content

Commit

Permalink
feat: add PDG listing and review role
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Apr 8, 2021
1 parent 8d9afb8 commit 09a8720
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 18 deletions.
43 changes: 37 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,20 +208,51 @@
"repository_branch": html_theme_options["repository_branch"],
}

# Add roles to simplify external linnks
# Add roles to simplify external links
pdg_version = 2020


def setup(app: Sphinx):
app.add_role(
"wiki", autolink("https://en.wikipedia.org/wiki/%s", {"_": " "})
"wiki",
wikilink("https://en.wikipedia.org/wiki/%s"),
)
app.add_role(
"pdg-listing",
role=pdglink(
f"https://pdg.lbl.gov/{pdg_version}/listings/rpp{pdg_version}-list-%s.pdf"
),
)
app.add_role(
"pdg-review",
role=pdglink(
f"https://pdg.lbl.gov/{pdg_version}/reviews/rpp{pdg_version}-rev-%s.pdf"
),
)


def pdglink(pattern: str):
def role(
name, rawtext: str, text: str, lineno, inliner, options={}, content=[]
):
label = text
label = f"§ {label}"
url = text
url = url.lower()
url = url.replace(" ", "-")
url = pattern % (url,)
node = nodes.reference(rawtext, label, refuri=url, **options)
return [node], []

return role


def autolink(pattern: str, replace_mapping: Dict[str, str]):
def wikilink(pattern: str):
def role(
name, rawtext, text: str, lineno, inliner, options={}, content=[]
name, rawtext: str, text: str, lineno, inliner, options={}, content=[]
):
output_text = text
for search, replace in replace_mapping.items():
output_text = output_text.replace(search, replace)
output_text = output_text.replace("_", " ")
url = pattern % (text,)
node = nodes.reference(rawtext, output_text, refuri=url, **options)
return [node], []
Expand Down
26 changes: 14 additions & 12 deletions docs/theory/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@ K-matrix
A real, symmetric and hermitian operator that is defined from the
{term}`T-matrix` through $K^{-1} = T^{-1} + iI$. See
{cite}`badalyanResonancesCoupledChannels1982,chungPartialWaveAnalysis1995`
and {cite}`particledatagroupReviewParticlePhysics2020`, Section 49
(Resonances).
and {cite}`particledatagroupReviewParticlePhysics2020`
({pdg-review}`Resonances`).

P-vector

First described in {cite}`aitchisonMatrixFormalismOverlapping1972`. See also
{cite}`chungPartialWaveAnalysis1995` and
{cite}`particledatagroupReviewParticlePhysics2020`, Section 49 (Resonances).
{cite}`particledatagroupReviewParticlePhysics2020` ({pdg-review}`Resonances`).

Q-vector

See {cite}`chungPartialWaveAnalysis1995` and
{cite}`particledatagroupReviewParticlePhysics2020`, Section 49 (Resonances).
{cite}`particledatagroupReviewParticlePhysics2020`
({pdg-review}`Resonances`).

S-matrix
scattering operator
Expand Down Expand Up @@ -83,8 +84,8 @@ formation experiment
Here, $R$ is the resonance in which one is often interested in
{term}`hadron spectroscopy`.

See {cite}`particledatagroupReviewParticlePhysics2020`, Section 49
(Resonances). Related: {term}`production experiment`.
See {cite}`particledatagroupReviewParticlePhysics2020`
({pdg-review}`Resonances`). Related: {term}`production experiment`.

hadron

Expand Down Expand Up @@ -125,13 +126,13 @@ spectator particle
case is comparable to a {term}`formation experiment`, while the second
represents a decay process of particle $Z$.

See {cite}`particledatagroupReviewParticlePhysics2020`, Section 49
(Resonances).
See {cite}`particledatagroupReviewParticlePhysics2020`
({pdg-review}`Resonances`).

Quantum Chromodynamics (QCD)

The theory that describes the strong force on the most fundamental level. See
[PDG review on QCD](https://pdg.lbl.gov/2020/reviews/rpp2020-rev-qcd.pdf).
{cite}`particledatagroupReviewParticlePhysics2020` ({pdg-review}`qcd`).

quark

Expand All @@ -141,12 +142,13 @@ Quark Constituent Model (QCM)

Model with which to describe and categorize matter constituted of quarks
(i.e. {term}`hadrons <hadron>`). See
{cite}`particledatagroupReviewParticlePhysics2020`, Section 15.
{cite}`particledatagroupReviewParticlePhysics2020`
({pdg-review}`Quark Model`).

resonance

See {cite}`particledatagroupReviewParticlePhysics2020`, Section 49
(Resonances).
See {cite}`particledatagroupReviewParticlePhysics2020`
({pdg-review}`Resonances`).

Standard Model

Expand Down

0 comments on commit 09a8720

Please sign in to comment.