Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Added slugified ids to md headers #1402

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Minenash
Copy link
Contributor

@Minenash Minenash commented Oct 6, 2023

Fixes modrinth/code#1677

ID naming method:

  • Trims and Lowercases
  • Removes diacritics and split characters like ffi
  • Replace ./_,:; with -
  • Remove non a-z0-9- or space
  • Collapse whitespace and replace with -
  • Collapse dashes

Why draft:

  • This only works with md style headers, don't know how to auto add it to <h#> headers. This is only a problem if this is added:
  • Maybe add a link icon that shows up on hover that when clicked copies the url to clipboard. Nice for users, helps project devs get the id of the header

This could be merged without addressing these two, and it could just be made into a separate issue for now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

Adding IDs to headings (Project description)
2 participants