On Sat, Mar 04, 2017 at 07:44:52AM +0200, Jori Mäntysalo wrote:
> On Fri, 3 Mar 2017, Thierry wrote:
>
> >that we should propose a solution or some hints. However, the solution
> >should not be readable at the first look of the page, but still accessible
> >by the user.
>
> Did we already have a discussion about this? HTML manual could have for
> example ALGORITHM-part "hidden", and maybe some larger code snippets
> available behind a click and so on.
Sure, this kind of folding could deserve such purposes as well. But i am
not sure there is some development done in that direction.
Actually, on some old rst tutorials i have, there is a %hide thing that
hides the code block, typically to hide some @interact internals. It looks
like this:
sage: %hide
sage: var('x')
sage: @interact
sage: def g(f=sin(x), c=0, n=(1..30),
... xinterval=range_slider(-10, 10, 1, default=(-8,8),
label="x-interval"),
... yinterval=range_slider(-50, 50, 1, default=(-3,3),
label="y-interval")):
... x0 = c
... degree = n
... xmin,xmax = xinterval
... ymin,ymax = yinterval
... p = plot(f, xmin, xmax, thickness=4)
... dot = point((x0,f(x=x0)),pointsize=80,rgbcolor=(1,0,0))
... ft = f.taylor(x,x0,degree)
... pt = plot(ft, xmin, xmax, color='red', thickness=2, fill=f)
... show(dot + p + pt, ymin=ymin, ymax=ymax, xmin=xmin, xmax=xmax)
... html('$f(x)\;=\;%s$'%latex(f))
... html('$P_{%s}(x)\;=\;%s+R_{%s}(x)$'%(degree,latex(ft),degree))
However, is seems to be sagenb specific, and reserved to code blocks.
I would like to have something at the document level (not code block), like a
new sphinx directive, e.g.
{{{
.. FOLDED_TOPIC:: Answer to exercise
Some hidden text.
::
sage: print('this is some hidden computation')
Some still hidden text
Some clear text (we left the FOLDED_TOPIC directive).
}}}
And then i would like rst2ipynb to understand that as well so as to produce
jupyter notebooks with simila feature.
Ciao,
Thierry
> --
> Jori Mäntysalo
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.