Skip to content

Feature request: Please support custom slug/anchor/id definition #1529

@GruberMarkus

Description

@GruberMarkus

Proposal

Please support custom slug/anchor/id definition. Example:

# This is my heading {#this-is-my-own-slug}

Currently, custom slugs are not supported, resulting in the following TOC:

- [1. This is my heading {#this-is-my-own-slug}](#1-this-is-my-heading-this-is-my-own-slug)

# 1. This is my heading {#this-is-my-own-slug}

If custom slugs were supported, the TOC would look like this:

- [1. This is my heading](#this-is-my-own-slug)

# 1. This is my heading {#this-is-my-own-slug}

Other information

This can be very useful in multiple cases, for examle:

  • Having one site in idfferent languages, but with the same slugs/anchor/ids allows to stay in the same region of the document when switching between languages manually or automatically.
  • Creating slugs which are shorter than the whole text of the heading, or totally differ from it

At least pandoc, kramdown, Hugo and Jekyll support custom slugs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions