1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
[build-system]
requires = ["hatchling", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"
[project]
name = "my-pkg"
version = "1.0"
dynamic = ["readme"]
[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
text = '''# Level 1 Header
This is *Markdown* in a literal string.
Let's import `AUTHORS.md` without its header and last paragraph next:
'''
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "AUTHORS.md"
start-after = "Authors\n"
end-before = "A full"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
text = """
---
Now let's add an extract from [`tests/example_changelog.md`](https://github.com/hynek/hatch-fancy-pypi-readme/blob/main/tests/example_changelog.md):
"""
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "tests/example_changelog.md"
pattern = "<!-- changelog follows -->\n\n\n(.*?)\n\n## "
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
text = "\n---\n\nPretty **cool**, huh? ✨"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
pattern = "#(\\d+)"
replacement = "[#\\1](https://github.com/hynek/hatch-fancy-pypi-readme/issues/\\1)"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
replacement = '[\1](https://github.com/hynek/hatch-fancy-pypi-readme/tree/main/\g<2>)'
|