Repository navigation
Conversation
added 2 commits
September 25, 2026 17:18
…e don't break sphinx
…the associated issues.
krzywon
reviewed
Sep 28, 2026
krzywon
left a comment
Collaborator
There was a problem hiding this comment.
Code seems fine. Functionality not tested.
There was a problem hiding this comment.
No quality gates enabled for this code.
See analysis details in CodeScene
Quality Gate Profile: Custom Configuration
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
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.
Generate an html file from the plugin docstring and view it with a web browser. The same technique can also be used to view .rst files from the doc directory.
This renders with the lightweight docutils reStructuredText interpreter without all the extensions available to sphinx so not everything works perfectly.
Test using:
I was able to render every builtin model with only minor difficulties. I found several nitpicks with docstrings, which I fixed in #762. Similarly for most of the .rst files for sasview/sasmodels/sasdata.
Rendering is good enough for rapid debugging of both the reStructuredText markup and the LaTeX markup.
Known issues:
(:func: :mod: :class: ...)and roles(:ref: :numref: :eq: ...)are stubbed out.I was not able to use the Sphinx css directly because the tag structure generated by docutils is somewhat different from that generated by sphinx [I should probably have included more of the stylesheet]I'm now using the full stylesheet, but it is copied from sphinx so it will still drift from sphinx over time.
:nowrap:and:label:. These are automatically stripped before rendering.:nowrap:will fail because docutils puts it in a surrounding\begin{align*}...\end{align*}environment. The begin and end align environment macros are also stripped before rendering.cylinder_angle_definitionwhich appears in the inventory for the sasmodels docs. If we install the package with thedoc/_build/html/objects.invfile then we can resolve the links (and report if the link is broken).python -m sphinx.ext.intersphinx doc/_build/html/objects.inv ... std:label ... correlation-length correlation_length : model/correlation_length.html#correlation-length cylinder : model/cylinder.html#cylinder cylinder-angle-definition Angles \theta and \phi orient the cylinder relative to the beam line: model/cylinder.html#cylinder-angle-definition dab : model/dab.html#dab ellipsoid : model/ellipsoid.html#ellipsoid ellipsoid-comparison-2d Comparison of the intensity for uniformly distributed ellipsoids: model/ellipsoid.html#ellipsoid-comparison-2d ...Produce a header/footer using the intersphinx links which looks something like:SasView 6.2.0 documentation » SasView User Documentation » Model Functions ... modules | index
I've hard-coded the links to sasview docs in the header and footer. I'm pointing next and previous to the models page as well. I'm not building an index for all the plugins for this PR.
Change html generator to reproduce the sphinx div structure so we can use the css templates directly. This also gives us a mechanism to inject the headers and footers for the objects inventory.I've hard-coded the structure for the classic theme. Supporting arbitrary themes will require jinja2 with the sphinx templates and variables.
[Note: This structure is defined by
sphinx/themes/basic/layout.html. A general solution to dynamic docs would need to render from the same template used to make the css. That way our generated docs would always follow the same theme.]TODO
extensions = [..., "sasmodels.sphinx.dollarmath", ...]