Skip to content

Asciidoc Editor and Toolchain written with JavaFX 21 (Build PDF, Epub, Mobi and HTML books, documents and slides)

License

Notifications You must be signed in to change notification settings

asciidocfx/AsciidocFX

Repository files navigation

Asciidoc Editor based on JavaFX 20

Features

  • Real-Time Preview

  • Multi-platform (Windows, Mac, Linux)

  • Creating Asciidoc Books

  • Creating PDF, HTML, Epub, Mobi, Docbook

  • Epub Viewer

  • External Browser Support

  • Table Generator

  • MathJax Extension

  • PlantUML Extension

  • Mermaid Extension (Experimental)

  • ditaa Extension

  • Filesystem Tree Extension

  • JavaFX Charts Extension

  • Source Code Highlighter

  • Reveal.js Converter

  • Deck.js Converter

  • Nashorn support

  • Pseudo Terminal Emulator

  • Themeing (Dark & White) _New _

Pseudo Terminal Emulator

Pseudo Terminal Emulator

How to Install AsciidocFX

There are a number of operating systems that AsciidocFX supports.

Note
The latest releases are available from the Github releases page.

Supported Operating Systems and Builds shows the list of available builds with links for reference. If you are looking for the very latest version, visit the link in the note above to be guaranteed of downloading the latest and greatest version of AsciidocFX.

Note
Thanks install4j small for providing us open source license for the installers used in AsciidocFX distribution.
Note
In all releases we use AdoptOpenJDK JREs, so you will not have any licensing issue regarding bundled JRE.
Table 1. Supported Operating Systems and Builds
OS Filename

Mac

AsciidocFX_Mac.dmg

Mac M1

AsciidocFX_Mac_M1.dmg

Windows

AsciidocFX_Windows.exe

Windows

AsciidocFX_Windows.zip

Linux

AsciidocFX_Linux.tar.gz

Linux DEB

AsciidocFX_Linux.deb

Linux RPM

AsciidocFX_Linux.rpm

Install on Linux

You can install AsciidocFX through the Deb or Rpm installers or via Archive file.

Archive file
$ tar –xvzf AsciidocFX_Linux.tar.gz
$ cd AsciidocFX/bin
$ chmod +X ./AsciidocFX
$ ./AsciidocFX

Install on Windows

Download executable/installer and run it.

Install on Mac

Download the .dmg and run it.

or

Use Homebrew to install it with one command: brew install --cask asciidocfx

AsciidocFX Backends

AsciidocFX can converts Asciidoc documents into HTML, PDF, EPUB3 and DOCBOOK5.

AsciidocFX converts documents via AsciidoctorJ library. For the PDF backends alternatively Docbook → Fop → PDF conversion can be utilized.

AsciidocFX Extensions

AsciidocFX supports many extensions like PlantUML, Ditaa, Charts, File Trees and many others Asciidoctor Diagram which can be found in https://docs.asciidoctor.org/diagram-extension/latest/

PlantUML Extension

You can fulfill your UML needs with AsciidocFX. It supports PlantUML. AsciidocFX converts this textual UML elements as png or svg image.

PlantUML is a component that allows to quickly write :

  • Sequence diagram,

  • Usecase diagram,

  • Class diagram,

  • Activity diagram, (here is the new syntax),

  • Component diagram,

  • State diagram,

  • Object diagram.

  • wireframe graphical interface

.UML Diagram Example
[uml,target="uml-example"]
--
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
--
uml example
Figure 2. UML example output
Note
In some UML elements, PlantUML needs to work with Graphviz. Because of this, you should install Graphviz manually for your platform. After installing Graphviz, you should set GRAPHVIZ_DOT environment variable to dot executable in Graphviz.

Mermaid Extension

Mermaid lets you create diagrams using text and code. This simplifies the maintenance of complex diagrams. See more examples: https://mermaid-js.github.io/

Note

mermaid-cli has to be installed for mermaid diagrams generation.

npm install @mermaid-js/mermaid-cli
[mermaid,target="mermaid-graph"]
--
graph TD
    A[Start] --> B{Is it?};
    B -- Yes --> C[OK];
    C --> D[Rethink];
    D --> B;
    B -- No ----> E[End];
--
mermaid graph
[mermaid,target="mermaid-flowchart"]
--
flowchart TB
    c1-->a2
    subgraph one
    a1-->a2
    end
    subgraph two
    b1-->b2
    end
    subgraph three
    c1-->c2
    end
    one --> two
    three --> two
    two --> c2
--
mermaid flowchart

ditaa Extension

AsciidocFX supports ditaa diagrams.

ditaa is a component that converts diagrams drawn in ascii art to bitmap graphics.

.ditaa Diagram Example
[ditaa,target="ditaa-example"]
--
    +--------+   +-------+    +-------+
    |        |---+ ditaa +--->|       |
    |  Text  |   +-------+    |diagram|
    |Document|   |!magic!|    |       |
    |     {d}|   |       |    |       |
    +---+----+   +-------+    +-------+
        :                         ^
        |       Lots of work      |
        +-------------------------+
--
ditaa example

MathJax Extension

MathJax is an open source JavaScript display engine for mathematics that works in all browsers.

You can use Tex or MathML languages for describing mathematical formulas in AsciidocFX. AsciidocFX converts this textual formulas as png or svg image.

For Example (Tex)
[latexmath,target="tex-formula"]
--
\begin{align}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xyp
\end{align}
--

Tex output

tex formula
For Example (MathML)
[mathml,target="mathml-formula"]
--
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mi>x</mi>
  <mo>=</mo>
  <mrow>
    <mfrac>
      <mrow>
        <mo>&#x2212;</mo>
        <mi>b</mi>
        <mo>&#xB1;</mo>
        <msqrt>
          <msup>
            <mi>b</mi>
            <mn>2</mn>
          </msup>
          <mo>&#x2212;</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>
--

MathML output

mathml formula

Filesystem Tree Extension

You can represent filesystem tree in following tree block. There is two style of FS tree.

[tree,target="tree-view"]
--
#src
##main
###java
####com
#####kodcu
######App.java
###resources
####css
#####style.css
####js
#####script.js
####images
#####image.png
--

Filesystem Tree output

When you drag and drop a folder to editor, AFX will generate this like tree automatically.

tree view
[tree,target="tree-view-new"]
--
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.asc
|   |-- archive-db.zip
|   |-- .gitignore
|   |-- README
|   `-- configuration.conf
`-- etc.
--

Filesystem Tree output (new)

tree view new

JavaFX Charts Extension

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

Pie Chart

secim 2014 pie
[chart,pie,target="secim-2014-pie",opt="title=2014 YEREL SEÇİM SONUÇLARI"]
--
AKP,  45.6, orange
CHP,  27.8,red
MHP,  15.2
BDP,  4.2
SP,  2
--

Area Chart

[chart,area,target="area-chart"]
--
//April
1,  4
3,  10
6,  15
9,  8
12, 5

//May
1,  20
3,  15
6,  13
9,  12
12, 14
--

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

How to Build AsciidocFX

  1. Firstly, install JDK 17

  2. Download Apache Maven and set /bin directory to environment variables

  3. Enter AsciidocFX directory and run $ mvn clean install

  4. Follow to target/appassembler/bin directory and you will see asciidocfx.sh and asciidocfx.bat

Note
We are generating builds with Github Actions automatically.

Books Written with AsciidocFX

Slides (Reveal.js)

AsciidocFX supports slides by using the Asciidoctor Reveal.js backend. To getting start with slide authoring, you can just follow New › Slide menu.

new slide
Figure 3. New › Slide

After that AFX will prompt you a freespace directory name and "OK" you will see the slide demo.

slide demo
Figure 4. Slide demo

You can easily switch between reveal.js and deck.js by changing the comment below. Also, you can configure default settings by editing _settings_reveal.adoc and include::_settings_deck.adoc.

include::_settings_reveal.adoc[]

Used Technologies

AsciidocFX uses Java, JavaScript and XML related technologies.

  • Java FX 18

  • AsciidoctorJ

  • Asciidoctor.js (Deprecated)

  • Spring Boot

  • Spring WebSocket

  • Docbook

  • Apache Fop

  • Saxon 6.5

  • Ace editor

AsciidocFX Configuration

You can configurate AsciidocFX with Settings page (Press Ctrl+F4). The all configs located in [Install_Dir]/conf folder.

Editor Shortcuts

Editor in AsciidocFX is based on Ace.js ( https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts ) . AsciidocFX supports the keyboard shortcuts listed below. All are configurable under Settings > Shortcut settings. Keyboard events are handled by AsciidocFX, if you any reason want it handled by Ace.js itself, you can disable "Custom Shortcut Handler" in settings.

Description Shortcut (Win/Linux) Shortcut (Mac) Command Name

Add cursor above

Ctrl+Alt+Up

Ctrl+Alt+Up

addCursorAbove

Add cursor above (skip current)

Ctrl+Alt+Shift+Up

Ctrl+Alt+Shift+Up

addCursorAboveSkipCurrent

Add cursor below

Ctrl+Alt+Down

Ctrl+Alt+Down

addCursorBelow

Add cursor below (skip current)

Ctrl+Alt+Shift+Down

Ctrl+Alt+Shift+Down

addCursorBelowSkipCurrent

Add new line after the current line

Command+Return

Command+Return

addLineAfter

Add new line before the current line

Command+Shift+Return

Command+Shift+Return

addLineBefore

Align cursors

Ctrl+Alt+A

