1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-27 01:33:39 +02:00

docs: improve git semver sorting pro warning

closes #5110
This commit is contained in:
Carlos Alexandro Becker 2024-09-03 19:57:07 -03:00
parent 00f237aa6e
commit edaf931ad1
No known key found for this signature in database
2 changed files with 13 additions and 4 deletions

View File

@ -35,6 +35,8 @@ git:
## Semver sorting
<!-- md:featpro -->
This allows you to sort tags by semver:
```yaml
@ -48,5 +50,3 @@ to oldest, so the latest tag is returned.
This has the effect of sorting non-pre-release tags before pre-release ones,
which is different from what other git sorting options might give you.
<!-- md:pro -->

View File

@ -17,6 +17,7 @@ def on_page_markdown(markdown: str, *, page: Page, config: MkDocsConfig, files:
args = args.strip()
if type == "version": return _version_block(args)
elif type == "pro": return _pro_ad(page, files)
elif type == "featpro": return _pro_feat_ad(page, files)
elif type == "templates": return _templates_ad()
# Otherwise, raise an error
@ -28,11 +29,19 @@ def on_page_markdown(markdown: str, *, page: Page, config: MkDocsConfig, files:
replace, markdown, flags = re.I | re.M
)
def _pro_feat_ad(page: Page, files: Files):
return "".join([
f"<div class=\"admonition example\">",
f"<p class=\"admonition-title\">GoReleaser Pro</p>",
f"<p>This feature is exclusively available with <a href=\"/pro/\">GoReleaser Pro</a>.</p>",
f"</div>"
])
def _pro_ad(page: Page, files: Files):
return "".join([
f"<div class=\"admonition example\">",
f"<p class=\"admonition-title\">GoReleaser Pro</p>",
f"<p>One or more features are available only with <a href=\"/pro/\">GoReleaser Pro</a>.</p>",
f"<p>One or more features are exclusively available with <a href=\"/pro/\">GoReleaser Pro</a>.</p>",
f"</div>"
])
@ -43,6 +52,6 @@ def _templates_ad():
return "".join([
f"<div class=\"admonition tip\">",
f"<p class=\"admonition-title\">Tip</p>",
f"<p>Learn more about the <a href=\"/customization/templates/\">name template engine</a>.</p>",
f"<p>Discover more about the <a href=\"/customization/templates/\">name template engine</a>.</p>",
f"</div>"
])