[OpenStack-docs] Better way to display shell commands
Ronald Bradford
me at ronaldbradford.com
Tue Jul 5 19:26:12 UTC 2016
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
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> 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
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-docs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-docs/attachments/20160705/38d3a4ff/attachment.html>
More information about the OpenStack-docs
mailing list