An Org Mode Exporter Backend For AsciiDoc and Asciidoctor
- Make sure you have org-mode v8.0 or later
- Clone this repository
- Add the following to your .emacs
(add-to-list 'load-path "~/path/to/org-asciidoc/") (require 'ox-asciidoc)
- open a .org file and run
org-asciidoc-export-as-asciidoc
AsciiDoc backend understands the following attributes in a
ATTR_ASCIIDOC
line.
- :asciidoctor-diagram
- Export a source code block as an
Asciidoctor Diagram. Set it as
t
to generate a listing block for an asciidoctor diagram.If you are using Org v9.6 or earlier, make sure to set
:exports
to something non-standard, such asdiagram
. This allows us to get:file
parameter in the exporter.e.g)
#+ATTR_ASCIIDOC: :asciidoctor-diagram t #+BEGIN_SRC ditaa :file images/hello-world.png :exports diagram +--------------+ | Hello World! | +--------------+ #+END_SRC
- :width
- a percentage value to specify the table width with in the
current column. Valid values: 1…99.
e.g)
#+ATTR_ASCIIDOC: :width 50 | Name | Phone | Age | | Peter | 1234 | 17 | | Anna | 4321 | 25 |
- :pgwide
- a boolean value to specify the table should be column
width or full page width in multi-column setup. Valid values:
t
ornil
.e.g)
#+ATTR_ASCIIDOC: :pgwide t | Name | Phone | Age | | Peter | 1234 | 17 | | Anna | 4321 | 25 |
If you want to use `org-publish` with ox-asciidoc, setup your `org-publish-project-alist` like this:
(setq org-publish-project-alist
'(("my-proj"
:base-directory "/tmp/my-dir"
:publishing-directory "/tmp/pub-dir"
:publishing-function org-asciidoc-publish-to-asciidoc)))