Skip to content

Commit 90eb46e

Browse files
authored
devonfw#12: avoid JS, devonfw#13: use parent, devonfw#14: increase UX (devonfw#15)
1 parent 91e1646 commit 90eb46e

15 files changed

+524
-451
lines changed

.gitignore

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
/target
2-
/.settings
31
*.class
42
*.classpath
53
*.project
64
*.iml
5+
*.jar
6+
*.war
7+
*.ear
78
.*
9+
!.gitignore
10+
!.travis.yml
11+
!.mvn
812
target/
9-
jsclient/
1013
eclipse-target/
1114
**/src/generated/
1215
**/tmp/
1316

14-
# Package Files #
15-
*.jar
16-
*.war
17-
*.ear
17+
#Special case only in docgen cause documentation is copied to modules
18+
all/documentation
19+
pdf/documentation
20+
init/documentation
21+
html/documentation

.mvn/maven.config

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Drevision=5.0.0 -Dchangelist=-SNAPSHOT

README.asciidoc

+9-152
Original file line numberDiff line numberDiff line change
@@ -1,160 +1,17 @@
1-
:toc: right
1+
= devonfw-docgen
22

3-
= devonfw Documentation Generator
4-
The devonfw community
5-
${project.version}, ${buildtime}: Subtitle {doctitle}
6-
7-
:toc:
8-
toc::[]
3+
`devonfw-docgen` is a tool that can generate a complete and self-contained documentation as PDF, ePub or HTML from Asciidoc pages.
94

105
image:https://img.shields.io/github/license/devonfw/devon-docgen.svg?label=License["Apache License, Version 2.0",link=https://github.com/devonfw/devon-docgen/blob/develop/LICENSE]
116
image:https://img.shields.io/maven-central/v/com.devonfw.tools/devon-docgen.svg?label=Maven%20Central["Maven Central",link=https://search.maven.org/search?q=g:com.devonfw.tools+a:devon-docgen]
127
image:https://travis-ci.org/devonfw/devon-docgen.svg?branch=master["Build Status",link="https://travis-ci.org/devonfw/devon-docgen"]
138

