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

[REQ] Differentiate between headings and sections #36

Open
mhatzl opened this issue Aug 19, 2023 · 1 comment
Open

[REQ] Differentiate between headings and sections #36

mhatzl opened this issue Aug 19, 2023 · 1 comment

Comments

@mhatzl
Copy link
Contributor

mhatzl commented Aug 19, 2023

Unimarkup has markup to create headings, and these headings are then considered as document sections.
However, not every heading should be a section (e.g. headings in quotation blocks).

It should be clearly defined when a heading is considered a section.
Besides this differentiation, users should also have the option to exclude sections from the ToC.

Headings in the following contexts should not be considered as sections:

  • Inside any indented block (e.g. quotation blocks and lists)
  • Inside Tables
  • Inside verbatim blocks
  • Inside verbatim block inserts
  • Inside block decorations
  • Inside math blocks

It would probably be useful to have a field block that prevents headings from being considered as sections.
This gives users more freedom if the above restrictions are not enough.
The field block name could be something like no-sections.

Headings in text blocks and columns should be considered as sections, because these block elements are commonly used for document layout.

Examples:

[[[
# This is a section heading

> # This is no section

- Some list

  # Neither is this

```
# Nor this
```
]]]
@mhatzl
Copy link
Contributor Author

mhatzl commented Aug 19, 2023

If possible, headings inside hidden elements should also not be considered as sections.

Caveat: This might be hard to implement.

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