Handling Line Breaks: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
No edit summary
 
Tels (talk | contribs)
m update
 
(4 intermediate revisions by 4 users not shown)
Line 2: Line 2:
If your text contains nothing but single line breaks the Wiki will put everything in a single paragraph, like this:
If your text contains nothing but single line breaks the Wiki will put everything in a single paragraph, like this:
  <nowiki>This is an example for text that has no double line breaks. Single line breaks all along.</nowiki>
  <nowiki>This is an example for text that has no double line breaks. Single line breaks all along.</nowiki>
  <nowiki>Will this text be separated in any way. No it won't.</nowiki>
  <nowiki>Will this text be separated in any way? No it won't.</nowiki>
  <nowiki>Single line breaks all along the way.</nowiki>
  <nowiki>Single line breaks all along the way.</nowiki>
  <nowiki>Dumdidum.</nowiki>
  <nowiki>Dumdidum.</nowiki>
Line 9: Line 9:


This is an example for text that has no double line breaks. Single line breaks all along.
This is an example for text that has no double line breaks. Single line breaks all along.
Will this text be separated in any way. No it won't.
Will this text be separated in any way? No it won't.
Single line breaks all along the way.
Single line breaks all along the way.
Dumdidum.
Dumdidum.
'''Single line breaks will be ignored'''.
'''Single line breaks will be ignored'''.


== Placing double line breaks will do the trick ==
=== Placing double line breaks will do the trick ===
To force the paragraph to end, simply place a double line break in your text, like this:
To force the paragraph to end, simply place a double line break in your text, like this:


  <nowiki>This is an example for text that indeed has double line breaks.</nowiki>
  <nowiki>This is an example for text that indeed has double line breaks.</nowiki>
  <nowiki>Will this text be separated in any way. Yes it will right here.</nowiki>
  <nowiki>Will this text be separated in any way? Yes it will, right here.</nowiki>
   
   
  <nowiki>A shiny new paragraph! Remember to put '''double line breaks''' where you need it.</nowiki>
  <nowiki>A shiny new paragraph! Remember to put '''double line breaks''' where you need it.</nowiki>
Line 25: Line 25:


This is an example for text that indeed has double line breaks.
This is an example for text that indeed has double line breaks.
Will this text be separated in any way. Yes it will right here.
Will this text be separated in any way? Yes it will, right here.


A shiny new paragraph! Remember to put '''double line breaks''' where you need it.
A shiny new paragraph! Remember to put '''double line breaks''' where you need it.
Dumdidum.
Dumdidum.


[[Category:Tutorial]]
== <nowiki><br></nowiki> ==
[[Category:Wiki]]
 
Inside a list you cannot place double line-breaks, because that will cause the list numbering to restart. Use <nowiki><br></nowiki>> for this, it can be used in other places like inside table, headlines etc. See [[Creating_Lists]] for an example.
 
 
== <nowiki><</nowiki>hr> ==
 
<nowiki><hr></nowiki> will create a horizontal line like this:
 
<hr>
 
See above :)
 
The same can be achieved by <nowiki>----</nowiki> (four dashes):
 
----
 
 
== Floating elements ==
 
Sometimes you want to add images that "float" right or left of the text. This works great, until the next headlines comes, and if the image is much higher than the text, the headline will also appear next to the image, instead of below it.
 
'''Example:'''
 
----
[[Image:Trans_0013.jpg|right|320px]]
 
This is a short text that floats left of the image.<br>And another line.
 
=== This is an example headline ===
 
And this is some example text.
 
----
{{clear}}
 
To stop the floating, use the template '''<nowiki>{{clear}}</nowiki>''' before the text that should no longer float (see the [http://wiki.thedarkmod.com/index.php?title=Handling_Line_Breaks&action=edit source code of this article] on how):
 
----
[[Image:Trans_0013.jpg|right|320px]]
 
This is a short text that floats left of the image.<br>And another line.
 
{{clear}}
 
=== This is an example headline ===
 
And this is some example text.
 
----
{{clear}}
 
{{tutorial-wiki|sort=Line breaks}}

Latest revision as of 13:04, 23 March 2012

Single line breaks will be ignored

If your text contains nothing but single line breaks the Wiki will put everything in a single paragraph, like this:

This is an example for text that has no double line breaks. Single line breaks all along.
Will this text be separated in any way? No it won't.
Single line breaks all along the way.
Dumdidum.
'''Single line breaks will be ignored'''.

And this is what it will look like:

This is an example for text that has no double line breaks. Single line breaks all along. Will this text be separated in any way? No it won't. Single line breaks all along the way. Dumdidum. Single line breaks will be ignored.

Placing double line breaks will do the trick

To force the paragraph to end, simply place a double line break in your text, like this:

This is an example for text that indeed has double line breaks.
Will this text be separated in any way? Yes it will, right here.

A shiny new paragraph! Remember to put '''double line breaks''' where you need it.
Dumdidum.

And this is what it will look like:

This is an example for text that indeed has double line breaks. Will this text be separated in any way? Yes it will, right here.

A shiny new paragraph! Remember to put double line breaks where you need it. Dumdidum.

<br>

Inside a list you cannot place double line-breaks, because that will cause the list numbering to restart. Use <br>> for this, it can be used in other places like inside table, headlines etc. See Creating_Lists for an example.


<hr>

<hr> will create a horizontal line like this:


See above :)

The same can be achieved by ---- (four dashes):



Floating elements

Sometimes you want to add images that "float" right or left of the text. This works great, until the next headlines comes, and if the image is much higher than the text, the headline will also appear next to the image, instead of below it.

Example:


This is a short text that floats left of the image.
And another line.

This is an example headline

And this is some example text.


To stop the floating, use the template {{clear}} before the text that should no longer float (see the source code of this article on how):


This is a short text that floats left of the image.
And another line.

This is an example headline

And this is some example text.