14-
DocGen is a tool that can generate a complete and self-contained documentation as PDF and HTML from Asciidoc wiki pages.
15-
16-
== Features
17-
With DocGen you can
18-
19-
* maintain documentation on github wiki as individual pages using http://www.methods.co.nz/asciidoc[asciidoc] based on our xref:guidelines[guidelines].
20-
* generate a single and self-contained document as `PDF` or `HTML` from it
21-
* convert links between wiki pages into document internal links
22-
* have a single table of contents per complete document as well as per wiki page
23-
24-
== Setup
25-
26-
1. Clone your github wiki using git to your local machine
27-
2. Create a pom.xml in the cloned wiki directory with the following content:
28-
+
29-
```xml
30-
<project xmlns="http://maven.apache.org/POM/4.0.0"
31-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
32-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33-
34-
<modelVersion>4.0.0</modelVersion>
35-
<parent>
36-
<groupId>com.devonfw.tools</groupId>
37-
<artifactId>devon-docgen</artifactId>
38-
<version>4.0.0</version>
39-
</parent>
40-
<groupId>my.group.id</groupId>
41-
<artifactId>my-artifact-id</artifactId>
42-
<version>1.0.0-SNAPSHOT</version>
43-
<packaging>jar</packaging>
44-
<name>My Cool Wiki</name>
45-
46-
<properties>
47-
<docgen.wiki.page>my-main-page</docgen.wiki.page>
48-
</properties>
49-
50-
<!-- run "mvn package -Doutput.format=pdf" and get the PDF result in target/generated-docs/*.pdf -->
51-
52-
<!-- run "mvn package -Doutput.format=html" and get the HTML5 result in target/generated-docs/* -->
53-
54-
</project>
55-
```
56-
3. Add, commit and push it to github:
57-
+
58-
[source,cmd]
59-
--------
60-
git add pom.xml
61-
git commit -m "added pom.xml for docgen"
62-
git push
63-
--------
64-
4. Optional custom theme:
65-
You can develop your own style by using the asciidoctor facilities. Therefore create your own theme in the path `theme/custom-theme.yml` and also push it to the wiki git repo.
66-
67-
== Usage
68-
To start the generation manually you need to clone the wiki with the documentation to generate as described above. Then open a command shell in the cloned project and call:
69-
[source,cmd]
70-
--------
71-
mvn clean package
72-
--------
73-
74-
Then you will find the result in `target/generated-docs/`.
75-
76-
If you want to deploy your documentation to maven central run:
77-
[source,cmd]
78-
--------
79-
mvn deploy -Dgpg.keyname=<yourkeyname> -Poss
80-
--------
81-
82-
It is a common practice to store all the images used in a folder called "images", so docgen search in "images" as default. If you want to specify other directory or multiple, it can be done as follows:
83-
84-
[source,cmd]
85-
--------
86-
mvn clean package -Doutput.format=pdf -Ddocgen.images.dir=images1,images2,...,imagesn
87-
--------
88-
89-
== Guidelines
90-
In order to make DocGen work properly please follow these guidelines:
91-
92-
* Maintain the documentation as collection of wiki pages.
93-
* For the wiki usage link (important) pages in the sidebar for navigation.
94-
* Use http://www.methods.co.nz/asciidoc/[AsciiDoc] for all wiki pages. This is not the default on github. Always switch `Edit mode` to `AsciiDoc` when creating new wiki pages.
95-
* For help on the syntax consult the http://asciidoctor.org/docs/asciidoc-writers-guide/[writers guide] and the https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/[quick reference].
96-
* Start every page with the following AsciiDoc header:
97-
+
98-
[source,asciidoc]
99-
--------
100-
:toc: macro
101-
toc::[]
102-
:idprefix:
103-
:idseparator: -
104-
--------
105-
+
106-
* In order to make internal links work both in wiki as well as in generated documentation (PDF, ePub, HTML) you need to stick to this rules:
107-
** Do not use special characters (dot, ampersand, etc.) in section titles (use plain text e.g. "My Section")
108-
** If you link to a section, you simply use the section title in lower case with hyphens instead of spaces (e.g. "my-section"). Within the same wiki page you use `xref` (e.g. `xref :my-section[link title]`) and between wiki pages you use `link` (e.g. `link :guide-my-topic#my-section[link title]`).
109-
** In case you want to reference the top-level section of a wiki page you need to use +link+ without a section reference (e.g. `link :guide-my-topic[link title]`) and NOT `xref` even if you place the link within the same wiki page.
110-
** From wiki pages included in the generated documentation only use `link:` to other wiki pages that will also be part of the generated documentation. Otherwise you would produce dead links.
111-
* For editing larger files and offline work we recommend to clone the wiki with git and use an xref:asciidoc-tools[AsciiDoc editor tool].
112-
* You need to ensure that the files use UTF-8 as encoding.
113-
* To include images you need to follow this rules:
114-
** The best choice for high quality rendering is `SVG`. As the wiki does not create mimetypes you have to
115-
put the image on the https://github.com/devonfw/devonfw.github.io/[github pages].
116-
** You have to set the size so it gets properly rendered in the PDF. The width value to make it fit properly on the PDF page is `450`:
117-
+
118-
[source,asciidoc]
119-
--------
120-
.Image Title
121-
image::http://devonfw.github.io/devon4j/images/MyImage.svg["alt-text", width="450", link="http://devonfw.github.io/devon4j/images/MyImage.svg"]
122-
--------
123-
* For devonfw the wiki pages belong to categories that are also reflected by a naming convention:
124-
** `coding-*` is used for pages about general aspects to development and writing code.
125-
** `guide-*` is used for pages that act as a guide to a specific topic. It describes what to do and how to do it for that topic from the perspective of a developer.
126-
** `alternative-*` is used for pages that are not part of the suggested standard but are commonly used or popular alternatives to a proposed standard solution. Such page explains how to use such an alternative solution.
127-
** `architecture` is reserved for the architecture documentation.
128-
** `introduction-*` is used for pages that are part of the introduction into the documentation (motivation and general goals).
129-
** `devon-*` is used for pages that are about the devonfw itself and will not be part of the official documentation.
130-
** `tutorial-*` is used for pages that are part of the tutorials.
131-
132-
== Migration
133-
If you migrate from devon-docgen 3.x to 4.x generating PDFs, you now have to add `-Doutput.format=pdf` to your maven build command. Similarly, for html generation it would be `-Doutput.format=html`.
134-
135-
== Tooling
136-
Our DocGen tool is technically based on the following tools:
137-
138-
* http://maven.apache.org[maven]
139-
* http://asciidoctor.org[asciidoctor]
140-
** via http://asciidoctor.org/docs/asciidoctor-maven-plugin[asciidoctor-maven-plugin]
141-
* http://www.docbook.org[docbook]
142-
** via http://docbkx-tools.sourceforge.net/docbkx-maven-plugin/plugin-info.html[docbkx-maven-plugin]
143-
** using http://docbook.sourceforge.net/release/xsl/current[docbook XSL distribution]
144-
* http://ant.apache.org[ant]
145-
** via http://maven.apache.org/plugins/maven-antrun-plugin[maven-antrun-plugin]
146-
147-
This setup was inspired by https://github.com/spring-projects/spring-boot/tree/master/spring-boot-docs/[spring-boot-docs] and improved for link processing, etc.
148-
Feel free to get inspired here or copy the entire solution if you like it.
149-
Thanks to all authors of the actual tools and to spring-boot for making this great DocGen happen.
9+
== Documentation
15010

