On 3/20/12 12:40 PM, Keshav Kini wrote:
Jason Grout<[email protected]> writes:
Some parts of the worksheet may be hidden under "+" mark. It will be
section for example containing important computations of auxiliary
definitions tr objects which are not relevant to lecture, but required
to perform computations. User may then read the worksheet content
without interruptions on details, but while it is required, may click on
"+" sing and dive into it.
I think it would be very handy and elegant...
Maybe some of You will be able to add such feature..
Excellent suggestion. We've wanted this for a long time now. We
welcome anyone who wants to implement it.
This has long been a feature of Mathematica notebooks. Another one that
goes hand in hand with it (IMO) is the ability to group cells into a
tree-like hierarchy - you can then expand or contract entire subtrees
(say, corresponding to various sections of a document) with a single
click. Is that desirable for the Sage notebook as well? Is it even
possible without a change to the .sws file format or a weird hack?
Sure. How about just adding a bit of javascript code to add a little
expand/contract symbol next to any html heading that expands/contracts
the appropriate block. Then you could use TinyMCE to insert the
headings, and they would automatically inherit expand/collapse symbols.
So I tried this:
$("#worksheet").delegate("h1","click", function(event) {
$(this).nextUntil("h1").toggle();
});
It worked fine for collapsing things inside a single text cell, but
since all the html for a text cell is inside of a div, we need to be a
little trickier with how we collapse input cells and other elements of
other text cells.
Thanks,
Jason
--
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-support
URL: http://www.sagemath.org