Skip to content

Folding for semi-structured text documents like markdown (in UDL or otherwise) #9473

@wyattscarpenter

Description

@wyattscarpenter

Description of the Issue

I'm trying to implement in UDL code folding for what I'll call semi-structured text documents, like markdown, and it's becoming apparent to me that this is impossible in User Defined Language.

For instance, what I would like is that in a markdown document with headers

# This
## And
## That
### Also
### Like
### These
## Oho
### Aha!

folding on # This would fold the entire document (as there is no other single #), ## And would fold up to ## That, ## That would fold up to ## Oho, etc. Basically, every header would also fold the text in its subheaders, right up to the next header of equal precedence.

The problem as it now stands is you cannot specify that # should open a fold section yet also close the previous one. Specifying, say, ## as both open and close just makes any ## fold the entire rest of the document. We need clopen operators.

Now, while code folding in markdown would be nice-- and could perhaps be hardcoded-- I would also like code folding for my bespoke format ("Numbered Sections"?), which is like

1. Introduction
1.1. Preamble
1.2. Disclaimer
2. The Beginning

So I would quite like a more expressive UDL system where I can express this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    udlEverything related to User Defined Language

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions