Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 1/1] doc/conf.py: Replace all titles
@ 2025-02-18 13:34 Petr Vorel
  2025-02-18 14:33 ` Andrea Cervesato via ltp
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2025-02-18 13:34 UTC (permalink / raw)
  To: ltp

This fixes titles like "[Race Description]".

Fixes: 1bf344a3db ("doc: add tests catalog page")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Link to v1:
https://patchwork.ozlabs.org/project/ltp/patch/20250218121553.2470592-1-pvorel@suse.cz/

Changes from v1:
* Use re.compile (Andrea)

 doc/conf.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/doc/conf.py b/doc/conf.py
index 03fcff67e8..2be847d90b 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -434,6 +434,7 @@ def generate_test_catalog(_):
         metadata = json.load(data)
 
     timeout_def = metadata['defaults']['timeout']
+    regexp = re.compile(r'^\[([A-Za-z][\w\W]+)\]')
 
     for test_name, conf in sorted(metadata['tests'].items()):
         text.extend([
@@ -455,12 +456,8 @@ def generate_test_catalog(_):
         if desc:
             desc_text = []
             for line in desc:
-                if line.startswith("[Description]"):
-                    desc_text.append("**Description**")
-                elif line.startswith("[Algorithm]"):
-                    desc_text.append("**Algorithm**")
-                else:
-                    desc_text.append(line)
+                line = regexp.sub(r'**\1**', line)
+                desc_text.append(line)
 
             text.extend([
                 '\n'.join(desc_text),
-- 
2.47.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [LTP] [PATCH v2 1/1] doc/conf.py: Replace all titles
  2025-02-18 13:34 [LTP] [PATCH v2 1/1] doc/conf.py: Replace all titles Petr Vorel
@ 2025-02-18 14:33 ` Andrea Cervesato via ltp
  2025-02-19  8:44   ` Petr Vorel
  0 siblings, 1 reply; 3+ messages in thread
From: Andrea Cervesato via ltp @ 2025-02-18 14:33 UTC (permalink / raw)
  To: Petr Vorel, ltp

Hi Petr,

Acked-by: Andrea Cervesato <andrea.cervesato@suse.com>

Feel free to merge.

Andrea

On 2/18/25 14:34, Petr Vorel wrote:
> This fixes titles like "[Race Description]".
>
> Fixes: 1bf344a3db ("doc: add tests catalog page")
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Link to v1:
> https://patchwork.ozlabs.org/project/ltp/patch/20250218121553.2470592-1-pvorel@suse.cz/
>
> Changes from v1:
> * Use re.compile (Andrea)
>
>   doc/conf.py | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/doc/conf.py b/doc/conf.py
> index 03fcff67e8..2be847d90b 100644
> --- a/doc/conf.py
> +++ b/doc/conf.py
> @@ -434,6 +434,7 @@ def generate_test_catalog(_):
>           metadata = json.load(data)
>   
>       timeout_def = metadata['defaults']['timeout']
> +    regexp = re.compile(r'^\[([A-Za-z][\w\W]+)\]')
>   
>       for test_name, conf in sorted(metadata['tests'].items()):
>           text.extend([
> @@ -455,12 +456,8 @@ def generate_test_catalog(_):
>           if desc:
>               desc_text = []
>               for line in desc:
> -                if line.startswith("[Description]"):
> -                    desc_text.append("**Description**")
> -                elif line.startswith("[Algorithm]"):
> -                    desc_text.append("**Algorithm**")
> -                else:
> -                    desc_text.append(line)
> +                line = regexp.sub(r'**\1**', line)
> +                desc_text.append(line)
>   
>               text.extend([
>                   '\n'.join(desc_text),

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [LTP] [PATCH v2 1/1] doc/conf.py: Replace all titles
  2025-02-18 14:33 ` Andrea Cervesato via ltp
@ 2025-02-19  8:44   ` Petr Vorel
  0 siblings, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2025-02-19  8:44 UTC (permalink / raw)
  To: Andrea Cervesato; +Cc: ltp

Hi Andrea,

Thanks, merged!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-19  8:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-18 13:34 [LTP] [PATCH v2 1/1] doc/conf.py: Replace all titles Petr Vorel
2025-02-18 14:33 ` Andrea Cervesato via ltp
2025-02-19  8:44   ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox