Discussion:
[Docutils-users] Literal blocks within Option Lists (for man pages)
Thomas Adam
2016-05-07 21:45:03 UTC
Permalink
Hi all,

I'm writing a man page using RST and have come across a situation I can't
solve. I have an option block, and within it, I'd like to have a part of the
text block indented. To achieve that, I've done the following:

<RST TEXT>
-l, --color-limit limit
Line1.
Line2.
Line3.

::

Indented line 1.
Indented line 2.
Indented line 3.

Indented line 4.
Indented line 5.
Indented line 6.

</RST TEXT>

This all works fine, and the indented lines are rendered as I'd expect them
to. However, I also have further lines which are part of the description for
the '-l' option. However, those lines are not indented at the same level as
lines "Line1", "Line2", etc.

Here's the code as I've written it including the additional text:


<RST TEXT>
-l, --color-limit limit
Line1.
Line2.
Line3.

::

Indented line 1.
Indented line 2.
Indented line 3.

Indented line 4.
Indented line 5.
Indented line 6.

More lines 1.
More lines 2.
More lines 3.
</RST TEXT>

However, the rest of the text ("More lines 1", etc.) isn't aligned at the same
level as "Line1". Instead, they're flush left to the screen, which isn't
something I'd expect.

Is what I'm trying to achieve possible? Am I using the correct means of
indenting the block of lines in the first place? Or is this type of thing not
supported within option lists?

Any pointers much appreciated.

Kindly,
Thomas Adam

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Docutils-users mailing list
Docutils-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
Guenter Milde
2016-05-08 09:14:25 UTC
Permalink
Post by Thomas Adam
Hi all,
I'm writing a man page using RST and have come across a situation I can't
solve. I have an option block, and within it, I'd like to have a part of the
<RST TEXT>
-l, --color-limit limit
Line1.
Line2.
Line3.
Indented line 1.
Indented line 2.
Indented line 3.
Indented line 4.
Indented line 5.
Indented line 6.
</RST TEXT>
The indentation of a literal block is a layout setting, not an intrinsic
feature.

For indented text, the simplest representation would be a block-quote.
If line-breaks are to be kept a line-block::

-l, --color-limit limit
Pragraph 1

Indented block

| line 1
| line 2

Only if you really want "literal" text (no markup parsing, teletype font),
use the literal block.
Post by Thomas Adam
This all works fine, and the indented lines are rendered as I'd expect them
to. However, I also have further lines which are part of the description for
the '-l' option. However, those lines are not indented at the same level as
lines "Line1", "Line2", etc.
<RST TEXT>
-l, --color-limit limit
Line1.
Line2.
Line3.

::

Indented line 1.
Indented line 2.
Indented line 3.

Indented line 4.
Indented line 5.
Indented line 6.

More lines 1.
More lines 2.
More lines 3.
Post by Thomas Adam
</RST TEXT>
However, the rest of the text ("More lines 1", etc.) isn't aligned at
the same level as "Line1". Instead, they're flush left to the screen,
which isn't something I'd expect.
I cannot reproduce. Here, I get

* lines in the "normal paragraphs" merged
* paragraphs "line1 ... line3" and "More lines 1 ... 3" aligned
in the HTML output.

rst2html (Docutils 0.13 [repository], Python 2.7.11+, on linux2)


Maybe there is something in your original source but missing in the minimal
example?

Günter


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Docutils-users mailing list
Docutils-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All"
engelbert gruber
2016-05-08 09:47:54 UTC
Permalink
i tried it with manpage writer

<RST-TEXT>
an option block, and within it, a part of the text block indented.
the rest of the text ("More lines 1", etc.) isn't aligned at the same
level as "Line1". Instead, they're flush left to the screen

-l, --color-limit limit
Line1.
Line2.
Line3.

::

Indented line 1.
Indented line 2.
Indented line 3.

Indented line 4.
Indented line 5.
Indented line 6.

More lines 1.
More lines 2.
More lines 3.

</RST-TEXT>

produces this manpage::

()
()

NAME
- an option block, and within it, a part of the text block
indented. the rest of the text
("More lines 1", etc.) isn't aligned at the same level as "Line1".
Instead, they're flush left
to the screen

-l,--color-limit limit
Line1. Line2. Line3.

Indented line 1.
Indented line 2.
Indented line 3.

Indented line 4.
Indented line 5.
Indented line 6.

More lines 1. More lines 2. More lines 3.


()

?
Post by Thomas Adam
Post by Thomas Adam
Hi all,
I'm writing a man page using RST and have come across a situation I can't
solve. I have an option block, and within it, I'd like to have a part
of the
Post by Thomas Adam
<RST TEXT>
-l, --color-limit limit
Line1.
Line2.
Line3.
Indented line 1.
Indented line 2.
Indented line 3.
Indented line 4.
Indented line 5.
Indented line 6.
</RST TEXT>
The indentation of a literal block is a layout setting, not an intrinsic
feature.
For indented text, the simplest representation would be a block-quote.
-l, --color-limit limit
Pragraph 1
Indented block
| line 1
| line 2
Only if you really want "literal" text (no markup parsing, teletype font),
use the literal block.
Post by Thomas Adam
This all works fine, and the indented lines are rendered as I'd expect
them
Post by Thomas Adam
to. However, I also have further lines which are part of the
description for
Post by Thomas Adam
the '-l' option. However, those lines are not indented at the same
level as
Post by Thomas Adam
lines "Line1", "Line2", etc.
<RST TEXT>
-l, --color-limit limit
Line1.
Line2.
Line3.
Indented line 1.
Indented line 2.
Indented line 3.
Indented line 4.
Indented line 5.
Indented line 6.
More lines 1.
More lines 2.
More lines 3.
Post by Thomas Adam
</RST TEXT>
However, the rest of the text ("More lines 1", etc.) isn't aligned at
the same level as "Line1". Instead, they're flush left to the screen,
which isn't something I'd expect.
I cannot reproduce. Here, I get
* lines in the "normal paragraphs" merged
* paragraphs "line1 ... line3" and "More lines 1 ... 3" aligned
in the HTML output.
rst2html (Docutils 0.13 [repository], Python 2.7.11+, on linux2)
Maybe there is something in your original source but missing in the minimal
example?
GÃŒnter
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Docutils-users mailing list
https://lists.sourceforge.net/lists/listinfo/docutils-users
Please use "Reply All" to reply to the list.
Loading...