39
Jérémie Bresson – 03.11.2015 Writing documentation with Asciidoctor

Writing documentation with Asciidoctor

Embed Size (px)

Citation preview

Page 1: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 42 Untertitel: Calibri, 24

Special ( entfernen): Untertitel über Logo ziehen

Jérémie Bresson – 03.11.2015

Writing documentation with Asciidoctor

Page 2: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Text: Calibri, Fett, 42

AsciiDoc

Page 3: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

AsciiDoc example

= Getting Started with Java

Author Name <[email protected]>

== Hello World example

Copy the *HelloWorld.java* file.

TIP: The application prints _Hello World!_ to the console.

* Compile this source to a class file using `javac`.

* Run the compiled class file using `java`.

If you need help with the Java syntax check the

link:http://docs.oracle.com/javase/8/docs/[Java 8 Javadoc].

Page 4: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

AsciiDoc example

Page 5: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

AsciiDoc example

= Getting Started with Java

Author Name <[email protected]>

== Hello World example

Copy the *HelloWorld.java* file.

TIP: The application prints _Hello World!_ to the console.

* Compile this source to a class file using `javac`.

* Run the compiled class file using `java`.

If you need help with the Java syntax check the

link:http://docs.oracle.com/javase/8/docs/[Java 8 Javadoc].

Page 6: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Headings

= Getting Started with Java

Author Name <[email protected]>

== Hello World example

Copy the *HelloWorld.java* file.

TIP: The application prints _Hello World!_ to the console.

* Compile this source to a class file using `javac`.

* Run the compiled class file using `java`.

If you need help with the Java syntax check the

link:http://docs.oracle.com/javase/8/docs/[Java 8 Javadoc].

Document Title

Section Level 1

Page 7: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

= Getting Started with Java

Author Name <[email protected]>

== Hello World example

Copy the *HelloWorld.java* file.

TIP: The application prints _Hello World!_ to the console.

* Compile this source to a class file using `javac`.

* Run the compiled class file using `java`.

If you need help with the Java syntax check the

link:http://docs.oracle.com/javase/8/docs/[Java 8 Javadoc].

Lists

Unordered list items

Page 8: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Inline formatting

= Getting Started with Java

Author Name <[email protected]>

== Hello World example

Copy the *HelloWorld.java* file.

TIP: The application prints _Hello World!_ to the console.

* Compile this source to a class file using `javac`.

* Run the compiled class file using `java`.

If you need help with the Java syntax check the

link:http://docs.oracle.com/javase/8/docs/[Java 8 Javadoc].

bold

italic

code

Page 9: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

= Getting Started with Java

Author Name <[email protected]>

== Hello World example

Copy the *HelloWorld.java* file.

TIP: The application prints _Hello World!_ to the console.

* Compile this source to a class file using `javac`.

* Run the compiled class file using `java`.

If you need help with the Java syntax check the

link:http://docs.oracle.com/javase/8/docs/[Java 8 Javadoc].

Links

link with title

Page 10: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

= Getting Started with Java

Author Name <[email protected]>

== Hello World example

Copy the *HelloWorld.java* file.

TIP: The application prints _Hello World!_ to the console.

* Compile this source to a class file using `javac`.

* Run the compiled class file using `java`.

If you need help with the Java syntax check the

link:http://docs.oracle.com/javase/8/docs/[Java 8 Javadoc].

Admonition

Page 11: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Text: Calibri, Fett, 42

Asciidoctor

Page 12: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Asciidoctor is publishing toolchain for the AsciiDoc writing format.

Written in Ruby (and transpiled to JavaScript) (can be used with JRuby in the JVM)

Open Source (MIT Licence)

Asciidoctor

Page 13: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Multiple Outputs

PDF

HTML pages

Eclipse Help guides

Page 14: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Text: Calibri, Fett, 52

Special: « Alt+0171 » Alt+0187

«Why is asciidoctor a great tool?»

Page 15: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Text: Calibri, Fett, 42

Source code listings

Page 16: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

A code snippet in your documentation

== Usage of Mylyn wikitext

With the method `toHtml(String)` in <<lst-wikitext1>> you

can convert a text from Mediawiki Language to HTML.

[[lst-wikitext1, Listing 1]]

[source,java]

----

public static String toHtml(String mediawikiText) {

StringWriter writer = new StringWriter();

MarkupParser parser = new MarkupParser(new MediaWikiLanguage(), new HtmlDocumentBuilder(writer));

parser.parse(mediawikiText);

return writer.toString();

}

----

Page 17: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Callout

== Usage of Mylyn wikitext

With the method `toHtml(String)` in <<lst-wikitext1>> you

can convert a text from Mediawiki Language to HTML.

[[lst-wikitext1, Listing 1]]

[source,java]

----

public static String toHtml(String mediawikiText) {

StringWriter writer = new StringWriter();

MarkupParser parser = new MarkupParser(new MediaWikiLanguage(), new HtmlDocumentBuilder(writer));

parser.parse(mediawikiText); // <1>

return writer.toString();

}

----

<1> Main call of the Mylyn Wikitext framework

Page 18: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Callout

Page 19: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Callout – Copy paste friendly

Page 20: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

code snippets corresponding to source code under control

− Always up-to-date

− Ease maintenance

Real source code in your documentation

== Usage of Mylyn wikitext

With the method `toHtml(String)` in <<lst-wikitext1>> you

can convert a text from Mediawiki Language to HTML.

[[lst-wikitext1, Listing 1]]

[source,java]

----

include::src/main/java/MediawikiTest.java[tags=method]

----

<1> Main call of the Mylyn Wikitext framework

Page 21: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Real source code in your documentation

public class MediawikiTest {

//tag::method[]

public static String toHtml(String mediawikiText) {

StringWriter writer = new StringWriter();

MarkupParser parser = new MarkupParser(new MediaWikiLanguage(), new HtmlDocumentBuilder(writer));

parser.parse(mediawikiText); // <1>

return writer.toString();

}

//end::method[]

@Test

public void test() {

StringBuilder sb = new StringBuilder();

sb.append("= Heading 1 =\n");

sb.append("\n");

sb.append("Hello World!\n");

sb.append("\n");

sb.append("* Lorem\n");

sb.append("* Ipsum\n");

sb.append("\n");

sb.append("This is '''Mediawiki''' language.\n");

String html = toHtml(sb.toString());

String expected = "<h1 id=\"Heading_1\">Heading 1</h1><p>Hello World!</p><ul><li>Lorem</li><li>Ipsum</li></ul><p>This is

<b>Mediawiki</b> language.</p>";

assertTrue("epexted HTML not found in the output", html.contains(expected));

}

}

§

Page 22: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Text: Calibri, Fett, 42

Single source your documents

Page 24: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

One source, multiple output

Eclipse Fundation Handbook

LocationTech Handbook

PolarSys Handbook

Page 25: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Variable substitution

Open source projects at the Eclipse Foundation are required

to make use of certain Eclipse Foundation services:

* All project issues must be tracked in the

{bugzillaUrl}[{forgeName} Bugzilla]instance;

:forgeName: Eclipse

:bugzillaUrl: https://bugs.eclipse.org/bugs

Eclipse Project Handbook

========================

include::chapters/resources.adoc[] eclipse.adoc

resources.adoc

Page 26: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Variable substitution

Open source projects at the Eclipse Foundation are required

to make use of certain Eclipse Foundation services:

* All project issues must be tracked in the

{bugzillaUrl}[{forgeName} Bugzilla]instance;

:forgeName: LocationTech

:bugzillaUrl: https://www.locationtech.org/bugs

LocationTech Project Handbook

=============================

include::chapters/resources.adoc[] locationtech.adoc

resources.adoc

Page 27: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Conditional inclusion

ifeval::["{forgeName}"=="Eclipse"]

_The Eclipse Foundation strongly encourages all projects to

create an

maintain and http://marketplace.eclipse.org[Eclipse

Marketplace]

presence._

endif::[]

Page 28: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Text: Calibri, Fett, 42

Simple Tools (no setup)

Page 29: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Any text editor

Page 30: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Extension for Chrome: Asciidoctor.js Live Preview

Live preview in Chrome

Page 31: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

JavaFX Codeeditors – Tom Schindl

Page 32: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Text: Calibri, Fett, 42

Build

Page 34: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Ruby, JavaScript, JVM environments

Integration with a lot of build systems:

− Maven

− Gradle

Dependencies available in several repositories

− Maven central

− JCenter

− NPM

You can build on every machine, without a complex setup

Build system

Page 35: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Text: Calibri, Fett, 42

Edit on GitHub

Page 36: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

Edit on GitHub

Page 37: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

GitHub Editor

Page 38: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: 2. Zeile als Untertitel nicht Fett

GitHub Preview

Page 39: Writing documentation  with  Asciidoctor

Farben:

254/153/21

0/130/161

127/127/127

Schrift: Titel: Calibri, Fett, 32

Text: Calibri, 22 (mind. 18)

Special: Automatischer Einzug

Eclipse Scout 2015

Thanks

/@j2r2b /+JeremieBresson

/jmini [email protected]