Skip to content

Commit

Permalink
Add new asciidoc-maven-site-parser-example example
Browse files Browse the repository at this point in the history
* Rename asciidoc-maven-site-example to asciidoc-maven-site-converter-example
  • Loading branch information
abelsromero committed Feb 17, 2024
1 parent feee067 commit a940e10
Show file tree
Hide file tree
Showing 22 changed files with 471 additions and 9 deletions.
7 changes: 5 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ Demonstrates how to convert AsciiDoc to PDF using Asciidoctor PDF with the Ascii
link:asciidoctor-epub-example/README.adoc[asciidoctor-epub-example]::
Demonstrates how to convert AsciiDoc to epub using Asciidoctor EPUB with the Asciidoctor Maven plugin. (contains also an example for .mobi (Kindle) output)

link:asciidoc-maven-site-example/README.adoc[asciidoc-maven-site-example]::
Demonstrates how to process AsciiDoc in a Maven site using the Asciidoctor Maven plugin.
link:asciidoc-maven-site-converter-example/README.adoc[asciidoc-maven-site-converter-example]::
Demonstrates how to process AsciiDoc in a Maven site using the Asciidoctor Converter Doxia Module.

link:asciidoc-maven-site-parser-example/README.adoc[asciidoc-maven-site-parser-example]::
Demonstrates how to process AsciiDoc in a Maven site using the Asciidoctor Parser Doxia Module.

link:asciidoc-multiple-inputs-example/README.adoc[asciidoc-multiple-inputs-example]::
An example project that demonstrates how to convert multiple input AsciiDoc documents to HTML5 and PDF using the
Expand Down
14 changes: 14 additions & 0 deletions asciidoc-maven-site-converter-example/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
= Asciidoctor Maven Plugin (Converter Module): AsciiDoc Site Example

An example project that demonstrates how to process AsciiDoc in a Maven site using the Asciidoctor Converter Doxia Module.

== Usage

Build the site by invoking the `site:site` goal:

$ mvn site:site

Open the file _target/site/hello.html_ to see the output generated from the AsciiDoc source _src/site/asciidoc/hello.adoc_.

Open the file _target/site/index.html_ to see the output generated for the entire site including the link to the `hello` document.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
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>org.asciidoctor.maven</groupId>
<artifactId>asciidoc-maven-site-example</artifactId>
<artifactId>asciidoc-maven-site-converter-example</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>AsciiDoc Maven Site Example</name>
<description>An example project that demonstrates how to process AsciiDoc in a Maven site using the Asciidoctor Maven plugin.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
<version>1.11.0</version>
<version>1.12.0</version>
</skin>
</project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Asciidoctor Maven Plugin: AsciiDoc Site Example
= Asciidoctor Maven Plugin (Parser Module): AsciiDoc Site Example

An example project that demonstrates how to process AsciiDoc in a Maven site using the Asciidoctor Maven plugin.
An example project that demonstrates how to process AsciiDoc in a Maven site using the Asciidoctor Parser Doxia Module.

== Usage

Expand Down
77 changes: 77 additions & 0 deletions asciidoc-maven-site-parser-example/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>org.asciidoctor.maven</groupId>
<artifactId>asciidoc-maven-site-parser-example</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>AsciiDoc Maven Site Example</name>
<description>An example project that demonstrates how to process AsciiDoc in a Maven site using the Asciidoctor Maven plugin.</description>

<!-- All Maven properties are injected as Asciidoctor attributes.
Reference them with the same name replacing dots by dashes (e.g. {jruby-version}). -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<asciidoctor.maven.plugin.version>3.0.0</asciidoctor.maven.plugin.version>
<asciidoctorj.version>2.5.11</asciidoctorj.version>
<jruby.version>9.4.5.0</jruby.version>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.12.1</version>
<configuration>
<!-- Disable generateReports if you don't want to include the built-in reports -->
<generateReports>true</generateReports>
<generateSitemap>true</generateSitemap>
<relativizeDecorationLinks>false</relativizeDecorationLinks>
<locales>en</locales>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
<asciidoc>
<!-- Optional site-wide AsciiDoc attributes -->
<attributes>
<icons>font</icons>
<!-- Add required rouge styles in '/css/site.css' -->
<source-highlighter>rouge</source-highlighter>
<toclevels>2</toclevels>
</attributes>
</asciidoc>
</configuration>
<dependencies>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-parser-doxia-module</artifactId>
<version>${asciidoctor.maven.plugin.version}</version>
</dependency>
<!-- Comment this section to use the default jruby artifact provided by the plugin -->
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby</artifactId>
<version>${jruby.version}</version>
</dependency>
<!-- Comment this section to use the default AsciidoctorJ artifact provided by the plugin -->
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj</artifactId>
<version>${asciidoctorj.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

<reporting>
<plugins>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.5.0</version>
</plugin>
</plugins>
</reporting>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
== Attributes

.Built-in
asciidoctor-version:: {asciidoctor-version}
safe-mode-name:: {safe-mode-name}
docdir:: {docdir}

.Maven properties
asciidoctor.maven.plugin.version:: {asciidoctor-maven-plugin-version}
asciidoctorj.version:: {asciidoctorj-version}
jruby.version:: {jruby-version}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
included content
60 changes: 60 additions & 0 deletions asciidoc-maven-site-parser-example/src/site/asciidoc/article.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
= AsciiDoc is Writing Zen
Doc Writer <doc[email protected]>
//Junior Writer <junior[email protected]>
v1.0, 2014-08-08
//:toc:
:icons: font
:source-highlighter: rouge
:sectanchors:
//:compat-mode:

_Zen_ in the *art* of writing `plain text` with https://asciidoc.org[AsciiDoc].

[TIP]
Use https://asciidoctor.org[Asciidoctor] for the best AsciiDoc experience.footnote:[Not to mention the best looking output!]
Then icon:twitter[role=aqua] about it!

toc::[]

== Sample Section

=== Unordered list

* item 1
* item 2

=== Ordered list

. item 1
. item 2

=== Table

[caption=]
.Ruby platforms
|===
|Name |Language

|MRI |C
|JRuby |Java
|Opal |JavaScript
|Rubinius |Ruby
|===

=== Code blocks

[source,ruby]
----
puts "Hello, World!"
----

[source,java]
----
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
----

include::_attributes.adoc[]
16 changes: 16 additions & 0 deletions asciidoc-maven-site-parser-example/src/site/asciidoc/hello.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
= Hello, AsciiDoc!
//:icons: font

This file was converted from AsciiDoc to HTML by the Maven Site module of the Asciidoctor Maven Plugin.

image::images/tiger.png[Ghostscript Tiger]
_By Ghostscript authors (GPL Ghostscript SVN: tiger.eps) [GPL (https://www.gnu.org/licenses/gpl.html)], via Wikimedia Commons_

[TIP]
====
Use the include directive to keep your content DRY!
include::_include.adoc[]
====

include::_attributes.adoc[]
Loading

0 comments on commit a940e10

Please sign in to comment.