Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: media: Allow creating cross-references for RC ABI

Now that Documentation/ABI is processed by automarkup, let it
generate cross-references for RC sysfs devnodes.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/7c2f9a9970a15df8b5e3a6ecd21bcedcc8881ce1.1739254867.git.mchehab+huawei@kernel.org

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
ff7ff6eb 83b02948

+14 -5
+13 -4
Documentation/sphinx/automarkup.py
··· 88 88 # Associate each regex with the function that will markup its matches 89 89 # 90 90 markup_func_sphinx2 = {RE_doc: markup_doc_ref, 91 - RE_abi_file: markup_abi_ref, 91 + RE_abi_file: markup_abi_file_ref, 92 92 RE_abi_symbol: markup_abi_ref, 93 93 RE_function: markup_c_ref, 94 94 RE_generic_type: markup_c_ref} 95 95 96 96 markup_func_sphinx3 = {RE_doc: markup_doc_ref, 97 - RE_abi_file: markup_abi_ref, 97 + RE_abi_file: markup_abi_file_ref, 98 98 RE_abi_symbol: markup_abi_ref, 99 99 RE_function: markup_func_ref_sphinx3, 100 100 RE_struct: markup_c_ref, ··· 279 279 return nodes.Text(match.group(0)) 280 280 281 281 # 282 - # Try to replace a documentation reference of the form Documentation/ABI/... 282 + # Try to replace a documentation reference for ABI symbols and files 283 283 # with a cross reference to that page 284 284 # 285 - def markup_abi_ref(docname, app, match): 285 + def markup_abi_ref(docname, app, match, warning=False): 286 286 stddom = app.env.domains['std'] 287 287 # 288 288 # Go through the dance of getting an xref out of the std domain ··· 294 294 295 295 # Kernel ABI doesn't describe such file or symbol 296 296 if not target: 297 + if warning: 298 + kernel_abi.log.warning("%s not found", fname) 297 299 return nodes.Text(match.group(0)) 298 300 299 301 pxref = addnodes.pending_xref('', refdomain = 'std', reftype = 'ref', ··· 318 316 return xref 319 317 else: 320 318 return nodes.Text(match.group(0)) 319 + 320 + # 321 + # Variant of markup_abi_ref() that warns whan a reference is not found 322 + # 323 + def markup_abi_file_ref(docname, app, match): 324 + return markup_abi_ref(docname, app, match, warning=True) 325 + 321 326 322 327 def get_c_namespace(app, docname): 323 328 source = app.env.doc2path(docname)
+1 -1
Documentation/userspace-api/media/rc/rc-sysfs-nodes.rst
··· 6 6 Remote Controller's sysfs nodes 7 7 ******************************* 8 8 9 - As defined at ``Documentation/ABI/testing/sysfs-class-rc``, those are 9 + As defined at Documentation/ABI/testing/sysfs-class-rc, those are 10 10 the sysfs nodes that control the Remote Controllers: 11 11 12 12