#11815: Embedding information in doc strings must not be formatted
-----------------------------------------+----------------------------------
Reporter: SimonKing | Owner: jason
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.7.2
Component: misc | Keywords: embedding format
Work_issues: skip empty leading lines. | Upstream: N/A
Reviewer: | Author: Simon King
Merged: | Dependencies: #9976 #11287 #11298
#11342
-----------------------------------------+----------------------------------
Changes (by SimonKing):
* status: needs_work => needs_review
Comment:
I updated the patch, and there is now a new doc test:
{{{
sage: cython_code = ["def testfunc(x):",
... " '''",
... " nodetex",
... " This is a doc string with raw latex",
... "",
... " `x \\geq y`",
... " '''",
... " return -x"]
sage: cython('\n'.join(cython_code))
sage: from sage.misc.sageinspect import sage_getdoc
sage: print sage_getdoc(testfunc)
<BLANKLINE>
This is a doc string with raw latex
<BLANKLINE>
`x \geq y`
<BLANKLINE>
}}}
The trick is to strip leading empty lines (after the embedding
information), and also to strip blank space around the directives.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11815#comment:10>
Sage <http://www.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.