/
, unlike Asciidoctor
+ assertThat(html)
+ .isEqualTo("
" +
+ dt("CPU") + dd("The brain of the computer.") +
+ dt("RAM") + dd("Temporarily stores information the CPU uses during operation.") +
+ "
");
+ }
+
+ @Test
+ void should_convert_simple_list_with_formatting() {
+ String content = buildDocumentWithSimpleListWithFormatting();
+
+ String html = process(content);
+
+ assertThat(html)
+ .isEqualTo("
" +
+ dt(strong("CPU")) + dd("The brain of " + italics("the computer") + ".") +
+ dt(monospace("RAM")) + dd(strong("Temporarily stores information") + " the CPU uses during operation.") +
+ "
");
+ }
+
+ @Test
+ void should_convert_simple_list_with_nested_list() {
+ String content = buildDocumentWithNestedLists();
+
+ String html = process(content);
+
+ assertThat(html)
+ .isEqualTo("
" +
+ dt("Dairy") +
+ "- " +
+ ul(li("Milk"), li("Eggs")) +
+ "
" +
+ dt("Bakery") +
+ "- " +
+ ol(LIST_STYLE_TYPE_DECIMAL, li("Bread")) +
+ "
" +
+ "
"
+ );
+ }
+
+ @Test
+ void should_convert_nested_description_lists() {
+ String content = buildDocumentWithNestedDescriptionLists();
+
+ String html = process(content);
+
+ assertThat(html)
+ .isEqualTo("
" +
+ dt("Operating Systems") +
+ "- " +
+ "
" +
+
+ dt("Linux") +
+ "- " +
+ ol(LIST_STYLE_TYPE_DECIMAL,
+ li("Fedora" + ul(li("Desktop"))),
+ li("Ubuntu" + ul(li("Desktop"), li("Server")))
+ ) +
+ "
" +
+ dt("BSD") +
+ "- " +
+ ol(LIST_STYLE_TYPE_DECIMAL, li("FreeBSD"), li("NetBSD")) +
+ "
" +
+ "
" +
+
+ " " +
+ "
"
+ );
+ }
+
+ private static String buildDocumentWithSimpleList() {
+ return "= Document tile\n\n"
+ + "== Section\n\n"
+ + "CPU:: The brain of the computer.\n"
+ + "RAM:: Temporarily stores information the CPU uses during operation.\n";
+ }
+
+ private static String buildDocumentWithSimpleListWithFormatting() {
+ return "= Document tile\n\n"
+ + "== Section\n\n"
+ + "*CPU*:: The brain of _the computer_.\n"
+ + "`RAM`:: *Temporarily stores information* the CPU uses during operation.\n";
+ }
+
+ private static String buildDocumentWithNestedLists() {
+ return "= Document tile\n\n"
+ + "== Section\n\n"
+ + "Dairy::\n"
+ + "* Milk\n"
+ + "* Eggs\n"
+ + "Bakery::\n"
+ + ". Bread\n";
+ }
+
+ private static String buildDocumentWithNestedDescriptionLists() {
+ return "= Document tile\n\n"
+ + "== Section\n\n"
+ + "Operating Systems::\n"
+ + " Linux:::\n"
+ + " . Fedora\n"
+ + " * Desktop\n"
+ + " . Ubuntu\n"
+ + " * Desktop\n"
+ + " * Server\n"
+ + " BSD:::\n"
+ + " . FreeBSD\n"
+ + " . NetBSD\n";
+ }
+
+ private String process(String content) {
+ StructuralNode node = asciidoctor.load(content, Options.builder().build())
+ .findBy(Collections.singletonMap("context", ":dlist"))
+ .get(0);
+
+ nodeProcessor.process(node);
+
+ return clean(sinkWriter.toString());
+ }
+}
diff --git a/asciidoctor-parser-doxia-module/src/test/java/org/asciidoctor/maven/site/ast/processors/test/Html.java b/asciidoctor-parser-doxia-module/src/test/java/org/asciidoctor/maven/site/ast/processors/test/Html.java
new file mode 100644
index 00000000..d3e9abf6
--- /dev/null
+++ b/asciidoctor-parser-doxia-module/src/test/java/org/asciidoctor/maven/site/ast/processors/test/Html.java
@@ -0,0 +1,49 @@
+package org.asciidoctor.maven.site.ast.processors.test;
+
+public class Html {
+
+ public static final String LIST_STYLE_TYPE_DECIMAL = "list-style-type: decimal";
+
+ public static String strong(String text) {
+ return htmlElement("strong", text);
+ }
+
+ public static String italics(String text) {
+ return htmlElement("em", text);
+ }
+
+ public static String monospace(String text) {
+ return htmlElement("code", text);
+ }
+
+ public static String ul(String... elements) {
+ return htmlElement("ul", String.join("", elements));
+ }
+
+ public static String ol(String style, String... elements) {
+ return htmlElement("ol", style, String.join("", elements));
+ }
+
+ public static String li(String text) {
+ return htmlElement("li", text);
+ }
+
+ public static String dt(String text) {
+ return htmlElement("dt", text);
+ }
+
+ public static String dd(String text) {
+ return htmlElement("dd", text);
+ }
+
+ static String htmlElement(String element, String text) {
+ return htmlElement(element, null, text);
+ }
+
+ static String htmlElement(String element, String style, String text) {
+ if (style == null) {
+ return String.format("<%1$s>%2$s%1$s>", element, text).trim();
+ }
+ return String.format("<%1$s style=\"%3$s\">%2$s%1$s>", element, text, style).trim();
+ }
+}
diff --git a/docs/modules/site-integration/pages/parser-module-setup-and-configuration.adoc b/docs/modules/site-integration/pages/parser-module-setup-and-configuration.adoc
index 870693d2..154f5750 100644
--- a/docs/modules/site-integration/pages/parser-module-setup-and-configuration.adoc
+++ b/docs/modules/site-integration/pages/parser-module-setup-and-configuration.adoc
@@ -71,7 +71,8 @@ Make sure you add a `menu` item for each page so you can access it from the site
Given the modules implements a custom converter, the following features are limited:
* `templateDirs` configurations are not supported in this module.
-* Extensions injected with `requires` can only modify the AST. Modifications of output won't be applied.
+* Extensions injected with `requires` can only modify the AST.
+Modifications of output won't be applied.
====
As of version 1.5.3 of the plugin, you can configure Asciidoctor by specifying configuration properties in the plugin declaration, just like with the other goals of the plugin.
@@ -171,13 +172,16 @@ This module is still under development, here is a summary of supported features:
** Support for `sectnums` and `sectnumlevels`
* Paragraphs
-** Basic formatting (bold, italics, etc.)
+** Basic formatting (bold, italics, monospace, etc.)
** Attributes substitutions
* Lists
** Unordered, for `*` and `-` markers
** Ordered, only arabic numerals
+** Description lists, with nested ordered, unordered and description lists
** Formatted text in list items
++
+NOTE: Unlike in Asciidoctor lists, descriptions are not surrounded by `
` and list themselves are not surrounded by `
` elements.
* Code blocks with source-highlighting using https://maven.apache.org/skins/maven-fluido-skin/#source-code-line-numbers[Fluido Skin Pretiffy].
** Support for numbered lines with `linenums`