Bug 431693 - Foldable sections in markdown files
Summary: Foldable sections in markdown files
Status: ASSIGNED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-16 14:45 UTC by Robert Riemann
Modified: 2023-09-30 17:58 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 :(