You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggestion out of a conversation with Simon Scheidegger about the Deep Learning for Solving and Estimating Dynamic Economic Models course site (itself a MyST site): our published lecture sites should hand the reader a ready-made citation — driven by a CITATION.cff in the repo, and surfaced on the site in a range of formats (BibTeX, APA, RIS, and the raw .cff).
#342 already covers adding CITATION.cff files to the book-* repos so GitHub renders its "Cite this repository" sidebar button. This issue is the other half of the same idea: what the themes do with that metadata, so a reader landing on the published site never has to go to GitHub to work out how to cite it. Scope is quantecon-theme.mystmd, quantecon-book-theme, and the upcoming book and community-lecture themes.
What exists today
mystmd (and therefore Jupyter Book ≥ 2)
Jupyter Book 2 is built on the MyST engine, so whatever mystmd offers is what JB2 offers.
No — nothing citation-related in the @myst-theme packages we consume
The export is declared in project frontmatter, and myst build --cff writes the file from project (or page) frontmatter — authors, title, DOI, license, abstract — through the cffjs library. CFF fields that have no myst.yml equivalent go in the export block:
Two consequences worth noting. First, the direction is one-way — myst.yml is the source of truth and the .cff is a build artifact; jupyter-book/mystmd#2401 is the upstream issue to watch if we would rather make the .cff canonical and have myst.yml extend from it. Second, because the export produces a real file with an id:, it can be referenced from the site's downloads: config — so a MyST site can already offer CITATION.cff as a download with no theme change at all. That gets us the raw file, not the "pick your format" experience.
Jupyter Book 1 (Sphinx) — quantecon-book-theme
There is no CITATION.cff support anywhere in the JB1 stack. Citation support in JB1 means sphinxcontrib-bibtex — the {cite} role and a {bibliography} directive over a .bib file — which is about citing other works from within the text, not about how to cite the lecture series itself. Neither sphinx-book-theme nor pydata-sphinx-theme ships a "cite this" component.
So everything on this side is ours to build: a small Sphinx extension that reads CITATION.cff from the repo root, converts it, and exposes the result to the theme's layout.html. cffconvert (Python, CLI and importable) converts CFF to BibTeX, APA-like, RIS, EndNote, CodeMeta, Zenodo JSON and schema.org JSON. Important caveat: it does not convert the references or preferred-citation keys — which matters directly, because the files proposed in #342 lean on preferred-citation to point at the published book.
Our repos right now
None of lecture-python.myst, lecture-python-advanced.myst, lecture-jax, lecture-datascience.myst, lecture-julia.myst, quantecon-theme.mystmd or quantecon-book-theme has a CITATION.cff. QuantEcon.py does, and gets the GitHub sidebar button for free as a result.
The gap
Generation is solved on the MyST side and absent on the Sphinx side. Presentation is unsolved on both. The thing Simon actually suggested — a reader-facing control that yields a correct citation in the format they want — is theme work in both stacks, and no upstream component exists to drop in.
Proposed scope
quantecon-theme.mystmd — add a "Cite this" control to the project header. app/components/ProjectFrontmatter.tsx is the natural home, alongside the author list and the last-changed control. Two candidate sources: build the formats client-side from the frontmatter the theme already receives, or read a generated CITATION.cff. Frontmatter-driven is preferable — it works for every project using the theme without each repo having to ship or regenerate a file.
quantecon-book-theme — the equivalent control for the JB1 sites, which needs the Sphinx extension described above (CFF in, converted formats out, injected into layout.html).
Upcoming book theme and community-lecture theme — build the same component in from the start, as part of the theme baseline rather than a later retrofit.
A shared spec first — agree the fields, the formats offered, and where the control lives before either implementation starts, so the two stacks do not diverge in wording or placement.
Open questions
Source of truth.Decided: the committed CITATION.cff is the source of truth, because it integrates with GitHub directly at the repo level and lines up with Add citation support (CITATION.cff) across book-* repositories #342. See the comment below for what that means for each stack.
Which formats. BibTeX and APA cover most of the audience; RIS adds Zotero/Mendeley/EndNote import; the raw .cff is cheap to include. Anything beyond that is probably noise.
What are we citing.Decided: it depends on document type. A book cites as a whole work; a lecture series is better cited per page, since readers reference an individual lecture rather than the series. So the control's behaviour is keyed off document type rather than being one fixed shape. See the comment below.
DOIs. Worth minting Zenodo DOIs for the lecture series (as QuantEcon.py does), so the citation resolves to something permanent? That decision is upstream of the theme work.
Machine-readable metadata. Should the same metadata also emit schema.org JSON-LD and/or Google Scholar <meta> tags, so the sites are indexable as scholarly works? Cheap to add once the data is in the theme.
Background
Suggestion out of a conversation with Simon Scheidegger about the Deep Learning for Solving and Estimating Dynamic Economic Models course site (itself a MyST site): our published lecture sites should hand the reader a ready-made citation — driven by a
CITATION.cffin the repo, and surfaced on the site in a range of formats (BibTeX, APA, RIS, and the raw.cff).#342 already covers adding
CITATION.cfffiles to thebook-*repos so GitHub renders its "Cite this repository" sidebar button. This issue is the other half of the same idea: what the themes do with that metadata, so a reader landing on the published site never has to go to GitHub to work out how to cite it. Scope isquantecon-theme.mystmd,quantecon-book-theme, and the upcoming book and community-lecture themes.What exists today
mystmd (and therefore Jupyter Book ≥ 2)
Jupyter Book 2 is built on the MyST engine, so whatever mystmd offers is what JB2 offers.
CITATION.cfffrommyst.ymlcffexport target, landed inmyst-cli1.3.3 (Aug 2024) via jupyter-book/mystmd#1397CITATION.cffintomyst.yml@myst-themepackages we consumeThe export is declared in project frontmatter, and
myst build --cffwrites the file from project (or page) frontmatter — authors, title, DOI, license, abstract — through thecffjslibrary. CFF fields that have nomyst.ymlequivalent go in the export block:Two consequences worth noting. First, the direction is one-way —
myst.ymlis the source of truth and the.cffis a build artifact; jupyter-book/mystmd#2401 is the upstream issue to watch if we would rather make the.cffcanonical and havemyst.ymlextend from it. Second, because the export produces a real file with anid:, it can be referenced from the site'sdownloads:config — so a MyST site can already offerCITATION.cffas a download with no theme change at all. That gets us the raw file, not the "pick your format" experience.Jupyter Book 1 (Sphinx) —
quantecon-book-themeThere is no
CITATION.cffsupport anywhere in the JB1 stack. Citation support in JB1 meanssphinxcontrib-bibtex— the{cite}role and a{bibliography}directive over a.bibfile — which is about citing other works from within the text, not about how to cite the lecture series itself. Neithersphinx-book-themenorpydata-sphinx-themeships a "cite this" component.So everything on this side is ours to build: a small Sphinx extension that reads
CITATION.cfffrom the repo root, converts it, and exposes the result to the theme'slayout.html.cffconvert(Python, CLI and importable) converts CFF to BibTeX, APA-like, RIS, EndNote, CodeMeta, Zenodo JSON and schema.org JSON. Important caveat: it does not convert thereferencesorpreferred-citationkeys — which matters directly, because the files proposed in #342 lean onpreferred-citationto point at the published book.Our repos right now
None of
lecture-python.myst,lecture-python-advanced.myst,lecture-jax,lecture-datascience.myst,lecture-julia.myst,quantecon-theme.mystmdorquantecon-book-themehas aCITATION.cff.QuantEcon.pydoes, and gets the GitHub sidebar button for free as a result.The gap
Generation is solved on the MyST side and absent on the Sphinx side. Presentation is unsolved on both. The thing Simon actually suggested — a reader-facing control that yields a correct citation in the format they want — is theme work in both stacks, and no upstream component exists to drop in.
Proposed scope
quantecon-theme.mystmd— add a "Cite this" control to the project header.app/components/ProjectFrontmatter.tsxis the natural home, alongside the author list and the last-changed control. Two candidate sources: build the formats client-side from the frontmatter the theme already receives, or read a generatedCITATION.cff. Frontmatter-driven is preferable — it works for every project using the theme without each repo having to ship or regenerate a file.quantecon-book-theme— the equivalent control for the JB1 sites, which needs the Sphinx extension described above (CFF in, converted formats out, injected intolayout.html).Open questions
Source of truth.Decided: the committedCITATION.cffis the source of truth, because it integrates with GitHub directly at the repo level and lines up with Add citation support (CITATION.cff) across book-* repositories #342. See the comment below for what that means for each stack..cffis cheap to include. Anything beyond that is probably noise.What are we citing.Decided: it depends on document type. A book cites as a whole work; a lecture series is better cited per page, since readers reference an individual lecture rather than the series. So the control's behaviour is keyed off document type rather than being one fixed shape. See the comment below.QuantEcon.pydoes), so the citation resolves to something permanent? That decision is upstream of the theme work.<meta>tags, so the sites are indexable as scholarly works? Cheap to add once the data is in the theme.preferred-citation. If we adopt the Add citation support (CITATION.cff) across book-* repositories #342 pattern (repo metadata pluspreferred-citationfor the published book), the Sphinx converter needs to handle a keycffconvertskips.Task list
CITATION.cffreader as a build-time MyST transform plugin, followingplugins/git-metadata.mjsget_git_last_modifiedinquantecon-book-thememyst.yml(upstreamextends, or a local pre-build config fragment)quantecon-theme.mystmdCITATION.cff, plus the control inquantecon-book-themeCITATION.cffto the lecture repos, coordinated with Add citation support (CITATION.cff) across book-* repositories #342 for thebook-*repos