[WIP] Docs: improve parameter formatting using custom Sphinx domain#6639
Open
eebasso wants to merge 95 commits intoBLAST-WarpX:developmentfrom
Open
[WIP] Docs: improve parameter formatting using custom Sphinx domain#6639eebasso wants to merge 95 commits intoBLAST-WarpX:developmentfrom
eebasso wants to merge 95 commits intoBLAST-WarpX:developmentfrom
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
… docs-flexvar-extension
… single backticks in each RST document
…`<species_name>`` becomes `\ <species_name>` which renders as an empty title
for more information, see https://pre-commit.ci
… docs-flexvar-extension
…o docs-flexvar-extension
RemiLehe
reviewed
Mar 31, 2026
| "kg": ["kilogram", "kilograms"], | ||
| "V": ["volt", "volts"], | ||
| "eV": ["electronvolt", "electronvolts", "electron volt", "electron volts"], | ||
| "T": ["Telsa", "Telsas"], |
Member
There was a problem hiding this comment.
Suggested change
| "T": ["Telsa", "Telsas"], | |
| "T": ["Tesla", "Teslas"], |
Member
There was a problem hiding this comment.
Btw, is this case sensitive? What happens if a user types "tesla"
Member
There was a problem hiding this comment.
Just want to comment that a "user" in this context would be a contributor, correct? I think it's fair to request that contributors follow contributing guidelines (which in this case could include "write units in formulas when adding an input parameter to the documentation").
This is what I was trying to communicate during the meeting, as an alternative solution to over-engineering guardrails against variations of inputs, typos, etc. - alternative that relies on contributors following contributing guidelines and reviewers enforcing them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a custom Sphinx domain for documenting parameters. Supports names containing characters like <, >, /, commas, etc.
This PR is inspired by the AMReX documentation of runtime parameters, which uses the Sphinx Python domain directive
py:datain RuntimeParameters.rst. However, this fails for invalid Python variable names such as<species_name>.xmin,ymin,zminthat commonly occur in the WarpX documentation.This domain solves that problem and allows use of parameter names such as
<species_name>.xmin,ymin,zminthat do not work with the standard Sphinx Python domain.The options of the
fv:vardirective build on the standard proposed by #6576This is how the Simulation Time section rendered: