forked from asciidoctor/asciidoctor-maven-examples
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new example: ascii-multiple-inputs-example
Shows how to output multiple documentation files starting from different input files. The example here is having an end-user manual and technical documentation.
- Loading branch information
Deblauwe, Wim
authored and
Deblauwe, Wim
committed
Jan 11, 2015
1 parent
291bd87
commit af86224
Showing
12 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
= Asciidoctor Maven Plugin: AsciiDoc Multiple Input Documents Maven Example | ||
|
||
An example project that demonstrates how to convert multiple input AsciiDoc documents to HTML5 using the | ||
Asciidoctor Maven plugin. | ||
|
||
== Usage | ||
|
||
Convert the AsciiDoc to HTML5 by invoking the `process-resources` goal (configured as the default goal): | ||
|
||
$ mvn | ||
|
||
Open the files _target/generated-docs/example-manual.html_ and _target/generated-docs/example-technical-doc.html_ in | ||
your browser to see the generated HTML file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?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-multiple-inputs-example</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<name>AsciiDoc Multiple Input Documents Maven Example</name> | ||
<description>An example project that demonstrates how to convert multiple input AsciiDoc documents to HTML5 using the Asciidoctor Maven plugin.</description> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<asciidoctor.maven.plugin.version>1.5.2</asciidoctor.maven.plugin.version> | ||
<jruby.version>1.7.17</jruby.version> | ||
</properties> | ||
|
||
<build> | ||
<defaultGoal>process-resources</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.asciidoctor</groupId> | ||
<artifactId>asciidoctor-maven-plugin</artifactId> | ||
<version>${asciidoctor.maven.plugin.version}</version> | ||
<!-- Uncomment the following element to override the version of AsciidoctorJ --> | ||
<!-- | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.asciidoctor</groupId> | ||
<artifactId>asciidoctorj</artifactId> | ||
<version>1.5.2-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
--> | ||
<configuration> | ||
<sourceDirectory>src/docs/asciidoc</sourceDirectory> | ||
<!-- Attributes common to all output formats --> | ||
<attributes> | ||
<endpoint-url>http://example.org</endpoint-url> | ||
<sourcedir>${project.build.sourceDirectory}</sourcedir> | ||
<project-version>${project.version}</project-version> | ||
</attributes> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>asciidoc-usermanual-to-html</id> | ||
<phase>generate-resources</phase> | ||
<goals> | ||
<goal>process-asciidoc</goal> | ||
</goals> | ||
<configuration> | ||
<sourceDirectory>src/docs/asciidoc/user-manual</sourceDirectory> | ||
<backend>html5</backend> | ||
<sourceHighlighter>coderay</sourceHighlighter> | ||
<attributes> | ||
<imagesdir>./images</imagesdir> | ||
<toc>left</toc> | ||
<icons>font</icons> | ||
<sectanchors>true</sectanchors> | ||
<!-- set the idprefix to blank --> | ||
<idprefix/> | ||
<idseparator>-</idseparator> | ||
<docinfo1>true</docinfo1> | ||
</attributes> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>asciidoc-techdocs-to-html</id> | ||
<phase>generate-resources</phase> | ||
<goals> | ||
<goal>process-asciidoc</goal> | ||
</goals> | ||
<configuration> | ||
<sourceDirectory>src/docs/asciidoc/technical-docs</sourceDirectory> | ||
<backend>html5</backend> | ||
<sourceHighlighter>coderay</sourceHighlighter> | ||
<attributes> | ||
<imagesdir>./images</imagesdir> | ||
<toc>left</toc> | ||
<icons>font</icons> | ||
<sectanchors>true</sectanchors> | ||
<!-- set the idprefix to blank --> | ||
<idprefix/> | ||
<idseparator>-</idseparator> | ||
<docinfo1>true</docinfo1> | ||
</attributes> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
9 changes: 9 additions & 0 deletions
9
...iple-inputs-example/src/docs/asciidoc/technical-docs/example-technical-doc.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
= Example Technical Documentation | ||
Doc Writer <doc.writer@example.org> | ||
2014-09-09 | ||
:revnumber: {project-version} | ||
:example-caption!: | ||
ifndef::imagesdir[:imagesdir: images] | ||
ifndef::sourcedir[:sourcedir: ../java] | ||
|
||
This is the technical documentation for an example project. |
1 change: 1 addition & 0 deletions
1
asciidoc-multiple-inputs-example/src/docs/asciidoc/user-manual/docinfo.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.js"></script> |
54 changes: 54 additions & 0 deletions
54
asciidoc-multiple-inputs-example/src/docs/asciidoc/user-manual/example-manual.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
= Example Manual | ||
Doc Writer <doc.writer@example.org> | ||
2014-09-09 | ||
:revnumber: {project-version} | ||
:example-caption!: | ||
ifndef::imagesdir[:imagesdir: images] | ||
ifndef::sourcedir[:sourcedir: ../java] | ||
|
||
This is a user manual for an example project. | ||
|
||
== Introduction | ||
|
||
This project does something. | ||
We just haven't decided what that is yet. | ||
|
||
== Source Code | ||
|
||
[source,java] | ||
.Java code from project | ||
---- | ||
include::{sourcedir}/example/StringUtils.java[tags=contains,indent=0] | ||
---- | ||
|
||
This page was built by the following command: | ||
|
||
$ mvn | ||
|
||
== Images | ||
|
||
[.thumb] | ||
image::sunset.jpg[scaledwidth=75%] | ||
|
||
== Attributes | ||
|
||
.Built-in | ||
asciidoctor-version:: {asciidoctor-version} | ||
safe-mode-name:: {safe-mode-name} | ||
docdir:: {docdir} | ||
docfile:: {docfile} | ||
imagesdir:: {imagesdir} | ||
|
||
.Custom | ||
project-version:: {project-version} | ||
sourcedir:: {sourcedir} | ||
endpoint-url:: {endpoint-url} | ||
|
||
== Includes | ||
|
||
.include::subdir/_b.adoc[] | ||
==== | ||
include::subdir/_b.adoc[] | ||
==== | ||
|
||
WARNING: Includes can be tricky! |
Binary file added
BIN
+120 KB
asciidoc-multiple-inputs-example/src/docs/asciidoc/user-manual/images/sunset.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions
7
asciidoc-multiple-inputs-example/src/docs/asciidoc/user-manual/subdir/_b.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
content from _src/docs/asciidoc/subdir/_b.adoc_. | ||
|
||
.include::_c.adoc[] | ||
[example] | ||
-- | ||
include::_c.adoc[] | ||
-- |
1 change: 1 addition & 0 deletions
1
asciidoc-multiple-inputs-example/src/docs/asciidoc/user-manual/subdir/_c.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
content from _src/docs/asciidoc/subdir/c.adoc_. |
9 changes: 9 additions & 0 deletions
9
asciidoc-multiple-inputs-example/src/main/java/example/StringUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package example; | ||
|
||
public class StringUtils { | ||
// tag::contains[] | ||
public boolean contains(String haystack, String needle) { | ||
return haystack.contains(needle); | ||
} | ||
// end::contains[] | ||
} |
Binary file added
BIN
+12.5 KB
...doctor-diagram-example/src/docs/asciidoc/images/asciidoctor-diagram-process.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
asciidoctor-diagram-example/src/docs/asciidoc/images/asciidoctor-diagram-process.png.cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"checksum":"b5a864e58455504e8ce386cae8490a92","width":540,"height":280} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters