diff mbox

[for-2.9,6/6] qapi2texi: Fix translation of *strong* and _emphasized_

Message ID 1490015515-25851-7-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster March 20, 2017, 1:11 p.m. UTC
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi2texi.py            | 4 ++--
 tests/qapi-schema/doc-good.texi | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

Comments

Marc-Andre Lureau March 20, 2017, 1:32 p.m. UTC | #1
----- Original Message -----
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

weird this disparity went so far unnoticed

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi2texi.py            | 4 ++--
>  tests/qapi-schema/doc-good.texi | 8 ++++----
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
> index 5c4db78..9e01500 100755
> --- a/scripts/qapi2texi.py
> +++ b/scripts/qapi2texi.py
> @@ -35,12 +35,12 @@ EXAMPLE_FMT = """@example
>  
>  def subst_strong(doc):
>      """Replaces *foo* by @strong{foo}"""
> -    return re.sub(r'\*([^*\n]+)\*', r'@emph{\1}', doc)
> +    return re.sub(r'\*([^*\n]+)\*', r'@strong{\1}', doc)
>  
>  
>  def subst_emph(doc):
>      """Replaces _foo_ by @emph{foo}"""
> -    return re.sub(r'\b_([^_\n]+)_\b', r' @emph{\1} ', doc)
> +    return re.sub(r'\b_([^_\n]+)_\b', r'@emph{\1}', doc)
>  
>  
>  def subst_vars(doc):
> diff --git a/tests/qapi-schema/doc-good.texi
> b/tests/qapi-schema/doc-good.texi
> index 1160aaf..c410626 100644
> --- a/tests/qapi-schema/doc-good.texi
> +++ b/tests/qapi-schema/doc-good.texi
> @@ -2,7 +2,7 @@
>  
>  @subsection Subsection
>  
> -@emph{strong}  @emph{with emphasis}
> +@strong{strong} @emph{with emphasis}
>  @code{var} @{in braces@}
>  @itemize @bullet
>  @item
> @@ -67,7 +67,7 @@ Example:
>  Examples:
>  @itemize @minus
>  @item
> -@emph{verbatim}
> +@strong{verbatim}
>  @item
>  @{braces@}
>  @end itemize
> @@ -76,12 +76,12 @@ Examples:
>  
>  @deftp {Enum} Enum
>  
> -@subsection Produces @emph{invalid} texinfo
> +@subsection Produces @strong{invalid} texinfo
>  
>  @b{Values:}
>  @table @asis
>  @item @code{one}
> -The  @emph{one}  @{and only@}
> +The @emph{one} @{and only@}
>  @item @code{two}
>  Not documented
>  @end table
> --
> 2.7.4
> 
>
Peter Maydell March 20, 2017, 1:37 p.m. UTC | #2
On 20 March 2017 at 13:32, Marc-André Lureau <mlureau@redhat.com> wrote:
>
>
> ----- Original Message -----
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
> weird this disparity went so far unnoticed

You think people read the documentation? :-)

thanks
-- PMM
Markus Armbruster March 21, 2017, 7:20 a.m. UTC | #3
Peter Maydell <peter.maydell@linaro.org> writes:

> On 20 March 2017 at 13:32, Marc-André Lureau <mlureau@redhat.com> wrote:
>>
>>
>> ----- Original Message -----
>>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>
>> weird this disparity went so far unnoticed
>
> You think people read the documentation? :-)

It's exactly the kind of stupid pasto that gets caught only when you
write systematic tests and carefully check their output against your
expectations.
diff mbox

Patch

diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
index 5c4db78..9e01500 100755
--- a/scripts/qapi2texi.py
+++ b/scripts/qapi2texi.py
@@ -35,12 +35,12 @@  EXAMPLE_FMT = """@example
 
 def subst_strong(doc):
     """Replaces *foo* by @strong{foo}"""
-    return re.sub(r'\*([^*\n]+)\*', r'@emph{\1}', doc)
+    return re.sub(r'\*([^*\n]+)\*', r'@strong{\1}', doc)
 
 
 def subst_emph(doc):
     """Replaces _foo_ by @emph{foo}"""
-    return re.sub(r'\b_([^_\n]+)_\b', r' @emph{\1} ', doc)
+    return re.sub(r'\b_([^_\n]+)_\b', r'@emph{\1}', doc)
 
 
 def subst_vars(doc):
diff --git a/tests/qapi-schema/doc-good.texi b/tests/qapi-schema/doc-good.texi
index 1160aaf..c410626 100644
--- a/tests/qapi-schema/doc-good.texi
+++ b/tests/qapi-schema/doc-good.texi
@@ -2,7 +2,7 @@ 
 
 @subsection Subsection
 
-@emph{strong}  @emph{with emphasis} 
+@strong{strong} @emph{with emphasis}
 @code{var} @{in braces@}
 @itemize @bullet
 @item
@@ -67,7 +67,7 @@  Example:
 Examples:
 @itemize @minus
 @item
-@emph{verbatim}
+@strong{verbatim}
 @item
 @{braces@}
 @end itemize
@@ -76,12 +76,12 @@  Examples:
 
 @deftp {Enum} Enum
 
-@subsection Produces @emph{invalid} texinfo
+@subsection Produces @strong{invalid} texinfo
 
 @b{Values:}
 @table @asis
 @item @code{one}
-The  @emph{one}  @{and only@}
+The @emph{one} @{and only@}
 @item @code{two}
 Not documented
 @end table