151-
== AsciiDoc Tools
152-
You can checkout a github wiki as a git repository and edit it with an editor of your choice. For this we recommend the following tools:
11+
* link:documentation/features.asciidoc[Features]
12+
* link:documentation/usage.asciidoc[Usage]
13+
* link:documentation/guidelines.asciidoc[Guidelines]
14+
* link:documentation/migration.asciidoc[Migration]
15+
* link:documentation/tools.asciidoc[AsciiDoc Tools]
16+
* link:documentation/credits.asciidoc[Credits]
15317

154-
* http://www.asciidocfx.com/[AsciiDocFx]
155-
* https://plugins.jetbrains.com/plugin/7391-asciidoc[AsciiDoc for IntelliJ]
156-
* https://marketplace.visualstudio.com/items?itemName=joaompinto.asciidoctor-vscode[AsciiDoc for VS Code]
157-
* https://addons.mozilla.org/fr/firefox/addon/asciidoctorjs-live-preview/[Asciidoc for Firefox]
158-
* https://chrome.google.com/webstore/detail/asciidoctorjs-live-previe/iaalpfgpbocpdfblpnhhgllgbdbchmia[Asciidoc for Chrome]
159-
* https://atom.io/packages/asciidoc-preview[Asciidoc preview for Atom] and https://atom.io/packages/language-asciidoc[Asciidoc language for Atom]
160-
* https://github.com/asciidoctor/brackets-asciidoc-preview[Asciidoc for Brackets]

all/pom.xml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>com.devonfw.tools</groupId>
8+
<artifactId>devonfw-docgen</artifactId>
9+
<version>5.0.0-SNAPSHOT</version>
10+
</parent>
11+
<artifactId>devonfw-docgen-all</artifactId>
12+
<packaging>pom</packaging>
13+
<name>${project.artifactId}</name>
14+
<description>Generates documentation as PDF and HTML from AsciiDoc pages.</description>
15+
16+
<build>
17+
<plugins>
18+
<plugin>
19+
<groupId>org.asciidoctor</groupId>
20+
<artifactId>asciidoctor-maven-plugin</artifactId>
21+
<executions>
22+
<execution>
23+
<id>generate-html</id>
24+
<phase>compile</phase>
25+
<goals>
26+
<goal>process-asciidoc</goal>
27+
</goals>
28+
<configuration>
29+
<backend>html5</backend>
30+
<sourceHighlighter>highlightjs</sourceHighlighter>
31+
</configuration>
32+
</execution>
33+
</executions>
34+
</plugin>
35+
36+
<plugin>
37+
<groupId>org.codehaus.mojo</groupId>
38+
<artifactId>build-helper-maven-plugin</artifactId>
39+
<executions>
40+
<execution>
41+
<id>attach-pdf</id>
42+
<goals>
43+
<goal>attach-artifact</goal>
44+
</goals>
45+
<phase>package</phase>
46+
<configuration>
47+
<skip>${asciidoctor.skip}</skip>
48+
<artifacts>
49+
<artifact>
50+
<file>${docgen.generated.docs}/${docgen.asciidoc.page}.pdf</file>
51+
<type>pdf</type>
52+
</artifact>
53+
</artifacts>
54+
<archive>
55+
<addMavenDescriptor>true</addMavenDescriptor>
56+
</archive>
57+
</configuration>
58+
</execution>
59+
</executions>
60+
</plugin>
61+
</plugins>
62+
</build>
63+
</project>

