[OpenStack-docs] Better way to display shell commands

Andreas Jaeger aj at suse.com
Wed Jul 6 06:36:22 UTC 2016


On 2016-07-06 00:05, Lana Brindley wrote:
> Ah, this looks great!
> 
> Andreas: how easy is it to install this extension? Will it break things?

Installation:

It needs to be added to global-requirements, to local test-requirements
for each repo and to each conf.py.

So, small changes - but lots of them...

And then RST files need to use it.

Andreas

> 
> Lana
> 
> On 06/07/16 05:26, Ronald Bradford wrote:
>> I tested the demo and highlighting of code conveniently excludes prompts (achieved via css syntax).  
>> It is certainly a plus to be able to cut/paste code blocks more easily. 
>>
>> +1
>>
>> Ronald Bradford
>>
>> Web Site: http://ronaldbradford.com <http://ronaldbradford.com/>
>> LinkedIn:  http://www.linkedin.com/in/ronaldbradford
>> Twitter:    @RonaldBradford <http://twitter.com/ronaldbradford>
>> Skype:     RonaldBradford
>> GTalk:     Ronald.Bradford
>> IRC:         rbradfor
>>
>>
>> On Tue, Jul 5, 2016 at 4:43 AM, Adrien Cunin <adrien at adriencunin.fr <mailto:adrien at adriencunin.fr>> wrote:
>>
>>     Hi,
>>
>>     From what I can see we usually use
>>
>>       .. code-block:: console
>>
>>     or
>>
>>       .. code-block:: shell-session
>>
>>     (which actually are the same)
>>
>>     to show commands that are to be executed by the user such as
>>
>>       # apt-get install foo
>>       # echo 1 > bar
>>
>>     The main issue, and the reason I started looking into this, is that the
>>     html output doesn't make it easy to select commands (for copy/pasting
>>     typically) without the prompt.
>>
>>     Turns out there is a Sphinx extension to do just this:
>>     https://github.com/sbrunner/sphinx-prompt
>>
>>     With this extension, the following
>>
>>       .. prompt:: bash #
>>
>>          apt-get install foo
>>          echo 1 > bar
>>
>>     will have the expected result.
>>     That is: looks similar to the previous version, but one can easily
>>     select commands without the prompt.
>>
>>     Does it sound like a good idea?
>>
>>     We'd need first to enable the Sphinx extension wherever we use Sphinx.
>>     Does that actually require to patch each git repository that contains
>>     documentation or do we have another way of doing it globally?
>>     Then, documentations should start using ".. prompt:: bash" instead of
>>     ".. code-block:: console" when appropriate - the change could be
>>     automated or not.
>>
>>     Adrien
>>
>>
>>     _______________________________________________
>>     OpenStack-docs mailing list
>>     OpenStack-docs at lists.openstack.org <mailto:OpenStack-docs at lists.openstack.org>
>>     http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-docs
>>
>>
>>
>>
>> _______________________________________________
>> OpenStack-docs mailing list
>> OpenStack-docs at lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-docs
>>
> 


-- 
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter: jaegerandi
  SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Felix Imendörffer, Jane Smithard, 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