Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@YuriiMotov
Copy link
Member

Currently docs.py generate-readme command copies content from index.md and that document contains permalinks for headers.
Thus, these permalinks are displayed when people read README.md on GitHub: https://github.com/fastapi/fastapi?tab=readme-ov-file#sponsors--sponsors-

This PR modifies docs.py script to remove permalinks when README.md is generated

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2025

πŸ“ Docs preview for commit d8ffc5d at: https://b9ce87d1.fastapitiangolo.pages.dev

Copy link
Member

@tiangolo tiangolo left a comment

Choose a reason for hiding this comment

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

Excellent job, thanks @YuriiMotov! πŸ™Œ

site_path = Path("site").absolute()
build_site_path = Path("site_build").absolute()

header_with_permalink_pattern = re.compile(r"^(#{1,6}) (.+?)(\s*\{\s*#.*\s*\})\s*$")
Copy link
Member

Choose a reason for hiding this comment

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

Fancy RegEx! 🀯 😎

@tiangolo tiangolo merged commit 47acc62 into fastapi:master Sep 20, 2025
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants