Re: Force line breaks

Guenter Milde <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <[email protected]>
On 2016-04-05, <[email protected]> wrote:

> [-- 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


------------------------------------------------------------------------------
_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.