[PATCH] docs: Fix warning:Error in "code-block" directive

Madhumitha Prabakaran posted 1 patch 10 months, 3 weeks ago
.../firmware-guide/acpi/chromeos-acpi-device.rst          | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[PATCH] docs: Fix warning:Error in "code-block" directive
Posted by Madhumitha Prabakaran 10 months, 3 weeks ago
Fix the error in "code-block" directive by providing the
argument as "text".

Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
---
 .../firmware-guide/acpi/chromeos-acpi-device.rst          | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/firmware-guide/acpi/chromeos-acpi-device.rst b/Documentation/firmware-guide/acpi/chromeos-acpi-device.rst
index f37fc90ce340..27292299ad17 100644
--- a/Documentation/firmware-guide/acpi/chromeos-acpi-device.rst
+++ b/Documentation/firmware-guide/acpi/chromeos-acpi-device.rst
@@ -131,7 +131,7 @@ None
 Result code:
 ------------
 
-.. code-block::
+.. code-block:: text
 
    Package {
            Reserved1
@@ -192,7 +192,7 @@ None
 
 Result code:
 ------------
-.. code-block::
+.. code-block:: text
 
         Package {
                 Package {
@@ -265,7 +265,7 @@ None
 
 Result code:
 ------------
-.. code-block::
+.. code-block:: text
 
         Package {
                 NV Storage Block Offset  //DWORD
@@ -347,7 +347,7 @@ A package containing a list of null-terminated ASCII strings, one for each contr
 supported by the Chrome OS hardware device, not including the MLST method itself.
 For this version of the specification, the result is:
 
-.. code-block::
+.. code-block:: text
 
         Package {
                 "CHSW",
-- 
2.25.1
Re: [PATCH] docs: Fix warning:Error in "code-block" directive
Posted by Bagas Sanjaya 10 months, 3 weeks ago
On Fri, Jun 02, 2023 at 04:51:02PM -0500, Madhumitha Prabakaran wrote:
> Fix the error in "code-block" directive by providing the
> argument as "text".
> 
> <snipped> ...
>  Result code:
>  ------------
>  
> -.. code-block::
> +.. code-block:: text

Nope.

I don't see error you mention in this patch when making htmldocs on my
computer (my setup is pretty standard: see
Documentation/doc-guide/sphinx.rst). This patch is unneccessary, though,
unless you have code snippets in some language (e.g. C, where passing
language name to code-block:: syntax-highlight it). Result code outputs,
on the other hand, are generic text with no definitive syntax, hence
you can omit language name.

Thanks.

-- 
An old man doll... just what I always wanted! - Clara
Re: [PATCH] docs: Fix warning:Error in "code-block" directive
Posted by Randy Dunlap 10 months, 3 weeks ago

On 6/2/23 18:20, Bagas Sanjaya wrote:
> On Fri, Jun 02, 2023 at 04:51:02PM -0500, Madhumitha Prabakaran wrote:
>> Fix the error in "code-block" directive by providing the
>> argument as "text".
>>
>> <snipped> ...
>>  Result code:
>>  ------------
>>  
>> -.. code-block::
>> +.. code-block:: text
> 
> Nope.
> 
> I don't see error you mention in this patch when making htmldocs on my
> computer (my setup is pretty standard: see
> Documentation/doc-guide/sphinx.rst). This patch is unneccessary, though,
> unless you have code snippets in some language (e.g. C, where passing
> language name to code-block:: syntax-highlight it). Result code outputs,
> on the other hand, are generic text with no definitive syntax, hence
> you can omit language name.
> 
> Thanks.


I also don't see any such warnings so I don't see a need for this patch.
My wild guess is that some older version of Sphinx was being used.

-- 
~Randy
Re: [PATCH] docs: Fix warning:Error in "code-block" directive
Posted by Akira Yokosawa 10 months, 3 weeks ago
On Fri, 2 Jun 2023 18:41:46 -0700, Randy Dunlap wrote:
> On 6/2/23 18:20, Bagas Sanjaya wrote:
>> On Fri, Jun 02, 2023 at 04:51:02PM -0500, Madhumitha Prabakaran wrote:
>>> Fix the error in "code-block" directive by providing the
>>> argument as "text".
>>>
>>> <snipped> ...
>>>  Result code:
>>>  ------------
>>>  
>>> -.. code-block::
>>> +.. code-block:: text
>> 
>> Nope.
>> 
>> I don't see error you mention in this patch when making htmldocs on my
>> computer (my setup is pretty standard: see
>> Documentation/doc-guide/sphinx.rst). This patch is unneccessary, though,
>> unless you have code snippets in some language (e.g. C, where passing
>> language name to code-block:: syntax-highlight it). Result code outputs,
>> on the other hand, are generic text with no definitive syntax, hence
>> you can omit language name.
>> 
>> Thanks.
> 
> 
> I also don't see any such warnings so I don't see a need for this patch.
> My wild guess is that some older version of Sphinx was being used.

Right.

In Sphinx changelog, "Features added" for 2.0.0b1 [1] lists this:

    #1851: Allow to omit an argument for code-block directive. If omitted,
    it follows highlight or highlight_language

[1]: https://www.sphinx-doc.org/en/master/changes.html#id1306

Pre-2.0 Sphinx is now deprecated.
See commit 31abfdda6527 ("docs: Deprecate use of Sphinx < 2.4.x").

        Thanks, Akira    

> 
> -- 
> ~Randy