This document describes the use of apollon, specifically from the command line. This does not describe the API.
Currently there are two methods of installing apollon, however both are essentially the same thing.
For both methods you will need a rust installation with cargo. See the Official Guide for more information.
The easier method of installing apollon is to use cargo, rust's package manager.
cargo install apollon
That command will install apollon's latest release into cargo's installation directory. By default on UNIX-like systems, that path is "$HOME/.cargo/bin", make sure the installation path is included in the $PATH/%PATH% variable. This should be set by default when installing through rust up.
To install from source, First clone the source code:
git clone 'https://notabug.org/erislmm/Apollon.git' cd Apollon
then install with
cargo intstall --path .
On UNIX-like systems, or
cargo install /path .
On Windows.
this will also install apollon to cargo's default installation directory. On UNIX-like systems this is "$HOME/.cargo/bin", which is added to $PATH/%PATH% by default when installing via rustup.
The most basic use of the apollon command is
apollon [options] file
which will compile the input file() using the 'ANSI' generator (see Generators). To read the file to the terminal use
more file.out
You should see a formatted version of the text (see Formatting).
For all the options listed, on UNIX-like systems prepend '-' and '--' for short and long options respecively, and prepend '/' for Windows.
Long | Short | Description |
---|---|---|
generator | g | Set the generator. |
help | h | Display help message. |
output | o | Sets the output file. |
version | V | Prints version number. |
In Apollon, formatting is done through 'commands', currently there are only 11 basic commands. They are as such:
Long | Short | Description |
---|---|---|
title | Title of the document | |
author | Author of the document | |
date | Date written | |
# | Comment (not included) | |
newline | nl | Forced newline |
nheader | nhead | A numbered header |
header | head | A unnumbered header |
bold | bl | Bold text formatting |
italic | il | Italic text formatting |
bold-italic | bi | Bold and italic formatting |
If no command is supplied then the text is not formatting in any special way.
Every command in Apollon is at the start of a line and followed by a colon (':'). For example:
bl: This is bold, and this is not
is valid, but something like:
hello, il: world!
isn't valid, nor is having multiple commands on the same line like:
bold: THIS il: is invalid
Newlines in apollon do not force a line break, to force a line break use an empty line. For example:
bold: bold text italic: and some italic on the same line!
But this is on a different line!
Currently there are 2 inbuilt generators in Apollon (with plans to expand). There is the ANSI (default) generator, and the HTML (generator).
The ANSI Generator is the default generator, it outputs the text interspersed with ANSI control codes for the formatting. To read a file generated by the ANSI generator, open up your favourite terminal and use:
cat .out
or any other file reading utility, such as 'less' or 'more'.
The use of a terminal emulator is important here, most terminals interpret ANSI control codes for text formatting. This is how the formatting works. The HTML Generator tries to generate correct HTML documents. Currently there isn't any support for custom style sheets, but it is in the works.
To view the generated HTML, open your favourite web browser and go to "file://.html".