Bug 431693

Summary: Foldable sections in markdown files
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: Robert Riemann <robert>
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: ASSIGNED ---    
Severity: wishlist CC: cullmann, justin.zobel, nibgonz, walter.von.entferndt
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Robert Riemann 2021-01-16 14:45:02 UTC
Dear all,

for people dealing with long markdown files or markdown files with heavy use of headlines, it would be nice if the kate folding feature could be used to temporarily hide the text under a headline until the next headline of the same order.

Maybe sub-lists could also be folded to hide all but the first item and their sub items.

I use markdown for note taking and would certainly benefit from such a comfort feature in katepart apps. :)

Have a nice day!
Rob
Comment 1 Bug Janitor Service 2021-03-21 01:17:56 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/179
Comment 2 Nibaldo G. 2021-03-21 01:20:14 UTC
For headers this is very easy to implement, in fact, in the AsciiDoc highlighter the section titles are folded.

However, for the following header formats there are problems:

Title H1
========

Subtitle H2
-----------

Mainly, there are problems determining whether "--------" corresponds to a horizontal line or a section title. Also the fold should start with "====" or "----", so the title text will be left out of the fold.

Adding folding to lists is also difficult. To highlight the content of the lists we capture the indentation using dynamic rules, but it isn't possible to determine the level of the lists :(