Skip to content

Latest commit

 

History

History
474 lines (363 loc) · 8.38 KB

Cheatsheet.adoc

File metadata and controls

474 lines (363 loc) · 8.38 KB

Asciidoc Cheatsheet

Asciidoc is a rich text based markup language. A document written with Asciidoc can easily be converted to HTML, PDF, Docbook, Mobi, Epub, and Odt formats. This cheatsheet shows you the common features of Asciidoc Markup language.


1. Basic formats

Bold , İtalic , Underscore , Top , Down


2. Title levels

There are 6 Level titles as HTML. First one is for document title.

= Level 1

Content ...

== Level 2

Content ...

=== Level 3

Content ...

==== Level 4

Content ...

===== Level 5

Content ...

3. Lists

There are ordered, unordered, checked and labeled list elements.

Unordered list
  • deep 1

    • deep 2

      • deep 3

        • deep 4

          • deep 5

  • deep 1

Ordered list
  1. Order 1

  2. Order 2

    1. Order 2a

    2. Order 2b

  3. Order 3

Checked list
  • ✓ checked

  • ✓ checked

  • ❏ unchecked

  • normal

Labeled list
CPU

The brain of the computer.

Hard drive

Permanent storage for operating system and/or user files.


You can use links:

https://asciidocfx.com - AsciidocFX


5. Images

You can declare images with image:: prefix and [] suffix. Path may be relative or absolute .

5.1. Basic

kodedu logo e1487527571657

5.2. Detailed

kodedu.com
Şekil 1. kodedu.com

6. Code higlighting

You can declare inline or block based codes with Asciidoc syntax.

Inline

Reference code like types or methods inline.

Code block
public interface Hello {

    void hello();

}

You can use numbered elements named callouts in Asciidoc.

Numbered code block
require 'sinatra' // (1)

get '/hi' do // (2)
  "Hello World!" // (3)
end
  1. Library import

  2. URL mapping

  3. Content for response


7. Blocks

You can use blocks to put emphasis on specific document section or provide contextual information

7.1. Sidebar block

Bloc Title (optional)

This is a Sidebar block.

7.2. Example block

Example 1. Bloc Title (optional)

This is an Example block.

7.3. Passthrough block

This is a Passthrough block. IT may be used with a HTML backend to insert raw HTML within the document.

Grocery list:

  • Garlic
  • Bread
  • Salami

7.4. Blockquote block

Bloc Title (optional)

And wherever men are fighting against barbarism, tyranny, and massacre, for freedom, law, and honour, let them remember that the fame of their deeds, even though they themselves be exterminated, may perhaps be celebrated as long as the world rolls round.

— Winston S. Churchill
Birth Of Britain

8. Admonitions

Asciidoc permits the use of 5 types of admonitions to fit different information needs.

Note
Note

An additional information

Tip
Tip

A useful information or trick

Important
Important

Ensure something is known

Caution
Caution

Advise the reader to act carefully (i.e., exercise care)

Warning
Warning

Inform the reader of danger, harm, or consequences that exist.


9. Table

Asciidoc allows the creation of tables

9.1. Basic table

Table 1. Title (optional)
Col 1 Col 2 Col 3

1

Item 1

a

2

Item 2

b

3

Item 3

c

6

Three items

d

9.2. Complex table

Table 2. Title (optional)

Date

Duration

Avg HR

Notes

22-Aug-08

10:24

157

Worked out MSHR (max sustainable heart rate) by going hard for this interval.

22-Aug-08

152

Back-to-back with previous interval.

24-Aug-08

none

10. AsciidocFX plugins

AsciidocFX integrates plugins to produce UML diagrams, complex matematical formulas and JavaFX Chart.

10.1. JavaFX Charts Extension

JavaFX has 8 kind of Chart component and AsciidocFX supports all of them.

10.1.1. Pie Chart

AKP, 45.6, orange CHP, 27.8,red MHP, 15.2 BDP, 4.2 SP, 2

10.1.2. Area Chart

1, 4 3, 10 6, 15 9, 8 12, 5

1, 20 3, 15 6, 13 9, 12 12, 14

For other charts and available options, look at Chart extension wiki page!

10.2. PlantUML Extension

PlantUML is a UML diagram extension embedded in AsciidocFX. Note that some diagram generation may require you to install Graphviz externally.

Title (optional)

abstract class AbstractList abstract AbstractCollection interface List interface Collection

List <|-- AbstractList Collection <|-- AbstractCollection

Collection <|- List AbstractCollection <|- AbstractList AbstractList <|-- ArrayList

class ArrayList { Object[] elementData size() }

enum TimeUnit { DAYS HOURS MINUTES }

annotation SuppressWarnings

@startditaa -------- ------- ------- | --- ditaa --> | | | Text | +------- |diagram| |Document| |!magic!| | | | {d}| | | | | -------+ ------- ------- : ^ | Lots of work | ------------------------- @endditaa

@startdot digraph foo { node [style=rounded] node1 [shape=box] node2 [fillcolor=yellow, style="rounded,filled", shape=diamond] node3 [shape=record, label="{ a | b | c }"]

  node1 -> node2 -> node3
}
@enddot

10.3. MathJAX Extension

AsciidocFX supports MathJAX, which visually outputs various languages (MathML, Tex, AsciiMath) in which complex mathematical formulas are expressed textually. You can use complex formulas in AsciidocFX and MathML and Tex formats that will be inserted as PNG images in your documents.

10.3.1. Tex formula

Title (optional)

\begin{align} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xyp \end{align}

10.3.2. MathML formula

Title (optional)

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> <mi>x</mi> <mo>=</mo> <mrow> <mfrac> <mrow> <mo>−</mo> <mi>b</mi> <mo>±</mo> <msqrt> <msup> <mi>b</mi> <mn>2</mn> </msup> <mo>−</mo> <mn>4</mn> <mi>a</mi> <mi>c</mi> </msqrt> </mrow> <mrow> <mn>2</mn> <mi>a</mi> </mrow> </mfrac> </mrow> <mtext>.</mtext> </math>

10.4. Filesystem Tree Viewers

You may generate a visual representation of a file system as a "Tree" structure.

10.4.1. Basic tree

Filesystem Tree

booksample asciidoctor.css book.adoc chapter-01.adoc chapter-02.adoc chapter-03.adoc chapter-04.adoc chapter-05.adoc chapter-06.adoc images #kodcu.png #mathml-formula.png #tex-formula.png ##uml-diagram.png

10.4.2. Linked tree

Filesystem Tree

root |-- photos | |-- camp.gif | |-- festival.png | `-- balloon.jpg |-- videos | |-- car-video.avi | |-- dance.mp4 | |-- dance01.mpg | |-- another video.divx | `-- school videos | `-- firstday.flv |-- documents | |-- jsfile.js | |-- powerpoint.ppt | |-- chapter-01.adoc | |-- archive-db.zip | |-- .gitignore | |-- README | `-- configuration.conf `-- etc.

This document is open to development and suggestions.

Thanks.