documentation/credits.asciidoc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
= Credits
2+
3+
`devonfw-docgen` tool is technically based on the following tools:
4+
5+
* http://maven.apache.org[maven]
6+
* http://asciidoctor.org[asciidoctor]
7+
** via http://asciidoctor.org/docs/asciidoctor-maven-plugin[asciidoctor-maven-plugin]
8+
* http://ant.apache.org[ant]
9+
** via http://maven.apache.org/plugins/maven-antrun-plugin[maven-antrun-plugin]
10+
11+
This setup was inspired by https://github.com/spring-projects/spring-boot/tree/master/spring-boot-docs/[spring-boot-docs] and improved for link processing, ease of use, etc.
12+
Feel free to get inspired here or copy the entire solution if you like it.
13+
Thanks to all authors of the actual tools and to spring-boot for making this great `devonfw-docgen` possible.

documentation/features.asciidoc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
= Features
2+
With devonfw-docgen you can
3+
4+
* maintain documentation on github in a folder together with you code or in github wiki as individual pages using http://www.methods.co.nz/asciidoc[asciidoc] based on our link:guidelines.asciidoc[guidelines].
5+
* generate a single and self-contained document as `PDF`, `ePub` or `HTML` from it
6+
* convert links between wiki pages into document internal links
7+
* have a single table of contents per complete document as well as per wiki page

documentation/guidelines.asciidoc

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
= Guidelines
2+
In order to make `devonfw-docgen` work properly please follow these guidelines:
3+
4+
* Maintain the documentation as collection of http://www.methods.co.nz/asciidoc/[AsciiDoc] pages.
5+
* If you are using github wikis this is not the default: Always switch `Edit mode` to `AsciiDoc` when creating new wiki pages.
6+
* For help on the syntax consult the http://asciidoctor.org/docs/asciidoc-writers-guide/[writers guide] and the https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/[quick reference].
7+
* Start every page with the following AsciiDoc header:
8+
+
9+
[source,asciidoc]
10+
--------
11+
:toc: macro
12+
toc::[]
13+
:idprefix:
14+
:idseparator: -
15+
--------
16+
+
17+
* In order to make internal links work both in asciidoc pages as well as in generated documentation (PDF, ePub, HTML) you need to stick to this rules:
18+
** Do not use special characters (dot, ampersand, etc.) in section titles (use plain text e.g. "My Section")
19+
** If you link to a section, you simply use the section title in lower case with hyphens instead of spaces (e.g. "my-section"). Within the same asciidoc page you use `xref` (e.g. `xref :my-section[link title]`) and between asciidoc pages you use `link` (e.g. `link :«pagename».asciidoc#«section-name»[«link title»]`).
20+
** In case you want to reference the top-level section of a wiki page you need to use +link+ without a section reference (e.g. `link :«pagename».asciidoc[«link title»]`) and NOT `xref` even if you place the link within the same asciidoc page.
21+
** From asciidoc pages included in the generated documentation only use `link:` to other asciidoc pages that will also be part of the generated documentation. Otherwise you would produce dead links.
22+
* For editing larger files and offline work we recommend to clone the asciidoc documentation with git and use an xref:asciidoc-tools[AsciiDoc editor tool].
23+
* You need to ensure that the files use UTF-8 as encoding.
24+
* To include images you need to follow this rules:
25+
** The best choice for high quality rendering is `SVG`. As the wiki does not create mimetypes you have to
26+
put the image on the https://github.com/devonfw/devonfw.github.io/[github pages].
27+
** You have to set the size so it gets properly rendered in the PDF. The width value to make it fit properly on the PDF page is `450`:
28+
+
29+
[source,asciidoc]
30+
--------
31+
.Image Title
32+
image::http://devonfw.github.io/devon4j/images/«MyImage».«format»["alt-text", width="450", link="http://devonfw.github.io/devon4j/images/«MyImage».«format»"]
33+
--------
34+
* For devonfw the asciidoc pages belong to categories that are also reflected by a naming convention:
35+
** `coding-*` is used for pages about general aspects to development and writing code.
36+
** `guide-*` is used for pages that act as a guide to a specific topic. It describes what to do and how to do it for that topic from the perspective of a developer.
37+
** `alternative-*` is used for pages that are not part of the suggested standard but are commonly used or popular alternatives to a proposed standard solution. Such page explains how to use such an alternative solution.
38+
** `architecture` is reserved for the architecture documentation.
39+
** `introduction-*` is used for pages that are part of the introduction into the documentation (motivation and general goals).
40+
** `devonfw-*` is used for pages that are about the devonfw itself and will not be part of the official documentation.
41+
** `tutorial-*` is used for pages that are part of the tutorials.

