= Asciidoc Book Editor based on JavaFX 8
:experimental:
:toc:
:toc-placement: preamble
:asciifocfx-version: 1.3.7-RC4
:download-root: https://github.com/asciidocfx/AsciidocFX/releases/download/v{asciifocfx-version}/
image:https://api.travis-ci.org/asciidocfx/AsciidocFX.svg?branch=master[Build Status,link="https://travis-ci.org/asciidocfx/AsciidocFX"]
image:https://badges.gitter.im/Join%20Chat.svg["Gitter", link="https://gitter.im/asciidocfx/AsciidocFX"]
Asciidoc FX is a book / document editor to build PDF, Epub, Mobi and HTML books, documents and slides.
.AsciidocFX
image::images/asciidocfx.png[]
== Features
* Real-Time Preview
* Multi-platform (Windows, Mac, Linux ..)
* Creating Asciidoc Books
* Creating Markdown Books
* Creating PDF, HTML, Epub, Mobi, Docbook
* Epub Viewer
* External Browser Support
* Table Generator
* MathJax Extension
* PlantUML Extension
* Filesystem Tree Extension
* JavaFX Charts Extension
* Source Code Highlighter
== How to Install AsciidocFX
.You can download the latest release from https://github.com/asciidocfx/AsciidocFX/releases[Github releases page].
[width="100%",options="header"]
|====================
| OS | JRE included? | Filename
^.^| Mac | Yes | {download-root}AsciidocFX_Mac.dmg[AsciidocFX_Mac.dmg]
.4+^.^| Windows | Yes | {download-root}AsciidocFX_Windows.exe[AsciidocFX_Windows.exe]
| Yes | {download-root}AsciidocFX_Windows.zip[AsciidocFX_Windows.zip]
| No | {download-root}AsciidocFX_Windows_No_JRE.exe[AsciidocFX_Windows_No_JRE.exe]
| No | {download-root}AsciidocFX_Windows_No_JRE.zip[AsciidocFX_Windows_No_JRE.zip]
.2+^.^| Linux | Yes | {download-root}AsciidocFX_Linux.tar.gz[AsciidocFX_Linux.tar.gz]
| No | {download-root}AsciidocFX_Linux_No_JRE.tar.gz[AsciidocFX_Linux_No_JRE.tar.gz]
|====================
*Linux*
After the download is completed, untar the package in your preferred directory.
[source,bash]
$ cd /bin
$ ./AsciidocFX.sh
*Arch Linux*
Also you can install with package manager in Arch Linux
[source,bash]
$ yaourt -S asciidocfx
*Windows*
Download executable/installer and run it.
*Mac*
Download _dmg_ and run it.
=== Installation Notes
There are two AsciidocFX package flavors, you can download it with JRE 8 out-of-box or if you have already installed JRE 8 (Update 40 or above), you can download *No_JRE builds
Graphviz::
PlantUML extension needs Graphviz, if you will use it, then install it:
+
.Ubuntu
[source,bash]
----
sudo apt-get install graphviz
----
+
.Mac OS X
[source,bash]
----
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install graphviz
----
+
.Windows
----
http://www.graphviz.org/pub/graphviz/stable/windows/graphviz-2.38.msi
----
Microsoft Core Fonts::
You _must_ install Microsoft Core Fonts on Linux OSes also.
[underline]#Ubuntu/Debian#
[source,bash]
----
sudo apt-get install ttf-mscorefonts-installer
----
[underline]#Fedora#
If you are using Fedora, you need to install the RPM provided from this URL: http://sourceforge.net/projects/mscorefonts2/files/latest/download[mscorefonts2]
KindleGen::
You _must_ install http://www.amazon.com/gp/feature.html?docId=1000765211[KindleGen], If you need to convert your documents into Mobi files. Once you specify the location of KindleGen executable, Mobi Service provided by AFX will be available.
== A Quick Dive
*http://youtu.be/2goMtz_vdtM[Video - Writing Books with Asciidoc FX]*
== PlantUML Extension
You can fulfill your UML needs with AsciidocFX. It supports PlantUML. AsciidocFX converts this textual UML elements as png or svg image.
http://plantuml.sourceforge.net/[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
[source,java]
----
.UML Diagram Example
[uml,file="uml-example.png"]
--
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 output
image::images/uml-example.png[]
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.
== MathJax Extension
http://www.mathjax.org/[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)
[source,tex]
----
[math,file="tex-formula.png"]
--
\begin{align}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xyp
\end{align}
--
----
////
.Tex output
[math,file="tex-formula.png"]
--
\begin{align}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xyp
\end{align}
--
////
== Tex output
image::images/tex-formula.png[]
.For Example (MathML)
[source,xml]
----
[math,file="mathml-formula.png"]
--
--
----
////
.MathML output
[math,file="mathml-formula.png"]
--
--
////
== MathML output
image::images/mathml-formula.png[]
IMPORTANT: Requires Internet Connection. AsciidocFX fetchs MathJax dependencies from CDN.
== Filesystem Tree Extension
You can represent filesystem tree in following `tree` block. There is two style of FS tree.
[source,java]
----
[tree,file="tree-view.png"]
--
#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.
image::images/tree-view.png[]
[source,java]
----
[tree,file="tree-view-new.png"]
--
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__)
image::images/tree-view-new.png[]
== JavaFX Charts Extension
JavaFX has 8 kind of Chart component and AsciidocFX supports all of them.
=== Pie Chart
----
[chart,pie,file="secim-2014-pie.png",opt="title=2014 YEREL SEÇİM SONUÇLARI"]
--
AKP, 45.6, orange
CHP, 27.8,red
MHP, 15.2
BDP, 4.2
SP, 2
--
----
'''
----
chart::pie[data-uri="pie.csv",file="secim-2014-pie-csv.png"]
----
image::images/secim-2014-pie.png[]
=== Area Chart
----
[chart,area,file="area-chart.png"]
--
//April
1, 4
3, 10
6, 15
9, 8
12, 5
//May
1, 20
3, 15
6, 13
9, 12
12, 14
--
----
'''
----
chart::area[data-uri="area.csv",file="area-chart-csv.png"]
----
image::images/area-chart.png[]
For other charts and available options, look at https://github.com/asciidocfx/AsciidocFX/wiki/Chart-Extension[Chart extension] wiki page!
== How to Build AsciidocFX
1. Firstly, install http://www.oracle.com/technetwork/java/javase/downloads/index.html[JDK 8]
2. Download http://maven.apache.org/download.cgi[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 builts with *Travis-CI* automatically.
NOTE: All builds x64 based. If you want to use in x86 systems, build AsciidocFX yourself.
== Books Written with AsciidocFX
Java 8 Ebook::
* https://github.com/rahmanusta/java8-ebook[Github]
* http://kodcu.com/java-8-ebook/[ePub + Kindle + PDF]
AspectJ Ebook::
* https://github.com/ozlerhakan/aspectj-ebook[Github]
* http://kodcu.com/aspectj-ebook/[ePub + Kindle + PDF]
== Used Technologies
AsciidocFX uses Java, JavaScript and XML related technologies.
* Java FX 8
* Asciidoctor.js
* Spring Boot
* Spring WebSocket
* Docbook
* Apache Fop
* Saxon 6.5
* Ace editor
== AsciidocFX Configuration
You can configurate AsciidocFX with `config.yml` file in `/conf` directory
You can change Ace theme, font size, font family and other sections by editing it.
== Some Shortcuts
AFX supports this ace shortcuts https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts and custom shortcuts listed below . If you suggest us any shortcut request, we can implement it.
[width="100%",options="header,footer"]
|===
|Shortcut |Detail
|kbd:[F4] | Show settings
|kbd:[Ctrl+V] |Converts and pastes selection
|kbd:[Ctrl+Shift+V] |Pastes selection
|kbd:[*tblx,y* + Tab] |Generates asciidoc table (x=row,y=column)
|kbd:[*tblx.y* + Tab] |Generates asciidoc table (x=row,y=column)
|kbd:[*src* + Tab] |Generates asciidoc source block (default lang: java)
|kbd:[*src.lang* + Tab] |Generates asciidoc source block by lang
|kbd:[*src,lang* + Tab] |Generates asciidoc source block by lang
|kbd:[*img* + Tab] |Generates image section
|kbd:[*book* + Tab] |Generates book header section
|kbd:[*article* + Tab] |Generates article header section
|kbd:[*uml* + Tab] |Generates UML block
|kbd:[*math* + Tab] |Generates Math block
|kbd:[*tree* + Tab] |Generates Tree block
|kbd:[*quote* + Tab] |Generates Quote block
|kbd:[Ctrl+B] |Bolds selection
|kbd:[Ctrl+I] |Italices selection
|kbd:[Ctrl+U] |Underlines selection
|kbd:[Ctrl+H] |Highlights selection
|kbd:[Ctrl+D] |Duplicates selection
|kbd:[Ctrl+L] |Displays line numbers
|kbd:[Ctrl+X] |Removes current line
|kbd:[Ctrl+N] |Creates new empty doc
|kbd:[Ctrl+M] |Maximizes the tab pane
|kbd:[Ctrl+S] |Saves current doc
|kbd:[Ctrl+W] |Saves and closes current doc
|kbd:[Ctrl+Shift+C] |Surrounds backtick `` selection
|kbd:[Ctrl+Mouse_Scroll_Up] | Zoom in
|kbd:[Ctrl+Mouse_Scroll_Down] | Zoom out
|kbd:[F12] | Opens Firebug Lite (Requires Internet Connection)
|===
== Known Issues
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 https://github.com/TomasMikula/RichTextFX/issues/145[this RichTextFX bug].
. Open `AsciidocFX.vmoptions`.
. Add `-Dprism.text=t2k` and `-Dprism.lcdtext=false` to the file.
. Save and close.
. Launch AsciidocFX
== Changelog
To see what has changed in recent versions of AsciidocFX, see the https://github.com/asciidocfx/AsciidocFX/blob/master/CHANGELOG.asc[CHANGELOG]
== Support
Support AsciidocFX with pull requests or open an issue for bug & feature requests. You can make discussions in https://groups.google.com/d/forum/asciidocfx-discuss[mail group] or in the chat room at https://gitter.im/asciidocfx/AsciidocFX[Gitter.im].