To fix the following exception one gets with the Sphinx and Python
versions from Trixie:
File "/home/tom/sources/others/pbs/proxmox-backup/build/docs/_ext/proxmox-scanrefs.py", line 92, in write_doc
filename_html = re.sub('.rst', '.html', filename)
File "/usr/lib/python3.13/re/__init__.py", line 208, in sub
return _compile(pattern, flags).sub(repl, string, count)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got '_StrPath'
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
If the ref is named the same as the headline (once normalized), sphinx
will return a 'idX' value in node['ids'][1] which we use for the label
ID. The headline is always present at index 0.
Checking for that and using index 0 in case we do get a 'idX' helps us
to avoid using the 'idX' as keys in our OnlineHelpInfo.js and actually
use the intended key.
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
This is a temporary hack until we find a sensible way to scan the
proxmox-widget-toolkit JS files as well.
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
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 <a.lauterer@proxmox.com>
previously it looked for the first instance. this behavior
became an issue while trying to add multiple onlineHelp buttons
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
goes through the sections in the documents and creates the
OnlineHelpInfo.js file from the explicitly defined section labels which
are used in the js files with 'onlineHelp' variable.