Edit: Since my problem seems to be specific to my setup, I provide a complete minimal working example here.
This is my maven setup (pom.xml
):
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>foo</groupId>
<artifactId>bar</artifactId>
<version>1.0-SNAPSHOT</version>
<name>AsciiDoc Test</name>
<build>
<plugins>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>1.5.3</version>
<dependencies>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-pdf</artifactId>
<version>1.5.0-alpha.11</version>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj</artifactId>
<version>1.5.4</version>
</dependency>
<!-- beware, jruby 1.7.23 breaks asciidoctorj -->
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<version>1.7.21</version>
</dependency>
</dependencies>
<configuration>
<sourceDirectory>${project.basedir}/src</sourceDirectory>
</configuration>
<executions>
<execution>
<id>generate-pdf-doc</id>
<phase>generate-resources</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration>
<backend>pdf</backend>
<doctype>book</doctype>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
This is my AsciiDoc source (src/test.adoc
):
[cols="a"]
|===
|First paragraph
second paragraph
|===
The AsciiDoc file is compiled with:
mvn generate-resources
This is the generated output (target/generated-docs/test.pdf
)
Why doesn't AsciiDoc render two paragraphs?
Other things that do not work as expected (every example pushes the whole cell content in one paragraph):
a
for the cell:|===
a|First paragraph
second paragraph
|===
[cols="a"]
|===
|First paragraph
* second paragraph
|===
[cols="1"]
|===
a|First paragraph
second paragraph
|===
AsciiDoc is a text document format that was explicitly designed with the needs of publishing in mind, both print and web. It supports all the structural elements necessary for writing notes, documentation, articles, books, ebooks, slideshows, web pages, technical manuals and blogs.
To define a link in Asciidoc markup we only have to type the URL followed by an optional text for the link in square brackets ( [text link] ).
From the documentation: http://asciidoctor.org/docs/user-manual/#cell
The direct Asciidoctor PDF rendering do not support this yet. See #6
This is what I get:
[cols="1"]
|===
a|First paragraph
second paragraph
|===
The relevant thing is the empty line between |==
and a|your cell
With the HTML renderer:
With the PDF renderer:
It works the same way:
[cols="1"]
|===
a|First paragraph
* second paragraph
|===
With the HTML renderer:
With the PDF renderer:
A possible solution might be to use the DocBook Pipeline with jDocBook as in this example docbook-pipeline-jdocbook-example. With this setup I get the expected output:
I don't know anything about Maven and I don't use AsciiDoctor for PDF output, but the proposed answer could be (probably, not sure) outdated. Here is another solution (works for HTML for me. I post it here because I haven't found this syntax in official manual):
|===
| Column 1 | Column 2
| Foo
| Bar
Baz
| Aaa
Bbb
| Ccc
|===
I haven't found any examples of this syntax in official manual. The syntax was taken from here:
Rendered HTML: https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#text-replacement
It's source:
https://github.com/asciidoctor/asciidoctor.org/blob/master/docs/asciidoc-syntax-quick-reference.adoc#text-replacement
https://github.com/asciidoctor/asciidoctor.org/blob/master/docs/_includes/subs-symbol-repl.adoc - here it is!
The same, if one prefer multiline syntax in header:
[cols="2"]
[options="header"]
|===
| Column 1
| Column 2
| Foo
| Bar
Baz
| Aaa
Bbb
| Ccc
|===
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With