Un naufragio personal

artemus - Text substitution tool and much more


 artemus -i|--input={input file} -o|--output={output file}
	[-c|--conf={config file}]
	[-m|--msdos] [-a|--append]


artemus is a text substitution tool (thought mainly for preprocessing HTML). Macros are defined in the file artemus.conf, in the form key=value, being value the destination text, that can have parameters. The macro is included in the source file between the {- and } marks. The (possible) parameters are delimited by the | symbol.


In artemus.conf file:

 # some simple definitions
 Perl=<a href="">Perl</a>
 LWN=<a href="">Linux Weekly News</a>
 head=<html><body bgcolor=ffffff>
 # definitions with parameters
 # generic link
 link=<a href="http://$1">$0</a>
 # generic meta
 meta=<meta name="$1" content="$0">
 # link using the link macro

In a source file index.artemus:

 {-meta|links, free software|keywords}

By running

 artemus -i index.artemus -o index.html

you obtain the file index.html:

 <html><body bgcolor=ffffff>
 <meta name="keywords" content="links, free software">
 <li><a href="">Perl</a>
 <li><a href="">Linux Weekly News</a>
 <li><a href="">CPAN</a>
 <li><a href=""></a>

The --paragraph argument let us define a string to substitute the empty lines in the document. If defined as <p>, you can create HTML documents separating the paragraphs with only a blank line, as artemus will fill them with <p>.

The --msdos argument creates the typical MSDOS end of line, CR+LF.

The --append argument appends the output to destination file, instead of overwriting it.


(C) Angel Ortega <> 2000/2008