How to add newlines?

16 views
Skip to first unread message

spinp...@gmail.com

unread,
Nov 21, 2016, 3:31:30 PM11/21/16
to nikola-discuss
In the .rst markup file, the newlines are not produced after the build. So I tried adding <br/> tags and the tags were produced as they are.
So the question is that how should I add newlines?
Message has been deleted

spinp...@gmail.com

unread,
Nov 21, 2016, 4:10:08 PM11/21/16
to nikola-discuss
This is the .rst file:

This is an example of one the .rst file I am using.
When the post is build, the newlines aren't retained.

.. title: 21-11-2016 | List #1 
.. slug: list-1 
.. date: 2016-11-21 17:24:05 UTC+05:30 
.. tags: 
.. category: list 
.. link:  
.. description: example data
.. type: text 

This is a sample of the data:

data1
data2
data3


I create the data1-3 dynamically from a python script by adding newline(\n) after each data line. But after building, all the data is one the same line. I cannot understand why it's happening?

Roberto Alsina

unread,
Nov 21, 2016, 5:00:14 PM11/21/16
to nikola-discuss
In reStructured text, it will create a paragraph if you leave an empty line. So, this is one paragraph.

And this is another paragraph. And you don't control end of line.

If you want to have explicit lines, there are several ways. One is a literal block::

    This is a literal block.
    It respects new lines. It starts when you have :: at the end of a line, then an empty line, and
    the block is indented.

This is outside the literal block.

You can also use "line blocks", which are often used for things like poems:

| No man is an island,
| Entire of itself,
| Every man is a piece of the continent,
| A part of the main. 
| If a clod be washed away by the sea,
| Europe is the less.

You just put a "pipe" character in each line. It will preserve newlines as well as blank space at the beginning of each line.

All this and more in the quick restructured text guide you should read, because it's not actually Nikola-specific ;-)


--
You received this message because you are subscribed to the Google Groups "nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages