11[project ]
22name = " yanki"
3- dynamic = [" version" ]
3+ dynamic = [" readme " , " version" ]
44description = " Build Anki decks from text files containing YouTube URLs."
55authors = [{name = " Daniel Parks" , email = " oss-yanki@demonhorse.org" }]
6- readme = " README.md"
76requires-python = " >= 3.11"
87license = " MIT OR Apache-2.0"
98license-files = [" LICENSE-*" ]
@@ -99,7 +98,7 @@ packages = ["yanki"]
9998path = " yanki/__version__.py"
10099
101100[build-system ]
102- requires = [" hatchling" ]
101+ requires = [" hatchling" , " hatch-fancy-pypi-readme " ]
103102build-backend = " hatchling.build"
104103
105104[tool .hatch .build .targets .sdist ]
@@ -111,3 +110,22 @@ include = [
111110 " /web-files" ,
112111 " /yanki" ,
113112]
113+
114+ [tool .hatch .metadata .hooks .fancy-pypi-readme ]
115+ content-type = " text/markdown"
116+ fragments = [{path = " README.md" }]
117+
118+ [[tool .hatch .metadata .hooks .fancy-pypi-readme .substitutions ]]
119+ # Remove GitHub only sections from README.md.
120+ pattern = ' (?s)<!-- GitHub only -->.+<!-- /GitHub only -->'
121+ replacement = ' '
122+
123+ [[tool .hatch .metadata .hooks .fancy-pypi-readme .substitutions ]]
124+ # Replace GitHub-specific [!TIP] syntax.
125+ pattern = ' \[!TIP\]'
126+ replacement = ' ### 💡 Tip'
127+
128+ [[tool .hatch .metadata .hooks .fancy-pypi-readme .substitutions ]]
129+ # Make links to package files absolute GitHub links.
130+ pattern = ' (?m)^(\[.+?\]):\s*((?!\w+:)\S+)'
131+ replacement = ' \1: https://github.com/danielparks/yanki/blob/v$HFPR_VERSION/\2'
0 commit comments