Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion]: Multi line heading #51

Open
boltlessengineer opened this issue Jan 2, 2025 · 0 comments
Open

[Suggestion]: Multi line heading #51

boltlessengineer opened this issue Jan 2, 2025 · 0 comments

Comments

@boltlessengineer
Copy link

Commonmark supports setext headings which allows user to put multiple lines as heading content.

This is a
Setext Heading
==============

In this way, multi line heading has at least one line of spacer with multiple = characters and they cannot be used without this spacer line. ATX heading in Commonmark can only span one line, so it can be used without any spacer line.

# ATX Heading
This doesn't belong to heading

Implementation

* Multi line
  Heading Title

  This is not a heading

* Single line Heading *
  This is not a heading

We can have similar syntax by specifying heading title as a paragraph and introducing heading closing modifier. Now you can use *\n to explicitly end the heading title.

Frame 2

This allows both heading and paragraph divided by line and *heading spanning only one line (no spacer line between) in same grammar base, which is way better than CommonMark's implementation.

You can think this syntax as a block style heading used in many programming langauges' comment section.

//// heading in comments ////
*** level 3 heading in Norg ***

As we already defined the level in heading prefix, suffix characters can repeated in any amount of times (including 0!)

Examples

Here is a list of valid syntax with this rule:

* Lv 1 Heading ******
Paragraph

****** Lv 6 Heading *
Paragraph


* Heading
  in
  multiple
  line *
  Paragraph
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant