Shortcut for monospace example text in a list?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Shortcut for monospace example text in a list?

apj68
First time poster here. . . firstly, a big thanks to the makers and maintainers of asciidoctor!  I was a long time user of asciidoc but asciidoctor+gradle are my new friends.  Everything has been working out great, I just fly through documentation now.

One question for the gallery, is there a simple shortcut to creating a list item with a monospace sample block?  For example, I know this works:

1.  Change to the foo dir and run something.
+
....
cd foo
run something
....
2.  Etc.

But it's wordy and this example is something I do all the time.  I know about use the `backticks` which works for single lines but is that the approach for multiple lines of sample text as well?  Some markups allow paragraphs beginning with a space to be monospace but that doesn't seem to be the case.  Thanks for any suggestions!

Andy
Reply | Threaded
Open this post in threaded view
|

Re: Shortcut for monospace example text in a list?

mojavelinux
Administrator
I have good news for you. The indented literal block is special just for this case. When used in a list item, it works without any other markup. So the following will work:

1.  Change to the foo dir 

  cd foo 
 
2.  Etc. 

You can see many examples of this in the README files in the asciidoctor organization. Here's one example:


(see the raw file for details)

Cheers,

-Dan

On Sat, Mar 28, 2015 at 12:09 AM, apj68 [via Asciidoctor :: Discussion] <[hidden email]> wrote:
First time poster here. . . firstly, a big thanks to the makers and maintainers of asciidoctor!  I was a long time user of asciidoc but asciidoctor+gradle are my new friends.  Everything has been working out great, I just fly through documentation now.

One question for the gallery, is there a simple shortcut to creating a step with a monospace sample block?  For example, I know this works:

1.  Change to the foo dir
+
....
cd foo
....
2.  Etc.

But it's wordy and this example is something I do all the time.  Is there a shortcut?  Some markups allow paragraphs beginning with a space to be monospace but that doesn't seem to be the case.  Thanks for any suggestions!

Andy


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Shortcut-for-monospace-example-text-in-a-list-tp2863.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Shortcut for monospace example text in a list?

apj68
Ah, great,  that is good news!  I tried something like that but had no empty lines between the
list and the literal so I think that's why it wasn't working.  It works really well now.  Thanks for the example,
this will save me some typing!