Commit dc1c3d28 authored by Dan Allen's avatar Dan Allen
Browse files

resolves #3 move hard line breaks section to a dedicated page under the Paragraphs section (PR #12)

* move docuemntation for hard line breaks to a dedicated page
* associate hard line breaks with Paragraph section
* rename hardbreaks document attribute to hardbreaks-option
parent afbceb36
......@@ -633,12 +633,12 @@ If the value is AMS, only LaTeX content enclosed in an `+\begin{equation}...\end
If the value is all, then all LaTeX blocks will be numbered.
See https://docs.mathjax.org/en/v2.5-latest/tex.html#automatic-equation-numbering[equation numbering in MathJax].
|hardbreaks
|hardbreaks-option
|{n}
|*_empty_*
|{y}
|{y}
|xref:blocks:breaks.adoc#hardbreaks-attribute[Preserve hard line breaks].
|xref:blocks:hard-line-breaks.adoc#per-document[Preserve hard line breaks].
|hide-uri-scheme
|{n}
......
......@@ -32,7 +32,7 @@ This results in a visible line break (e.g., `<br>`) between the lines.
// tag::hb-attr[]
= Line Break Doc Title
:hardbreaks:
:hardbreaks-option:
Rubies are red,
Topazes are blue.
......
* xref:paragraphs.adoc[]
** xref:hard-line-breaks.adoc[]
** xref:preamble-and-lead.adoc[]
** xref:paragraph-alignment.adoc[]
* xref:breaks.adoc[]
= Breaks
== Hard line breaks
Since adjacent lines of text are combined into a single paragraph when Asciidoctor converts a document, that means you can wrap paragraph text or put each sentence or phrase on a separate line.
The line breaks won't appear in the output.
However, if you want the line breaks in a paragraph to be preserved, you can use a space followed by a plus sign (`{plus}`) or set the `hardbreaks` option on the paragraph.
All of the line breaks in an entire document can be preserved with the `hardbreaks` document attribute.
TIP: Hard line breaks are automatically retained in xref:verbatim:literal-blocks.adoc[literal], xref:verbatim:listing-blocks.adoc[listing], xref:verbatim:source-blocks.adoc[source], and xref:verses.adoc[verse] blocks and paragraphs.
=== Inline line break syntax
To preserve a line break in a paragraph, type a blank space followed by a plus sign (`{plus}`) at the end of the line.
This results in a visible line break (e.g., `<br>`) following the line.
.Line breaks preserved using a space followed by the plus sign ({plus})
[source#ex-plus]
----
include::example$paragraph.adoc[tag=hb]
----
The result of <<ex-plus>> is displayed below.
====
include::example$paragraph.adoc[tag=hb]
====
[#hardbreaks-option]
=== hardbreaks option
To retain all of the line breaks in an entire paragraph, assign the `hardbreaks` option to the paragraph using an attribute list.
.Line breaks preserved using the hardbreaks option
[source#ex-option]
----
include::example$paragraph.adoc[tag=hb-p]
----
The result of <<ex-option>> is displayed below.
====
include::example$paragraph.adoc[tag=hb-p]
====
[#hardbreaks-attribute]
=== hardbreaks attribute
To preserve line breaks throughout your entire document, set the `hardbreaks` document attribute in the document header.
.Line breaks preserved throughout the document using the hardbreaks attribute
[source#ex-attribute]
----
include::example$paragraph.adoc[tag=hb-attr]
----
include::partial$thematic-breaks.adoc[]
include::partial$page-breaks.adoc[]
= Hard Line Breaks
Since adjacent lines of text are combined into a single paragraph when Asciidoctor converts a document, that means you can wrap paragraph text or put each sentence or phrase on a separate line.
The line breaks won't appear in the output.
However, if you want the line breaks in a paragraph to be preserved, you can use a space followed by a plus sign (`{plus}`) or set the `hardbreaks` option on the paragraph.
All of the line breaks in paragarphs for an entire document can be preserved with the `hardbreaks-option` document attribute.
TIP: Hard line breaks are automatically retained in xref:verbatim:literal-blocks.adoc[literal], xref:verbatim:listing-blocks.adoc[listing], xref:verbatim:source-blocks.adoc[source], and xref:verses.adoc[verse] blocks and paragraphs.
[#per-line]
== Inline line break syntax
To preserve a line break in a paragraph, type a blank space followed by a plus sign (`{plus}`) at the end of the line.
This results in a visible line break (e.g., `<br>`) following the line.
.Line breaks preserved using a space followed by the plus sign ({plus})
[source#ex-plus]
----
include::example$paragraph.adoc[tag=hb]
----
The result of <<ex-plus>> is displayed below.
====
include::example$paragraph.adoc[tag=hb]
====
[#per-block]
== hardbreaks option
To retain all of the line breaks in an entire paragraph, assign the `hardbreaks` option to the paragraph using an attribute list.
.Line breaks preserved using the hardbreaks option
[source#ex-option]
----
include::example$paragraph.adoc[tag=hb-p]
----
The result of <<ex-option>> is displayed below.
====
include::example$paragraph.adoc[tag=hb-p]
====
[#per-document]
== hardbreaks-option attribute
To preserve line breaks in all paragraphs throughout your entire document, set the `hardbreaks-option` document attribute in the document header.
.Line breaks preserved throughout the document using the hardbreaks-option attribute
[source#ex-attribute]
----
include::example$paragraph.adoc[tag=hb-attr]
----
......@@ -39,7 +39,7 @@ This results in a visible line break (e.g., `<br>`) between the lines.
// tag::hb-attr[]
= Line Break Doc Title
:hardbreaks:
:hardbreaks-option:
Rubies are red,
Topazes are blue.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment