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

[Discussion]: Allow headings anywhere that block-level items can exist #43

Open
vhyrro opened this issue Aug 17, 2024 · 1 comment
Open

Comments

@vhyrro
Copy link
Member

vhyrro commented Aug 17, 2024

This is less of a proposal and more of a call for discussion.

In the current 1.0 syntax, headings are special in that they are called "structural". This means they cannot be placed in areas like:

  • The content of lists
  • The content of long-form definitions

Somewhat counterintuitively, I believe it may be beneficial to allow headings everywhere and not stress it as much as we currently do. This provides the following benefits:

  • Parsing is much simpler, as a single "block" node can be defined which can contain all block-level syntax.
  • Headings become much easier to embed within standard ranged tags (e.g. |example)

Recall #35, where I propose that Norg syntax should not be bothered with typesetting. I believe this should also translate over conceptually to headings by freeing them from the artificial limitation of existing only in the top level of the document.

@boltlessengineer
Copy link

boltlessengineer commented Aug 18, 2024

instant thoughts:

  • heading in the top level of the document will "structure" the document (by consuming all blocks below it)
  • headings can be nested as before
  • headings not at top level of the document won't consume the blocks below it.

If I can rename the word section to heading as I suggested before, I think new syntax seems more clear.

  • a "section" consists of a heading and all blocks (except headings because they will start another section) below it
  • a section can only exist in top level of the document
  • a "heading" is made up of * prefix followed by single-line paragraph (called "title", If only we can say it is just a paragraph...)
  • a heading can have a level but doesn't have any meaning by itself
  • the level of a section is determined by the level of its associated heading.
* a heading         <- start point of section-1 (level 1)

blocks...

**** a sub heading  <- start point of section-1.1 (level 2)

blocks...
                    <- end point of section-1.1, section-1
* another heading   <- start point of section-2 (level 1)
> * heading <- we can put a heading inside quote, but this won't make a "section"

paragraph   <- so this doesn't belong to the quote

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

2 participants