documentation/master.asciidoc

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
= devonfw Documentation Generator
2+
The devonfw community
3+
${project.version}, ${buildtime}: Subtitle {doctitle}
4+
:sectnums:
5+
:toc:
6+
:toc-title: Table of Contents
7+
toc::[]
8+
9+
DocGen is a tool that can generate a complete and self-contained documentation as PDF, ePub or HTML from Asciidoc pages.
10+
11+
include::features.asciidoc[leveloffset=1]
12+
13+
include::usage.asciidoc[leveloffset=1]
14+
15+
include::guidelines.asciidoc[leveloffset=1]
16+
17+
include::migration.asciidoc[leveloffset=1]
18+
19+
include::tools.asciidoc[leveloffset=1]
20+
21+
include::credits.asciidoc[leveloffset=1]

documentation/migration.asciidoc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
= Migration
2+
3+
If you migrate from `devon-docgen` to `devonfw-docgen` (5.0.0+), you have to choose your target output format to generate via the `artifactId` of the `docgen` parent in your `pom.xml`. So instead of the `artifactId` which was `devon-docgen` you now have to use `devonfw-docgen-pdf` (or `devonfw-docgen-html` in case you generate HTML output).
4+
5+
Also you need to know that the property `docgen.wiki.page` has been renamed to `docgen.asciidoc.page`.

documentation/tools.asciidoc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
= Tools
2+
3+
You can clone the documentation from the github repositoriy and edit it with an editor of your choice. For this we recommend one of the following tools:
4+
5+
* http://www.asciidocfx.com/[AsciiDocFx]
6+
* https://plugins.jetbrains.com/plugin/7391-asciidoc[AsciiDoc for IntelliJ]
7+
* https://marketplace.visualstudio.com/items?itemName=joaompinto.asciidoctor-vscode[AsciiDoc for VS Code]
8+
* https://addons.mozilla.org/fr/firefox/addon/asciidoctorjs-live-preview/[Asciidoc for Firefox]
9+
* https://chrome.google.com/webstore/detail/asciidoctorjs-live-previe/iaalpfgpbocpdfblpnhhgllgbdbchmia[Asciidoc for Chrome]
10+
* https://atom.io/packages/asciidoc-preview[Asciidoc preview for Atom] and https://atom.io/packages/language-asciidoc[Asciidoc language for Atom]
11+
* https://github.com/asciidoctor/brackets-asciidoc-preview[Asciidoc for Brackets]

0 commit comments

Comments
 (0)