Discussion:
[Docutils-users] Force line breaks
S***@telekom.de
2016-04-05 11:24:47 UTC
Permalink
Hi all,

Is there a markup in reStructuredText, that forces a line break only,
and is not interpreted as a block quote with indentation like line block?

I would like to force line breaks in a numerated list.

#. | First line
| Second line
| Third line
#. Item with only one line
#. Another item

Looking at restructuredText examples and the rtd theme, the line block
markup seems to be expected to be rendered with a left margin in html,
while it does not produce a margin with latex.
As a consequence, the first item will be indented by 24px and the one line
Items are not indented.

Is there an alternative markup, or do I have to customise the css?

BR,

Stefan
Matěj Cepl
2016-04-05 12:07:55 UTC
Permalink
Post by S***@telekom.de
I would like to force line breaks in a numerated list.
#. | First line
| Second line
| Third line
#. Item with only one line
#. Another item
I am afraid you hold the phone wrong ;). Really, what you want
here is embedded list inside of the first item.

Matěj
--
https://matej.ceplovi.cz/blog/, Jabber: ***@ceplovi.cz
GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC

..every Man has a Property in his own Person. This no Body has
any Right to but himself. The Labour of his Body, and the Work of
his Hands, we may say, are properly his. .... The great and chief
end therefore, of Mens uniting into Commonwealths, and putting
themselves under Government, is the Preservation of their
Property.
-- John Locke, "A Treatise Concerning Civil Government"
Guenter Milde
2016-04-05 15:35:32 UTC
Permalink
[-- Type: text/plain, Encoding: quoted-printable --]
Hi all,
Is there a markup in reStructuredText, that forces a line break only,
and is not interpreted as a block quote with indentation like line block?
I would like to force line breaks in a numerated list.
#. | First line
| Second line
| Third line
#. Item with only one line
#. Another item
Looking at restructuredText examples and the rtd theme, the line block
markup seems to be expected to be rendered with a left margin in html,
while it does not produce a margin with latex.
As a consequence, the first item will be indented by 24px and the one line
Items are not indented.
In my setup, the line-block in a list is not indented further but aligns
with the following item. Did you try your markup? Do you already use a
custom CSS?
Is there an alternative markup, or do I have to customise the css?
There is nothing like ::

#. First line <br>
Second line <br>
Third line <br>
#. Item with only one line


You can, however write paragraphs, say:

#. First line

Second line

Third line

#. Item with only one line


With the html5 writer (in the development version of Docutils) you can
remove spacing between the paragraphs and list items whith the class value
"compact" for the list:

.. class:: compact

#. First line

Second line

Third line

#. Item with only one line


The following works in most browsers but does not validate (<style> is only
allowed in the document head)::

.. raw:: html

<style type="text/css"><!--
li div.line-block {
margin-left: 0px;
color: red; /* for testing */
}
--></style>


hope this helps,

Günter
Bram Geron
2016-04-05 16:08:27 UTC
Permalink
The pseudoxml writer shows that the intention of your RST code is
<enumerated_list enumtype="arabic" prefix="" suffix=".">
<list_item>
<line_block>
<line>
First line
<line>
Second line
<line>
Third line
<list_item>
<paragraph>
Item with only one line
<list_item>
<paragraph>
Another item
This is what the RST "really means". How it gets turned into HTML/LaTeX
is subjective; you can use many stylesheets or even HTML trees for HTML,
and many document types for LaTeX. You might need to configure/tweak
either writer for your purposes.

Cheers, Bram
[-- Type: text/plain, Encoding: quoted-printable --]
Hi all,
Is there a markup in reStructuredText, that forces a line break only,
and is not interpreted as a block quote with indentation like line block?
I would like to force line breaks in a numerated list.
#. | First line
| Second line
| Third line
#. Item with only one line
#. Another item
Looking at restructuredText examples and the rtd theme, the line block
markup seems to be expected to be rendered with a left margin in html,
while it does not produce a margin with latex.
As a consequence, the first item will be indented by 24px and the one line
Items are not indented.
In my setup, the line-block in a list is not indented further but aligns
with the following item. Did you try your markup? Do you already use a
custom CSS?
Is there an alternative markup, or do I have to customise the css?
#. First line <br>
Second line <br>
Third line <br>
#. Item with only one line
#. First line
Second line
Third line
#. Item with only one line
With the html5 writer (in the development version of Docutils) you can
remove spacing between the paragraphs and list items whith the class value
.. class:: compact
#. First line
Second line
Third line
#. Item with only one line
The following works in most browsers but does not validate (<style> is only
.. raw:: html
<style type="text/css"><!--
li div.line-block {
margin-left: 0px;
color: red; /* for testing */
}
--></style>
hope this helps,
Günter
------------------------------------------------------------------------------
_______________________________________________
Docutils-users mailing list
https://lists.sourceforge.net/lists/listinfo/docutils-users
Please use "Reply All" to reply to the list.
Loading...