Sectioning in workbook - polite feature request

24 views
Skip to first unread message

Kazimierz Kurz

unread,
Mar 20, 2012, 10:22:44 AM3/20/12
to sage-s...@googlegroups.com


Hello everybody!

Please consider to add for sage worksheet  the following feature:

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..

Thanks a lot!
Kazek Kurz

Jason Grout

unread,
Mar 20, 2012, 10:34:53 AM3/20/12
to sage-s...@googlegroups.com

Excellent suggestion. We've wanted this for a long time now. We
welcome anyone who wants to implement it.

Thanks,

Jason

P Purkayastha

unread,
Mar 20, 2012, 11:51:12 AM3/20/12
to sage-s...@googlegroups.com
This is almost possible for individual cells. There is a "%hide" which if put (without quotes) in the first line of a cell  hides the cell, except for showing only one line.  What it lacks is a nice button which can automate this procedure on the click of a button.

The notebook interface has many hidden and nice features. The css and js in the notebook definitely deserves an upheaval to make these hidden features visible to a user.

Keshav Kini

unread,
Mar 20, 2012, 12:40:14 PM3/20/12
to sage-s...@googlegroups.com
Jason Grout <jason...@creativetrax.com> 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?

-Keshav

----
Join us in #sagemath on irc.freenode.net !

Jason Grout

unread,
Mar 20, 2012, 1:47:34 PM3/20/12
to sage-s...@googlegroups.com


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

Reply all
Reply to author
Forward
0 new messages