#6892: [with patch, needs review] change dollar signs to backticks
---------------------------+------------------------------------------------
Reporter: jhpalmieri | Owner: jhpalmieri
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.1.2
Component: documentation | Keywords:
Reviewer: | Author: John Palmieri
Merged: |
---------------------------+------------------------------------------------
In [http://groups.google.com/group/sage-
devel/browse_thread/thread/8fa0d854b6928f2b?tvc=2 a discussion on sage-
devel], people thought it was a good idea to allow the use of dollar
signs, not just backquotes, to delimit math in Sage docstrings. The
attached patch does this. It does this by working with the autodoc
extension to Sphinx: autodoc reads the docstring, which then gets
processed by the new function {{{process_dollars}}}, which does various
regular expression search-and-replacements.
Consequences of this: if you want to use a literal dollar sign in a
docstring, you have to escape it with a backslash. If you have some
complicated math with lots of nested math/text constructions like
"\text{blah $x=y$ blah}", this might screw up. It will handle one
nesting, turning
{{{
$f(x) = \text{zero if $x$ is prime}$
}}}
into
{{{
`f(x) = \text{zero if $x$ is prime}`
}}}
and leaving
{{{
`f(z) = \text{two if $z$ is an integer}`
}}}
unchanged; these should be processed correctly by both the html and pdf
documentation builders.
The patch also changes some docstrings: either fixing minor misformattings
which I noticed while testing this, or fixing things which break (like a
docstring with a math environment with a missing closing dollar sign) when
dollar signs are converted to backquotes.
Seems to work with Sphinx versions 0.5.1 (currently included in Sage) and
0.6.3 (see #6586).
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6892>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---