A Command Line Tool to manage asciidoctor projet; create, add content, watch content and convert it into html, pdf & epub3 files for documents, reports, revealjs slideshow, hands on lab & more
This project enhances what is not included within the asciidoctor command line tool. It is a refactoring of the ruby hyla tool which is currently used to create a project, add asciidoctor templates, generate courses, hands on lab content, slideshows for RevealJS presentations, ...
The project name corresponds to the frog genus name Litoria which contain many species like the Red Eye Tree Frog Litoria Chloris which is very valuable for the human due to his medical capacities
litoria command line tool via npm:
$ npm install -g litoria
$ litoria <cmd> <option> <yaml_config_file>
<cmd> corresponds to one of the command available: init, generate, inline, pdf and the options to the rendering required; html, pdf, ...
The asciidoctor attributes and the options like the source and destination folders can be defined using a yaml config file
source: "./source" # or could be a directory eg. ./examples file_to_inline: "./generated/output.html" file_inlined: "./generated/output-inlined.html" attributes: # Asciidoctor attributes stylesheet: 'foundation.css' # asciidoctor, foundation stylesdir: 'css' # directory defined within the source folder and containing the css styles nofooter: 'yes' icons: 'font' # linkcss: 'true' # Don't use this option if you want to embed the CSS options: # Asciidoctor options doctype: 'article' to_dir: 'generated' # to_file: 'output.html' safe: 'unsafe' # Required to avoid that the file to process is not loaded
Create a project containing a default config file and a simple adoc file
litoria init /path/to/project
Many project type or category are supported as described here after :
To use such type, pass the option
--category with the keywords
slideshow. The default category is
litoria init /path/to/project litoria init -c management /path/to/project litoria init -c lab /path/to/project
Render the asciidoctor(s) file(s) part of the input directory source into a HTML file. The generated content is available within the generated folder.
litoria generate -r html config.yaml
litoria generate config.yaml as the default rendering is `html`
The source and destination folders can be changed within the yaml config file.
The purpose of this command is to move the css styles from the css files or style tag and to inline them within the HTML tag of the document. This is required when you would like to send an email to by example the Gmail client as Google will escape the styles & css file before to display your mail and it HTML content within the browser.
litoria inline config.yaml
Convert a HTML file into a PDF file
litoria generate -r pdf config.yaml
Send an email to a SMTP server & embed the HTML generated within the Mail created
litoria send config.yaml
The parameters as the subject, sender, recipient, SMTP Server, port number, security mode are defined within the config.yaml file.
Git clone the project locally and move to the cloned directory.
To install globally the commands, use these instructions:
npm install -g npm link
then you can execute the
litoria commands in a terminal and continue to develop the project in parallel.
Otherwise, you can run the different commands as such :
Execute in a terminal theis command by example to create a new project :
node bin/litoria.js init /path/to/project
To debug the project and the different commands, use the following information to configure the debugger (Eclipse, IntelliJ, ...) :
The litoria.js script file contains all the commands which are defined within their corresponding file
bindirectory. Each command, as described previously, is configured differently. Please refer to the Command section to see which parameters you can use. Don't try to debug the
litoria.jsscript as it spawns another child process and your Debugger will report a Network Address Port error as it can't access the port ! ## Build & test
nvm use default 6 && make
Links to the projects used