0 | |
AsciiDoc Installation
|
1 | |
=====================
|
2 | |
|
3 | |
NOTE: The current version of AsciiDoc requires *Python 3.5 or later*
|
4 | |
to run. If you don't already have an up-to-date version of Python
|
5 | |
installed it can be downloaded from the official Python website
|
6 | |
http://www.python.org/.
|
7 | |
|
8 | |
|
9 | |
Prerequisites
|
10 | |
-------------
|
11 | |
See the link:README.html[README] page.
|
12 | |
|
13 | |
|
14 | |
Installing from the GitHub repository
|
15 | |
-------------------------------------
|
16 | |
The AsciiDoc repository is hosted by https://github.com[GitHub].
|
17 | |
To browse the repository go to https://github.com/asciidoc/asciidoc-py3.
|
18 | |
You can install AsciiDoc from the repository if you don't have an up to
|
19 | |
date packaged version, or you want to get the latest version from the master
|
20 | |
branch:
|
21 | |
|
22 | |
- Make sure you have https://git-scm.com/[Git]
|
23 | |
installed; you can check with:
|
24 | |
|
25 | |
$ git --version
|
26 | |
|
27 | |
- Go to the directory you want to install AsciiDoc into and download
|
28 | |
the repository. This example gets the {revnumber} tagged release:
|
29 | |
|
30 | |
[subs="attributes"]
|
31 | |
$ cd ~/bin
|
32 | |
$ git clone https://github.com/asciidoc/asciidoc-py3 asciidoc-{revnumber}
|
33 | |
$ git checkout {revnumber}
|
34 | |
|
35 | |
You now have two choices: you can run asciidoc locally from your
|
36 | |
repository or you can use 'autoconf(1)' and 'make(1)' to perform a
|
37 | |
system-wide install.
|
38 | |
|
39 | |
Running asciidoc from your local copy
|
40 | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
41 | |
Create a symlink to the AsciiDoc script in a search `PATH` directory
|
42 | |
so it's easy to execute `asciidoc` from the command line, for example:
|
43 | |
|
44 | |
[subs="attributes"]
|
45 | |
$ ln -s ~/bin/asciidoc-{revnumber}/asciidoc.py ~/bin/asciidoc
|
46 | |
$ ln -s ~/bin/asciidoc-{revnumber}/a2x.py ~/bin/a2x
|
47 | |
|
48 | |
Use the git `pull` command to update your local AsciiDoc repository.
|
49 | |
|
50 | |
Installing asciidoc for all users
|
51 | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
52 | |
Create `configure` using 'autoconf(1)'; use `configure` to create the
|
53 | |
`Makefile`; run 'make(1)'; build the man pages; install:
|
54 | |
|
55 | |
---------------------------------------------
|
56 | |
$ autoconf
|
57 | |
$ ./configure
|
58 | |
$ make
|
59 | |
$ sudo make install
|
60 | |
---------------------------------------------
|
61 | |
|
62 | |
To uninstall:
|
63 | |
|
64 | |
---------------------------------------------
|
65 | |
$ sudo make uninstall
|
66 | |
---------------------------------------------
|
67 | |
|
68 | |
|
69 | |
[[X1]]
|
70 | |
Distribution tarball installation
|
71 | |
---------------------------------
|
72 | |
The distribution source tarballs can be downloaded from GitHub
|
73 | |
releases page https://github.com/asciidoc/asciidoc-py3/releases.
|
74 | |
|
75 | |
If your flavor of UNIX or Linux does not have a packaged AsciiDoc
|
76 | |
distribution or if you prefer to install the latest AsciiDoc version
|
77 | |
from source, use the `configure` shell script in the tarball root
|
78 | |
directory.
|
79 | |
|
80 | |
The `autoconf(1)`-generated `configure` script creates a `Makefile`
|
81 | |
that is tailored for your system. To install:
|
82 | |
|
83 | |
[subs="attributes"]
|
84 | |
$ tar -xzf asciidoc-{revnumber}.tar.gz
|
85 | |
$ cd asciidoc-{revnumber}
|
86 | |
$ ./configure
|
87 | |
$ sudo make install
|
88 | |
|
89 | |
To install the documentation:
|
90 | |
|
91 | |
$ sudo make docs
|
92 | |
|
93 | |
To uninstall AsciiDoc:
|
94 | |
|
95 | |
$ sudo make uninstall
|
96 | |
|
97 | |
If Vim is installed on your system the AsciiDoc Vim syntax highlighter
|
98 | |
and filetype detection are already installed as built into the vim runtime.
|
99 | |
|
100 | |
|
101 | |
[[X3]]
|
102 | |
Microsoft Windows installation
|
103 | |
------------------------------
|
104 | |
AsciiDoc is developed and tested on Linux but there seem to be quite a
|
105 | |
few people using it on Windows. To install AsciiDoc on Windows unzip
|
106 | |
the distribution zip file contents:
|
107 | |
|
108 | |
[subs="attributes"]
|
109 | |
$ unzip asciidoc-{revnumber}.zip
|
110 | |
|
111 | |
This will create the folder +asciidoc-{revnumber}+ containing the
|
112 | |
`asciidoc.py` and `a2x.py` executables along with configuration files
|
113 | |
and documentation.
|
114 | |
|
115 | |
To generate DocBook based outputs (e.g. PDFs) you will also need a
|
116 | |
working DocBook toolchain. Installing and configuring a DocBook
|
117 | |
toolchain on Windows can be a challenge -- this blog post explains
|
118 | |
http://blog.rainwebs.net/2010/02/25/how-to-create-handsome-pdf-documents-without-frustration/[How
|
119 | |
to Create Handsome PDF Documents Without Frustration] using
|
120 | |
http://www.cygwin.com/[Cygwin],
|
121 | |
http://dblatex.sourceforge.net/[dblatex] and AsciiDoc.
|
122 | |
|
123 | |
|
124 | |
Testing your installation
|
125 | |
-------------------------
|
126 | |
Test out asciidoc by changing to the AsciiDoc application directory
|
127 | |
and converting the User Guide document (`./doc/asciidoc.txt`) to XHTML
|
128 | |
(`./doc/asciidoc.html`):
|
129 | |
|
130 | |
$ python3 asciidoc.py doc/asciidoc.txt
|
131 | |
|
132 | |
The link:testasciidoc.html[testasciidoc] tool offers a more extensive set of
|
133 | |
conformance tests. You can run the tests by executing this command:
|
134 | |
|
135 | |
$ python3 ./tests/testasciidoc.py run
|
136 | |
|
137 | |
A full battery of tests can be run from the `Makefile` script in the
|
138 | |
distribution root directory:
|
139 | |
|
140 | |
$ make test
|
141 | |
|
142 | |
|
143 | |
[[X2]]
|
144 | |
Prepackaged AsciiDoc installation
|
145 | |
---------------------------------
|
146 | |
The following platform-specific AsciiDoc packages are available:
|
147 | |
|
148 | |
*Fedora Linux*::
|
149 | |
AsciiDoc is included in Fedora Extras, which is available in
|
150 | |
the default Fedora installation. To install asciidoc, execute the
|
151 | |
following command:
|
152 | |
|
153 | |
$ yum install asciidoc
|
154 | |
|
155 | |
*Ubuntu / Debian*::
|
156 | |
AsciiDoc is included in Ubuntu / Debian package manager. To install,
|
157 | |
execute the following command:
|
158 | |
|
159 | |
$ apt install asciidoc
|
160 | |
|
161 | |
*macOS Homebrew*::
|
162 | |
AsciiDoc has been packaged in homebrew and is installable using the
|
163 | |
following command:
|
164 | |
|
165 | |
$ brew install asciidoc
|
166 | |
|
167 | |
See also link:userguide.html#X38[Packager Notes] in the 'AsciiDoc User
|
168 | |
Guide'.
|