1. Source Code

1.1. Inline Source Code

Copy & Paste Hell!

class Main {
  void main() {
    System.out.println("Hello, World!");
  }
}

1.2. Included Source Code

Why not use the actual sources with highlighting, line numbers, callouts, and skip the file header?

src/java/Main.java
1
2
3
4
5
6
7
8
class Main {
  // tag::main[] (1)
  void main() {
    System.out.println("Hello, World!");
  }
  // end::main[] (2)
}
1 // tag::main[] starts a tag named "main"
2 // end::main[] ends the tag

Just the method defined with the main the tag and fix indentation:

void main() {
  System.out.println("Hello, World!");
}

2. Miscellaneous

2.1. Software Documentation

Ctrl+Alt+Delete

Press OK

Select File  Export  RAW

2.2. Sidebars

Delete commented lines with sed
Unfortunately, Mac und Linux handle sed -i differently:
Mac
sed -i '' '/^[@#]/d' "$file"
Linux
sed -i '/^[@#]/d' "$file"

2.4. Attributes

{some-version} has the value 1.2.3.

<version>1.2.3</version>

3. Lists

  1. numbered

    1. bulleted

      • one

      • two

  1. with colored symbols

    • positive

    • ▶︎ neutral

    • negative

  1. separate two consecutive lists with //-.

    more content for the same item

    System.out.println("YAY!");

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut odio augue. Nam tristique rhoncus tortor, vitae sollicitudin risus hendrerit.

  2. definition lists

    1. Question/Answer

      1. What is the answer?

        42

      2. Computer says?

        Is it safe?

        No.

    2. on next line

      e.g.

      for example

      Do not confuse with i.e.

      i.e.

      that is

      et al.

      and others

    3. on same line

      small
      dragonfly
      normal
      dragonfly
      large
      dragonfly
  3. includes with parameters

4. Tables

4.1. Simple

First Last Money ($)

Homer

Simpson

-12.76

Marge

Simpson

4,538.90

4.2. Inline CSV

1

2

3

4

5

6

7

8

9

4.3. Included CSV

Height Weight

15

23.4

17

26.7

23

45

4.4. Cell Content

Col 1 Col 2

Source Code

List<String> collectorCollection =
  productList.stream().map(Product::getName).collect(Collectors.toList());

List

  1. one

  2. two

    1. two-one

  3. three

Table in Table

Col1 Col2

C11

C12

5. Diagrams