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