Skip to content

aiq/adoc_cmd_ext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adoc_cmd_ext

AsciiDoc has out of the box no functionality like \newcommand from LaTeX. This project implements a Lua script and module that allows to define and use a similar functionality for AsciiDoc files. The Lua script works as a preprocessor that generates AsciiDoc files.

Note
Both, the library and the script, just work. They are created for private usage and only offer my minumum requirements.

Usage

First you should define one or more commandos inside a seperate file.

acmd-file:

/=
func_def[:name:]
-->
==== {name}[[{name}]]
=/

/= func[:name:] --> <<{name}>> =/

After the definition you can use the commandos inside an AsciiDoc file.

adoc-file:

/:func_def[reset_duration_error_c]
...
/:func[reset_duration_error_c]

Now you can use the Lua script to apply the commands on the adoc-file.

$ adoc_cmd_ext acmd-file adoc-file result-file

The result in this test case will look like the following file.

result-file:

==== reset_duration_error_c[[reset_duration_error_c]]
...
<<reset_duration_error_c>>

You can process this file now with your existing AsciiDoc tool chain.

Installation

To install the version 0.1.0 of adoc_cmd_ext use LuaRocks with the following line.

luarocks install adoc_cmd_ext

If you want to use the current development version, clone this repository and use LuaRocks with the following command.

luarocks make dist/adoc_cmd_ext-scm-0.rockspec

About

AsciiDoc command preprocessor extension

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages