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

Allow use category id as heading's id #66

Merged
merged 2 commits into from
Jun 19, 2023

Conversation

YDX-2147483647
Copy link
Contributor

@YDX-2147483647 YDX-2147483647 commented May 11, 2023

What kind of change does this PR introduce?

  • Bugfix
  • New Feature
  • Feature Improvement
  • Refactoring
  • Documentation
  • Other, please describe:

Description:

This PR add a configuration category_heading. It determines how categories headings are generated.

  • If simple, headings will be ## Category, and IDs are set by GitHub. (Same as current version)
  • If robust, headings will be <h2 id='category-id'>Category</h2>.

Resolves #65

TOC relies on these IDs. If all of categories' names are ASCII, simple is OK. Otherwise, GitHub may slugify the title into something unexpected (e.g. 🌎GlobeGlobe but ⚒️Hammer%EF%B8%8FHammer), and links in TOC will be broken.

I've also introduced an (internal & unused) BREAKING change: title_md_prefix: str = "##"heading_level: int = 2. As you can see, title_md_prefix can't describe <h2>.

Checklist:

  • I have read the CONTRIBUTING document.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

Add config `category_heading`.

Resolves best-of-lists#65
@github-actions github-actions bot added the documentation Changes to documentation label Jun 18, 2023
Copy link
Member

@LukasMasuch LukasMasuch left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@LukasMasuch LukasMasuch merged commit b1ebce4 into best-of-lists:main Jun 19, 2023
1 of 2 checks passed
@YDX-2147483647 YDX-2147483647 deleted the category_heading branch June 19, 2023 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Changes to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-English category causes invalid markdown link
2 participants