* [PATCH] docs: automarkup: Remove some Sphinx 2 holdovers
@ 2025-06-03 17:17 Jonathan Corbet
2025-06-03 21:32 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Corbet @ 2025-06-03 17:17 UTC (permalink / raw)
To: linux-doc; +Cc: Mauro Carvalho Chehab
Remove a few declarations that are no longer doing anything now that we
have left Sphinx 2 behind.
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
---
Documentation/sphinx/automarkup.py | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/Documentation/sphinx/automarkup.py b/Documentation/sphinx/automarkup.py
index fd633f7a0bc3..347de81c1ab7 100644
--- a/Documentation/sphinx/automarkup.py
+++ b/Documentation/sphinx/automarkup.py
@@ -150,20 +150,12 @@ def markup_func_ref_sphinx3(docname, app, match):
return target_text
def markup_c_ref(docname, app, match):
- class_str = {# Sphinx 2 only
- RE_function: 'c-func',
- RE_generic_type: 'c-type',
- # Sphinx 3+ only
- RE_struct: 'c-struct',
+ class_str = {RE_struct: 'c-struct',
RE_union: 'c-union',
RE_enum: 'c-enum',
RE_typedef: 'c-type',
}
- reftype_str = {# Sphinx 2 only
- RE_function: 'function',
- RE_generic_type: 'type',
- # Sphinx 3+ only
- RE_struct: 'struct',
+ reftype_str = {RE_struct: 'struct',
RE_union: 'union',
RE_enum: 'enum',
RE_typedef: 'type',
--
2.49.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] docs: automarkup: Remove some Sphinx 2 holdovers
2025-06-03 17:17 [PATCH] docs: automarkup: Remove some Sphinx 2 holdovers Jonathan Corbet
@ 2025-06-03 21:32 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2025-06-03 21:32 UTC (permalink / raw)
To: Jonathan Corbet; +Cc: linux-doc, Mauro Carvalho Chehab
Em Tue, 03 Jun 2025 11:17:59 -0600
Jonathan Corbet <corbet@lwn.net> escreveu:
> Remove a few declarations that are no longer doing anything now that we
> have left Sphinx 2 behind.
>
> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
> ---
> Documentation/sphinx/automarkup.py | 12 ++----------
> 1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/Documentation/sphinx/automarkup.py b/Documentation/sphinx/automarkup.py
> index fd633f7a0bc3..347de81c1ab7 100644
> --- a/Documentation/sphinx/automarkup.py
> +++ b/Documentation/sphinx/automarkup.py
> @@ -150,20 +150,12 @@ def markup_func_ref_sphinx3(docname, app, match):
> return target_text
>
> def markup_c_ref(docname, app, match):
> - class_str = {# Sphinx 2 only
> - RE_function: 'c-func',
> - RE_generic_type: 'c-type',
> - # Sphinx 3+ only
> - RE_struct: 'c-struct',
> + class_str = {RE_struct: 'c-struct',
> RE_union: 'c-union',
> RE_enum: 'c-enum',
> RE_typedef: 'c-type',
> }
> - reftype_str = {# Sphinx 2 only
> - RE_function: 'function',
> - RE_generic_type: 'type',
> - # Sphinx 3+ only
> - RE_struct: 'struct',
> + reftype_str = {RE_struct: 'struct',
> RE_union: 'union',
> RE_enum: 'enum',
> RE_typedef: 'type',
Makes sense to me. I almost removed it on one of my patches, but I
ended forgetting about that ;-)
You probably can get rid of this too:
#
# Sphinx 2 uses the same :c:type role for struct, union, enum and typedef
#
RE_generic_type = re.compile(r'\b(struct|union|enum|typedef)\s+([a-zA-Z_]\w+)',
flags=re.ASCII)
As this is used only on the regular expressions you dropped.
After removing that:
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thanks,
Mauro
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-03 21:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-03 17:17 [PATCH] docs: automarkup: Remove some Sphinx 2 holdovers Jonathan Corbet
2025-06-03 21:32 ` Mauro Carvalho Chehab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).