[OpenStack-docs] Better way to display shell commands

Caballero Abraham, Rodrigo rodrigo.caballero.abraham at intel.com
Tue Jul 5 22:16:20 UTC 2016


Hi,
I would give it +1 but I see two issues.
1. code-block:: bash must be changed globally to prompt:: and that is a major undertaking affecting basically all projects. Otherwise, we would be building an inconsistency on purpose.
2. There are two types of commands, sudo/admin and user. Prompt can handle this but it does mean that we need to be extra careful when replacing the code-block directives.

A script could handle the replacements automatically but we would need to debug after the replacement.

Those are my 2 cents.
Regards,

Rodrigo Caballero

Sr. Technical Writer
rodrigo.caballero.abraham at intel.com
VISIT US AT: http://www.intel.com


 

> -----Original Message-----
> From: Lana Brindley [mailto:openstack at lanabrindley.com]
> Sent: Tuesday, July 5, 2016 5:06 PM
> To: openstack-docs at lists.openstack.org; Andreas Jaeger
> <aj at suse.com>
> Subject: Re: [OpenStack-docs] Better way to display shell commands
> 
> Ah, this looks great!
> 
> Andreas: how easy is it to install this extension? Will it break things?
> 
> 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
> >
> 
> --
> Lana Brindley
> Technical Writer
> Rackspace Cloud Builders Australia
> http://lanabrindley.com



More information about the OpenStack-docs mailing list