From 407f3fb994b6c79d7a8d811b3408581803ad7410 Mon Sep 17 00:00:00 2001 From: Aaron Lauterer Date: Mon, 9 Nov 2020 15:59:37 +0100 Subject: [PATCH] scanrefs: remove term prefix from title It can happen, that a title is defined as term in the following way: :term:`My title` This patch checks for it and strips the leading part and the last `. Signed-off-by: Aaron Lauterer --- docs/_ext/proxmox-scanrefs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/_ext/proxmox-scanrefs.py b/docs/_ext/proxmox-scanrefs.py index 58176fe5..8de17620 100644 --- a/docs/_ext/proxmox-scanrefs.py +++ b/docs/_ext/proxmox-scanrefs.py @@ -93,6 +93,9 @@ class ReflabelMapper(Builder): logger.info('traversing section {}'.format(title.astext())) ref_name = getattr(title, 'rawsource', title.astext()) + if (ref_name[:7] == ':term:`'): + ref_name = ref_name[7:-1] + self.env.online_help[labelid] = {'link': '', 'title': ''} self.env.online_help[labelid]['link'] = "/docs/" + os.path.basename(filename_html) + "#{}".format(labelid) self.env.online_help[labelid]['title'] = ref_name