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

Support UnitRange for Depth configuration in at-contents block #1890

Merged
merged 3 commits into from
Jul 30, 2022

Conversation

fredrikekre
Copy link
Member

@fredrikekre fredrikekre commented Jul 27, 2022

This patch adds support for MinDepth in at-contents for specifying
the minimum header level depth that should be shown, similar to Depth.
This is useful mostly for single-page content blocks, since you can then
filter out the superfluous level 1 header.

Edit by @mortenpi: close #245

docs/src/man/syntax.md Outdated Show resolved Hide resolved
Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not opposed to a new option either, but what do you think about allowing UnitRanges to Depth instead for this? Refs: #245 and #1125.

docs/src/man/syntax.md Outdated Show resolved Hide resolved
@fredrikekre
Copy link
Member Author

Not opposed to a new option either, but what do you think about allowing UnitRanges to Depth instead for this?

Ah, forgot about that. Yea that should be fine (although you will have to look up the default max depth even when you only want to change the default min).

This patch adds support for passing `UnitRange`s to the `Depth` setting
in `at-contents`. This makes it possible to also limit the minimum
header level that should be included. `Depth = 2:3` would include only
headers with level 2-3, and exclude, in particular, level 1.

Fixes #245.
@mortenpi mortenpi changed the title Add MinDepth configuration to at-contents block Support UnitRange for Depth configuration to at-contents block Jul 29, 2022
@mortenpi mortenpi changed the title Support UnitRange for Depth configuration to at-contents block Support UnitRange for Depth configuration in at-contents block Jul 29, 2022
Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment, but LGTM!

src/Documents.jl Outdated Show resolved Hide resolved
docs/src/man/syntax.md Outdated Show resolved Hide resolved
Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
@fredrikekre fredrikekre merged commit ebe2f97 into master Jul 30, 2022
@fredrikekre fredrikekre deleted the fe/mindepth branch July 30, 2022 14:28
@fredrikekre
Copy link
Member Author

cc @NHDaly (since you started on this feature in #1125 you might be interested)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use UnitRange for Depth in @contents block
2 participants