Expand/Collapse in Doc Pane, Moving Hierarchical Content between Doc Pane and Grid

Submitted by jimspoon on 2025/03/30 14:26

I vaguely remembered that the Doc Pane had at least some "outlining" capabilities, so I searched and found this thread:

https://infoqubeim.com/drupal5/comment/25741

From this thread, and from experimenting in the Doc Pane,

(1) clicking on a heading toggles between an expanded and a collapsed state (I think I had that working).  Also I can right-click a heading and then click Expand/Collapse.

(2) when a heading is in a collapsed state, all headings and text below that heading, that is indented farther to the right, is hidden under that heading.

(3) the collapsed heading is followed by [...] to indicate the presence of hidden headings/text under the collapsed item

(4) headings and text at the same or higher indentation level as the higher heading will not be collapsed under that higher heading.

(5) HTML Heading level (H1, H2, H3 etc.) doesn't play any role in what is hidden.  So a H1 heading might be hidden under an H3 heading, so long as it is below the H3 heading and indented farther to the right than the H3 heading.

(6) Heading level (H1, H2, H3) is not changed by Alt+left or Alt+right, tab or shift-tab.

(7) Headings can't be reordered by alt+up/down.

(8) Headings can't be collapsed by Ctrl+1, 2 etc. or Shift+Ctrl+1, 2 etc. as in the grid.

All of this is OK - we wouldn't expect the Doc Pane to have the outlining capabilities of the Grid.  We have the Grid for that purpose.

I am very glad to have the capability to replicate a Grid hierarchy of items/subitems in the Doc Pane, by exporting and then pasting in the Doc Pane.  (Maybe a few steps could be eliminated with a right-click option.)

Since the Grid has superior capabilities for reordering items/subitems, what's the best way to move hierarchical content (headings etc) from the Doc Pane to the Grid for that purpose, replicating the Doc Pane "hierarchy" as a Grid hierarchy of Items/Subitems?  How about a "Convert to Item/Subitems" option?

Comments

Hi Jim

Mostly correct, except (5). H1..H6 do play a role in the expand/collapse (unless as you say it is indented, which I didn't think one could do)

Exporting a Doc pane to the grid while preserving the outline is on the wish list (including copy/paste and drag-drop). It isn't as easy as it seems. I may be able to re-use the HTML>Markdown code I wrote. I'll keep you posted

Did more testing - verified what you said, that the Doc Pane DOES collapse according to the HTML Heading level (H1, H2, H3 ... body text).  Which is the way you'd want it.  In my first testing I guess I messed that up by indenting the Headings.  So if you want the Headings to collapse properly, don't indent them.  😀

General Discussion