Ctrl+Alt+A

alignCursors

Append Heading

Ctrl+H

Ctrl+H

add-heading

Backspace

Shift+Backspace OR Backspace

Ctrl+Backspace OR Shift+Backspace OR Backspace OR Ctrl+H

backspace

Block indent

Ctrl+

Ctrl+

blockindent

Block outdent

Ctrl+[

Ctrl+[

blockoutdent

Bold selection

Ctrl+B

Command+B

bold-selected

Center selection

Ctrl+L

centerselection

Change language mode…​

Command+K OR Input+M

Command+K OR Input+M

modeSelect

Codify selection

Ctrl+Shift+C

Command+Shift+C

codify-selected

Copies the selection in editor

Ctrl+C

Command+C

copyX

Copy Lines Down

Ctrl+D

Command+D

copylinesdown

Copy lines up

Alt+Shift+Up

Command+Option+Up

copylinesup

Cuts the selection in editor

Ctrl+X

Command+X

cutX

Delete

Delete OR Ctrl+D OR Shift+Delete

Delete OR Ctrl+D OR Shift+Delete

del

Duplicate selection

Ctrl+Shift+D

Command+Shift+D

duplicateSelection

Expand to line

Ctrl+Shift+L

Command+Shift+L

expandtoline

Expand to matching

Ctrl+Shift+M

Ctrl+Shift+M

expandToMatching

Find

Ctrl+F

Command+F

find

Find all

Ctrl+Alt+K

Ctrl+Alt+G

findAll

Find next

Ctrl+K

Command+G

findnext

Find previous

Ctrl+Shift+K

Command+Shift+G

findprevious

Fold

Alt-L OR Ctrl-F1

Command-Alt-L OR Command-F1

fold

Fold all

Command+K OR Command+0

Ctrl+Command+Option+0

foldall

Fold all comments

Ctrl+Command+Option+0

foldAllComments

Fold other

Alt+0

Command+Option+0

foldOther

Go line down

Down OR Ctrl+N

Down OR Ctrl+N

golinedown

Go line up

Up OR Ctrl+P

Up OR Ctrl+P

golineup

Go to end

Ctrl+End

Command+End OR Command+Down

gotoend

Go to left

Left OR Ctrl+B

Left OR Ctrl+B

gotoleft

Go to line end

Alt+Right OR End

Command+Right OR End OR Ctrl+E

gotolineend

Go to line start

Alt+Left OR Home

Command+Left OR Home OR Ctrl+A

gotolinestart

Go to line…​

Ctrl+L

Command+L

gotoline

Go to next error

Alt+E

F4

goToNextError

Go to page down

Page Down OR Ctrl+V

Page Down OR Ctrl+V

gotopagedown

Go to previous error

Alt+Shift+E

Shift+F4

goToPreviousError

Go to right

Right OR Ctrl+F

Right OR Ctrl+F

gotoright

Go to start

Ctrl+Home

Command+Home OR Command+Up

gotostart

Go to word left

Ctrl+Left

Option+Left

gotowordleft

Go to word right

Ctrl+Right

Option+Right

gotowordright

Italic selection

Ctrl+I OR Ctrl+Ä° OR Ctrl+I OR Ctrl+I

Command+I OR Command+Ä° OR Command+I OR Command+I

italicize-selected

Jump to matching

Ctrl+] OR kbd:[Ctrl+P

kbd:[Command+\]

jumptomatching

Modify number down

Ctrl+Shift+Down

Alt+Shift+Down

modifyNumberDown

Modify number up

Ctrl+Shift+Up

Alt+Shift+Up

modifyNumberUp

Move lines down

Alt+Down

Option+Down

movelinesdown

Move lines up

Alt+Up

Option+Up

movelinesup

Open Link

Ctrl+F3

F3

openlink

Open command palette

F1

F1

openCommandPallete

Outdent

Shift+Tab

Shift+Tab

outdent

Page down

Ctrl+Page Down

Option+Page Down

pagedown

Page up

Ctrl+Page Up

Option+Page Up

pageup

Pastes from clipboard to AsciidocFX editor

Ctrl+Shift+V

Command+Shift+V

pasteX

Redo

Ctrl+Shift+Z OR Ctrl+Y

Command+Shift+Z OR Command+Y

redo

Remove line

Ctrl+D

Command+D

removeline

Remove to line end

Alt+Delete

Ctrl+K OR Command+Delete

removetolineend

Remove to line start

Alt+Backspace

Command+Backspace

removetolinestart

Remove word left

Ctrl+Backspace

Alt+Backspace OR Ctrl+Alt+Backspace

removewordleft

Remove word right

Ctrl+Delete

Alt+Delete

removewordright

Replace

Ctrl+H

Command+Option+F

replace

Replay macro

Ctrl+Shift+E

Command+Shift+E

replaymacro

Select all

Ctrl+A

Command+A

selectall

Select down

Shift+Down OR Ctrl+Shift+N

Shift+Down OR Ctrl+Shift+N

selectdown

Select left

Shift+Left OR Ctrl+Shift+B

Shift+Left OR Ctrl+Shift+B

selectleft

Select more after

Ctrl+Alt+Right

Ctrl+Alt+Right

selectMoreAfter

Select more before

Ctrl+Alt+Left

Ctrl+Alt+Left

selectMoreBefore

Select next after

Ctrl+Alt+Shift+Right

Ctrl+Alt+Shift+Right

selectNextAfter

Select next before

Ctrl+Alt+Shift+Left

Ctrl+Alt+Shift+Left

selectNextBefore

Select or find next

Alt+K

Ctrl+G

selectOrFindNext

Select or find previous

Alt+Shift+K

Ctrl+Shift+G

selectOrFindPrevious

Select right

Shift+Right

Shift+Right

selectright

Select to end

Ctrl+Shift+End

Command+Shift+End OR Command+Shift+Down

selecttoend

Select to line end

Alt+Shift+Right

Command+Shift+Right OR Shift+End OR Ctrl+Shift+E

selecttolineend

Select to line start

Alt+Shift+Left

Command+Shift+Left OR Ctrl+Shift+A

selecttolinestart

Select to matching

Ctrl+Shift+] OR kbd:[Ctrl+Shift+P

kbd:[Command+Shift+\]

selecttomatching

Select to start

Ctrl+Shift+Home

Command+Shift+Home OR Command+Shift+Up

selecttostart

Select up

Shift+Up OR Ctrl+Shift+P

Shift+Up OR Ctrl+Shift+P

selectup

Select word left

Ctrl+Shift+Left

Option+Shift+Left

selectwordleft

Select word right

Ctrl+Shift+Right

Option+Shift+Right

selectwordright

Show Firebug Console

F12

F12

firebug-lite

Show line numbers

Ctrl+L

Command+L

line-numbers

Show settings menu

Ctrl+,

Command+,

showSettingsMenu

Sort lines

Ctrl+Alt+S

Command+Alt+S

sortlines

Split into lines

Alt+Shift+I

Alt+Shift+I

splitSelectionIntoLines

Split line

Ctrl+O

splitline

Split selection into lines

Ctrl+Alt+L

Ctrl+Alt+L

toggleSplitSelectionIntoLines

Tab and Text snippets

Tab

Tab

indent

To lowercase

Ctrl+Shift+U

Ctrl+Shift+U

tolowercase

To uppercase

Ctrl+U

Ctrl+U

touppercase

Toggle block comment

Ctrl+Shift+/

Command+Shift+/

toggleBlockComment

Toggle comment

Ctrl+/

Command+/

togglecomment

Toggle fold widget

F2

F2

toggleFoldWidget

Toggle parent fold widget

Alt+F2

Alt+F2

toggleParentFoldWidget

Toggle recording

Ctrl+Alt+E

Command+Option+E

togglerecording

Transpose letters

Alt+Shift+X

Ctrl+T

transposeletters

Underline selection

Ctrl+U

Command+U

underline-selected

Undo

Ctrl+Z

Command+Z

undo

Unfold

Alt-Shift-L OR Ctrl-Shift-F1

Command-Alt-Shift-L OR Command-Shift-F1

unfold

Unfold all

Alt+Shift+0

Command+Option+Shift+0

unfoldall

Known Issues

PDF output shows all text as ####

On Linux platforms you can face with this issue. For the getting around for the issue you need to install Microsoft Core Fonts to your platform. How to install [microsoft-core-fonts]

Mac QWERTY Keyboard Bug

There is a bug in JavaFX which makes all keyboards on a Mac behave as "QWERTY". This means, that on a German "QWERTZ" layout the shortcuts for undo and redo are swapped.

Text Artifacts (Rainbowing) on Text

If you are being distracted by rainbow text artifacts on text, you can work around the issue by passing some VM options in [Install_Dir]/AsciidocFX.vmoptions, as shared in this RichTextFX bug.

  1. Open AsciidocFX.vmoptions.

  2. Add -Dprism.text=t2k and -Dprism.lcdtext=false to the file.

  3. Save and close.

  4. Launch AsciidocFX

Changelog

To see what has changed in recent versions of AsciidocFX, see the CHANGELOG

Support

Support AsciidocFX with pull requests or open an issue for bug & feature requests. You can make discussions in mail group or in the chat room at Gitter.im.

Contributors

Thank you to all the people who have already contributed to AsciidocFX! Contributors

Backers

Thank you to all our backers! [Become a backer]

Backers on Open Collective

Sponsors

Thank you to all our sponsors! (please ask your company to also support this open source project by becoming a sponsor)

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar