Updated a6 ideas.
[artemus.git] / artemus_cmd.pod
blobaa9ee65f96bc2f3272d2d3447b8372fa32d9d715
1 =pod
3 =head1 NAME
5 artemus - Text substitution tool and much more
7 =head1 SYNOPSIS
9  artemus -i|--input={input file} -o|--output={output file}
10         [-c|--conf={config file}]
11         [-p|--paragraph={paragraph_separator}]
12         [-m|--msdos] [-a|--append]
14 =head1 DESCRIPTION
16 B<artemus> is a text substitution tool (thought mainly for preprocessing HTML).
17 Macros are defined in the file F<artemus.conf>, in the form B<key=value>,
18 being B<value> the destination text, that can have parameters. The macro is
19 included in the source file between the B<{-> and B<}> marks. The (possible)
20 parameters are delimited by the B<|> symbol.
22 Examples:
24 In F<artemus.conf> file:
27  # some simple definitions
28  Perl=<a href="http://www.perl.com">Perl</a>
29  LWN=<a href="http://www.lwn.net">Linux Weekly News</a>
30  separator=<br><hr><br>
31  head=<html><body bgcolor=ffffff>
33  # definitions with parameters
34  # generic link
35  link=<a href="http://$1">$0</a>
36  # generic meta
37  meta=<meta name="$1" content="$0">
38  # link using the link macro
39  CPAN={-link|CPAN|www.cpan.org}
41 In a source file F<index.artemus>:
43  {-head}
44  {-meta|links, free software|keywords}
45  <h1>Links</h1>
46  <ul>
47  <li>{-Perl}
48  <li>{-LWN}
49  <li>{-CPAN}
50  <li>{-link|kernel.org|www.kernel.org}
51  </ul>
52  {-separator}
54 By running
56  artemus -i index.artemus -o index.html
58 you obtain the file F<index.html>:
60  <html><body bgcolor=ffffff>
61  <meta name="keywords" content="links, free software">
62  <h1>Links</h1>
63  <ul>
64  <li><a href="http://www.perl.com">Perl</a>
65  <li><a href="http://www.lwn.net">Linux Weekly News</a>
66  <li><a href="http://www.cpan.org">CPAN</a>
67  <li><a href="http://www.kernel.org">kernel.org</a>
68  </ul>
69  <br><hr><br>
71 The I<--paragraph> argument let us define a string to substitute the empty
72 lines in the document. If defined as <p>, you can create HTML documents
73 separating the paragraphs with only a blank line, as B<artemus> will fill
74 them with <p>.
76 The I<--msdos> argument creates the typical MSDOS end of line, CR+LF.
78 The I<--append> argument appends the output to destination file, instead
79 of overwriting it.
81 =head1 AUTHOR
83 (C) Angel Ortega <angel@triptico.com> 2000/2008
85 =cut