[OpenStack-docs] Better way to display shell commands
Pranav Salunke
dguitarbite at gmail.com
Sun Jul 10 13:32:33 UTC 2016
Thanks for considering this, I will re-visit this topic once we have some
conclusions and see if we can make the pseudo syntax (like code-blocks
etc.) nicer.
Regards,
Pranav
On Thu, Jul 7, 2016 at 12:39 AM, Lana Brindley <openstack at lanabrindley.com>
wrote:
> OK, good call, Pranav :)
>
> L
>
> On 06/07/16 20:52, Pranav Salunke wrote:
> > Again, to make myself more clear ... the parser that I am writing is
> based on a few logical blocks:
> >
> > 1.
> >
> > .. code-block:: console (is great!)
> > $|# echo "Defines if its run as root or normal user
> > .. code-block:: end (so I dont have to write a linter and gives a
> logical searching end syntax for a given code block!)
> >
> > 2.
> >
> > $|# can easily be parsed by string match and replace with the command or
> su -||sudo ...
> >
> > 3.
> >
> > For ini/conf/apache or anything else but console its not a direct BASH
> command and this logic then invokes another algorithm which parses the
> configuration files in the right order.
> >
> > I have been working on this quite a bit and would be really happy if we
> try not to change it for the scope of this release since I would also have
> to update the entire installation guides and the project-specific
> installation guides.
> >
> > If still we believe that there needs to be a change then we should
> discuss it and finalize one syntax for atleast the scope of two releases or
> more. IMHO this change is not really necessary (the one proposed in the
> earlier emails in this thread) and there are no real technical
> disadvantages as I have been studying the install guides syntax with such
> questions and philosophical perspectives and point of views since the last
> OpenStack summit, especially the design session of installation guides.
> >
> > I hope I am clear with my arguments.
> >
> > Regards,
> > Pranav
> >
> > On Wed, Jul 6, 2016 at 12:42 PM, Pranav Salunke <dguitarbite at gmail.com
> <mailto:dguitarbite at gmail.com>> wrote:
> >
> > I would like to keep these changes on hold as I am writing a parser
> which parses these code-blocks to BASH for automating testing of install
> guides. Could we hold on to the current structure for a couple of weeks? As
> I have to edit/change a few things in install guides too for the same.
> >
> > Pranav
> >
> > On Wed, Jul 6, 2016 at 8:36 AM, Andreas Jaeger <aj at suse.com <mailto:
> aj at suse.com>> wrote:
> >
> > 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> <mailto:
> 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> <mailto:
> 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 <mailto:
> OpenStack-docs at lists.openstack.org>
> > >>
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-docs
> > >>
> > >
> >
> >
> > --
> > Andreas Jaeger aj@{suse.com <http://suse.com>,opensuse.org <
> http://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
> >
> >
> > _______________________________________________
> > 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
> >
> >
> >
>
> --
> Lana Brindley
> Technical Writer
> Rackspace Cloud Builders Australia
> http://lanabrindley.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-docs/attachments/20160710/dbca85ce/attachment.html>
More information about the OpenStack-docs
mailing list