Add more citation support#33081
Conversation
The bibtex extension previously rendered inline citations only in author-year form, e.g. "Hansel et al. (2024)". On pages that cite many works by the same authors or year, these labels are hard to tell apart and difficult to match against the reference list. Add a global 'citation_style' option to the bibtex extension. The default, 'author-year', preserves the existing behavior exactly. Setting it to 'number' renders inline citations as bracketed numbers, e.g. "[1]", numbered in order of first citation, and reorders the reference list to match so that "[1]" always points to the first entry. Refs idaholab#22982 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The bibtex extension previously exposed only a "[BibTeX]" export in the references list, which serves LaTeX authors but not the many users who write in Microsoft Word or manage references with EndNote, Zotero, or Mendeley. Replace the per-entry "[BibTeX]" link with an "[Export]" modal that offers three formats: BibTeX (unchanged), RIS, and a plain-text reference string. RIS is the interchange format those non-LaTeX tools import; pybtex provides no RIS writer, so the common fields are mapped by hand. Refs idaholab#22982 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9fd0b6420f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
2744a5e to
de1257e
Compare
The RIS author export joined only last_names, dropping pybtex's prelast_names and lineage_names. Entries such as "van Genuchten, M. Th." were exported as "Genuchten, M. Th.", corrupting the metadata on import into reference managers. Include the particle in the family name and append the lineage as an RIS name suffix. Refs idaholab#22982 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Job Documentation, step Docs: sync website on 3a3078d wanted to post the following: View the site here This comment will be updated on new commits. |
|
Job Precheck, step Python: black format on fb30daa wanted to post the following: Python black formattingYour code requires style changes. A patch was generated and copied here. You can directly apply the patch by running the following at the top level of your repository: Alternatively, you can run the following at the top level of your repository: |
In 'number' style, !cite/!citet now prepend the author (e.g. "Slaughter et al. [1]") so textual citations read as part of the sentence, while !citep renders just the bracketed number. Previously every command produced a bare number, which reads poorly in running text. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The numbered-citation paragraph contained a bare [1], which the MooseDocs autolink extension resolves as a shortcut link to a page named "1", matching many files and failing every documentation build. Wrap it in backticks like the adjacent examples so it renders as literal text. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Job Coverage, step Generate coverage on 3a3078d wanted to post the following: Framework coverageMutiple base shas were found when retrieving head reports: Modules coverageCoverage did not change Full coverage reportsReports
This comment will be updated on new commits. |
cticenhour
left a comment
There was a problem hiding this comment.
A few adjustments to note.
- Move the !cite/!citep textual-vs-parenthetical usage notes out of the Configuration section and into Usage, covering both author-year and number styles. - Clarify that the citation examples render with the default author-year style used across the documentation website. - Give the RIS and Plain Text export blocks a 'language-none' class so Prism wraps them in its toolbar (Copy button and overflow scrolling), matching the BibTeX block; update the materialize gold to match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Job CUDA public apps on 3a3078d : invalidated by @kyriv-lab |
|
Job Test, step Results summary on 3a3078d wanted to post the following: Framework test summaryCompared against cdafd92 in job civet.inl.gov/job/3900932. No change Modules test summaryCompared against cdafd92 in job civet.inl.gov/job/3900932. No change |
|
Job Framework 2 on 3a3078d : invalidated by @kyriv-lab |
|
Job Coverage on 3a3078d : invalidated by @kyriv-lab |
This Pr resolves issue #22982 :
This PR enhances the MooseDocs bibtex extension, which renders citations on the MOOSE documentation website. Previously the extension supported only author-year inline citations and a static reference list. The PR adds two reader-facing capabilities and refines the documentation.
Numbered inline citation style. A new citation_style configuration option (author-year default, or number) controls how every in-text marker renders site-wide. In number mode, inline citations appear as bracketed numbers ([1], [2]) assigned in order of first appearance, and the reference list is reordered to match. This helps pages that cite many works by the same authors or year, where author-year labels collide. The textual/parenthetical distinction is preserved under both styles: !cite/!citet keep the author ("Slaughter et al. [1]" or "Slaughter et al. (2014)"), while !citep renders just the bracketed number ("[1]") or the parenthetical form ("(Slaughter et al., 2014)").
Citation export formats. Each entry in the reference list gains an [Export] modal offering the same citation in three machine-readable formats — BibTeX (for LaTeX), RIS (for Word/EndNote/Zotero/Mendeley), and plain text — so people who don't write in LaTeX can reuse MOOSE citations. Because pybtex has no RIS writer, RIS is produced by a hand-written bibtex_to_ris() with a BibTeX-to-RIS type map, preserving author name particles and suffixes. The three export blocks are each tagged with a language-* class so Prism wraps them consistently with a Copy button and contained side-scrolling (RIS and plain text use language-none, which gives the toolbar without syntax coloring).
Documentation. bibtex.md was updated so the !cite/!citep usage guidance lives in the Usage section (covering both styles) rather than buried in the configuration descriptions, the worked examples are clarified as rendering in the default author-year style used across the site, and a bare [1] was escaped to fix the doc build.
Testing and status. New tests in test_bibtex.py cover author-year rendering, the numbered style (textual, parenthetical, and reference ordering), RIS conversion (including LaTeX authors and name particles), and the export modal's three formats. The materialize gold fixture was regenerated to match. The bibtex page was built locally and verified against gold in both materialize and html forms; the work is committed and pushed to kyriv-lab/moose, with CIVET running.