mirror of
https://github.com/borgbackup/borg.git
synced 2026-02-18 18:19:16 -05:00
docs: fix broken :ref: references in man pages, fixes #7239
This commit is contained in:
parent
eb7502ee50
commit
f1ed09965f
2 changed files with 7 additions and 0 deletions
|
|
@ -178,6 +178,7 @@ Other changes:
|
|||
|
||||
- fix S3 url description, #9249
|
||||
- add a note that you need to install boto3 if you want to use S3/B2 URLs
|
||||
- man pages: fix broken :ref: references (e.g. borg_patterns), #7239
|
||||
|
||||
|
||||
Version 2.0.0b20 (2025-12-24)
|
||||
|
|
|
|||
|
|
@ -485,11 +485,17 @@ class BuildMan:
|
|||
from docutils.core import publish_string
|
||||
from docutils.nodes import inline
|
||||
from docutils.parsers.rst import roles
|
||||
from borg.archiver._common import rst_plain_text_references
|
||||
|
||||
def issue(name, rawtext, text, lineno, inliner, options={}, content=[]):
|
||||
return [inline(rawtext, "#" + text)], []
|
||||
|
||||
def ref_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
|
||||
replacement = rst_plain_text_references.get(text, text)
|
||||
return [inline(rawtext, replacement)], []
|
||||
|
||||
roles.register_local_role("issue", issue)
|
||||
roles.register_local_role("ref", ref_role)
|
||||
# We give the source_path so that docutils can find relative includes
|
||||
# as-if the document where located in the docs/ directory.
|
||||
man_page = publish_string(source=rst, source_path="docs/%s.rst" % name, writer=manpage.Writer())
|
||||
|
|
|
|||
Loading…
Reference in a new issue