Skip to content

Per-snippet auto dedent #2217

@freya022

Description

@freya022

Description

While the "Dedent subsections" feature is nice to extract code that don't need the entire context around it, it requires all snippets to be dedented, which then causes issues elsewhere.

For now, my workaround is to just put a stripped down version of the code surrounding it, but this goes against the idea that the snippets are maintained elsewhere, not in the wiki itself.

Benefits

This would allow to select which snippets get dedented while not affecting other snippet

Solution Idea

I think that the existing global option would dedent all snippets, but not using the global option would let the user decide on each snippet, by adding an auto_dedent next to the snippet lines/section

Example: --8<-- "https://github.com/freya022/BotCommands/raw/3.X/examples/src/main/kotlin/io/github/freya022/bot/commands/slash/SlashBan.kt:declare_aggregate-kotlin_dsl:auto_dedent"

Metadata

Metadata

Assignees

No one assigned

    Labels

    P: maybePending approval of low priority request.T: featureFeature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions