
Dan Allen@mojavelinux
Writing is a #$%@! ordeal.
Bad
<class accessibility="public"
name="HelloWorld">
<annonymousBlock>
<method type="static"
accessibility="public"
inheritability="final"
name="main">
<arguments>
<variableArguments name="args"
type="java.lang.String"/>
</arguments>
<annonymousBlock>
<methodCall method="println"
object="java.lang.System.out">
<argument value="Hello World!"
type="java.lang.String"/>
</methodCall>
</annonymousBlock>
</method>
</annonymousBlock>
</class>
Good
AsciiDocsyntax | Asciidoctorparser + tools |
read | edit | version | share | convert |
= Getting Started with Java
Author Name <author@example.org>
Here's your first Java application.
.HelloWorld.java
[source,java]
----
public class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello, world!"); <1>
}
}
----
<1> Prints "Hello, world!" to the console.
Compile this source to a class file using `javac`.
Finally, run the compiled class file using `java`.
Concise
Consistent
Semantic
No special markup is required.
A paragraph is just consecutive lines of text.
To start a paragraph, offset it by a blank line.
= Document Title
== Section Level 1
=== Section Level 2
==== Section Level 3
===== Section Level 4
====== Section Level 5
= Section Level 0 (book doctype only)
Unordered
| Ordered
|
| bold italic
custom |
|
| open |
| listing, source, literal |
| example, admonition |
| sidebar |
| quote |
| comment |
:source-highlighter: coderay
[source,java]
----
public class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello, world!"); <1>
}
}
----
<1> Prints "Hello, world!" to the console.
NOTE: For your info.
WARNING: I wouldn't do that.
IMPORTANT: Don't forget!
Inline |
|
Block |
|
Image |
|
Icon |
|
Video |
|
Custom converters (PDF, reveal.js, …)
Custom syntax (issue:<id>[]
)
AST transforms
issue:<id>[]
asciidoctor {
extensions {
inline_macro (name: 'issue') { parent, id, attrs ->
issues_uri = parent.getAttr('uri-issues')
options = [
type: ':link',
target: "${issues_uri}/${id}".toString()
]
createInline(parent, 'anchor',
target, attrs, options).render()
}
}
}
⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃.
⁃⁃⁃⁃⁃⁃.
⁃⁃⁃⁃⁃⁃⁃⁃⁃.
:uri-project: http://example.org
Find out more about {uri-project}[project name].
include::{uri-macros}/how_to_complete_this_guide.adoc[]
[source,groovy]
----
include::build.gradle[tag=repositories]
----
I can do truly amazing things with my AsciiDoc source.
Sarah White (@carbonfray)
#2: Comments