[OpenStack-docs] italicized python cmds, literal blocks

Andreas Jaeger aj at suse.com
Tue Jun 30 06:56:59 UTC 2015


On 06/29/2015 10:33 PM, Gauvain Pocentek wrote:
> Le 2015-06-29 22:12, Karen Bradshaw a écrit :
>> Hi.  I have been looking into the use of :: vs .. code-block::
>> in the newly converted RST guides.  I have found some inconsistencies.
>> I found that using a root-privileged python executable with the pound
>> sign, gets
>>
>> formatted like a python comment (italicized).
>> If there is output shown after the command
>> then the cmd and output are not italicized but treated as literal
>> text; the single colon directive is used in this case.
>> Using the dollar prompt, everything works as expected (not italicized).
>> We use the literal block directive, double colon, throughout the RST
>> guides.
>> One way I found to get around this is to always use the dollar prompt.
>> Another way is .. code-block::java.  It is a hack, but it generates
>> the correct
>> output for the pound sign <python cmd>.
>> May be someone can shed some light on this problem.
>
> You probably want to use '.. code-block:: console' for interactive shell
> sessions (a prompt and a command followed by its output). This will show
> a different color for the prompt and for shell builtin commands.
>
> If I'm not mistaken :: always uses python syntax highlighting (so italic
> after a # sign is normal behavior), unless you specified another lexer
> to use in your document.

Could you update our markup conventions page for this, please?

Andreas
-- 
  Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
   SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
    GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton,
        HRB 21284 (AG Nürnberg)
     GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126




More information about the OpenStack-docs mailing list