# atom.awk
       
       ## TL;DR
       
       ```
       mkdir posts
       vi posts/entry1.txt
       # write something, 
       #    first line is title,
       #    second line is post's date you can get with "date +'%Y-%m-%dT%TZ'"
       $ awk -f atom.awk \
           -v domain="mydomain.tld" \
           -v author="batman.tld" \
           posts/ > atom.xml
       
       # upload atom.xml on your server
       ```
       
       ## Description
       
       Whether you write files in plain text, markdown or any other markup language, you may want to create an atom feed. An atom feed with html content is a pain and restrictive. atom.awk let you publish your posts without any changes, in plain text as example. Doing so, you can publish an ATOM feed only blog such as suggested on shinobi.website.
       
       This tool take a list of file as input and will generate an atom feed with the content of each fil as description.
       
       No need for html escape or any conversion : it is plain text in a CDATA tag.
       
       You can even write "]]>" in your pages, it will be escaped.
       
       Each post 1st line is the title. Post's 2nd line is publication date. Date format must be "%Y-%m-%dT%TZ". Use ''date +%Y-%m-%dT%TZ''.
       
       atom.awk is an awk script, available on most unix-like.
       
       ## Options
       
       Use ''-v flag'' when calling atom.awk to adjust the following options:
       
       * max: maximum of item in the feed. default is 0, wich means no limit
       * domain: domain name of your feed.
       * feedurl: url where the feed will be stored.
       * author: default is john_doe
       * email: default is ''${author}@${domain}''
       * cmd: command to list posts files. By default it looks for all ".txt" files in the directory given as argument. Default is ''find ${directory} -name *.txt | sort -r''
       * feedtitle : title of your feed.
       
       Of course, you can edit source code to add more elements to the header, such as ''<rights>'' tag or ''<icon>''.
       
       ## Full example
       
       Call atom.awk with minimal variables :
       
       ```
       awk -f atom.awk -v domain="si3t.ch" -v author="prx" -v feedtitle="prx's blog" posts/
       ```
       
       Or if you want to setup all options. Notice it will give the exact same output as above :
       
       ```
       awk -f atom.awk \
           -v max=100 \
               -v protocol="https" \
           -v domain="si3t.ch" \
           -v feedurl="https://si3t.ch/posts/atom.xml"
           -v author="prx"\
           -v email="prx@si3t.ch"\
           -v feedtitle="prx's blog"\
           posts/
       ```
       
       ## Download
       
 (BIN) atom.awk
       
       ## See also
       
 (HTM) https://shinobi.website/index.txt
       
       ---
 (DIR) /