tupdate docu; add mdexample; add better md support - mars - superminimal static website framework
 (HTM) git clone git://parazyd.org/mars.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 654c586bc7eaad78a17fbef50a5f40ca3f569a58
 (DIR) parent a16e47faeb4a32510397580735fc6bae1540b7ae
 (HTM) Author: parazyd <parazyd@dyne.org>
       Date:   Fri,  1 Jul 2016 15:36:14 +0200
       
       update docu; add mdexample; add better md support
       
       Diffstat:
         M README.md                           |      20 +++++++++++++++++++-
         D example/header.php                  |      14 --------------
         R example/footer.php -> example/mark… |       0 
         A example/markdown/header.html        |      13 +++++++++++++
         A example/markdown/index.html         |      49 +++++++++++++++++++++++++++++++
         A example/markdown/index.md           |       5 +++++
         A example/markdown/navigation.html    |      24 ++++++++++++++++++++++++
         R example/footer.php -> example/php/… |       0 
         A example/php/header.php              |      14 ++++++++++++++
         R example/index.php -> example/php/i… |       0 
         R example/navigation.php -> example/… |       0 
         M mars.sh                             |      15 +++++++++++++--
         M webtree                             |       7 +++++--
       
       13 files changed, 142 insertions(+), 19 deletions(-)
       ---
 (DIR) diff --git a/README.md b/README.md
       t@@ -26,6 +26,9 @@ the `pageformat` variable tells mars to either use php or markdown
        
        the `exclude` array is an array of (php/md) files you don't want to be processed.
        
       +`precontent` and `postcontent` is (usually) html code in files that will be
       +concatenated in order - before and after our markdown content (respectively)
       +
        the `rsync-exclude` file contains the list of things for rsync to ignore.
        
        sidenote: rsync goes over ssh by default, but is easily configurable
       t@@ -46,11 +49,26 @@ an optional third step will delete the html files from the webtree
        ```
        
        ## example/ explained
       -the `example` directory shows you how i personally use mars.
       +the `example` directory shows you ways to use mars with php and markdown
        
       +### php
        `index.php` is the only thing that is being generated as `index.html`
        
        mars will process it, and as it's in php, `footer`, `header` and `navigation`
        are included from `index.php` and get included in the final page. this makes it
        very easy to manage your content, as the only part you actually have to worry
        about in `index.php` is the content (text).
       +
       +### markdown
       +`index.md` is the page that is being generated for our static `index.html`
       +
       +a custom parseable option is the page title which can be seen in the first line
       +of `index.md`
       +
       +the "syntax" to declare your page's title is
       +
       +```
       +##+ this is my page's title
       +```
       +
       +this line will not end up in your final html.
 (DIR) diff --git a/example/header.php b/example/header.php
       t@@ -1,14 +0,0 @@
       -<!DOCTYPE html>
       -<html>
       -<head>
       -        <meta charset="utf-8">
       -        <meta name="description" content="Who is parazyd, software developer, designer, crypto, bitcoin, linux administrator">
       -        <title><?php echo $title; ?> : parazyd.cf</title>
       -        <link rel="stylesheet" type="text/css" href="style.css">
       -</head>
       -        <div id="header">
       -                <a href="/"><img alt="logo" src="logo.svg"></a>
       -                <a id="headerLink" href="/">parazyd.cf</a> <span id="headerSubtitle">something something</span>
       -        </div>
       -
       -<?php include "navigation.php"; ?>
 (DIR) diff --git a/example/footer.php b/example/markdown/footer.html
 (DIR) diff --git a/example/markdown/header.html b/example/markdown/header.html
       t@@ -0,0 +1,13 @@
       +<!DOCTYPE html>
       +<html>
       +<head>
       +        <meta charset="utf-8">
       +        <meta name="description" content="Who is parazyd, software developer, designer, crypto, bitcoin, linux administrator">
       +        <title>DEFAULT_TITLE</title>
       +        <link rel="stylesheet" type="text/css" href="../style.css">
       +</head>
       +        <div id="header">
       +                <a href="/"><img alt="logo" src="../logo.svg"></a>
       +                <a id="headerLink" href="/">parazyd.cf</a> <span id="headerSubtitle">something something</span>
       +        </div>
       +
 (DIR) diff --git a/example/markdown/index.html b/example/markdown/index.html
       t@@ -0,0 +1,49 @@
       +<!DOCTYPE html>
       +<html>
       +<head>
       +        <meta charset="utf-8">
       +        <meta name="description" content="Who is parazyd, software developer, designer, crypto, bitcoin, linux administrator">
       +        <title>This is da real title</title>
       +        <link rel="stylesheet" type="text/css" href="../style.css">
       +</head>
       +        <div id="header">
       +                <a href="/"><img alt="logo" src="../logo.svg"></a>
       +                <a id="headerLink" href="/">parazyd.cf</a> <span id="headerSubtitle">something something</span>
       +        </div>
       +
       +        <div id="menu">
       +                <span class="left">
       +                <a class="thisSite" href="https://parazyd.cf">home</a>
       +                <a href="https://moo.parazyd.cf">moo</a>
       +                <a href="https://pub.parazyd.cf">pub</a>
       +                </span>
       +        </div>
       +
       +        <div id="content">
       +        <div id="nav">
       +
       +        <ul>
       +        <li><a  href="/">main</a></li>
       +        <li><a href="https://git.parazyd.cf">code/</a></li>
       +        <li><a href="/blog/">blog/</a></li>
       +        <li><a href="/blog/musings/">&nbsp;&nbsp;&nbsp;&nbsp;musings/</a></li>
       +        <li><a href="/projects/">projects/</a></li>
       +        <li><a href="/contact.html">contact</a></li>
       +        <li><a href="https://www.dyne.org">../dyne.org</a></li>
       +        </ul>
       +
       +        </div>
       +
       +        <div id="main">
       +<h1>And this will be teh header</h1>
       +<p>and more st00f</p>        </div>
       +
       +        </div>
       +
       +        <div id="footer">
       +        <span class="right">
       +                copyleft 2016 parazyd, design heavily inspired by <a href="http://suckless.org">suckless.org</a> ♥
       +        </span>
       +        </div>
       +</body>
       +</html>
 (DIR) diff --git a/example/markdown/index.md b/example/markdown/index.md
       t@@ -0,0 +1,5 @@
       +##+ This is da real title
       +
       +# And this will be teh header
       +
       +and more st00f
 (DIR) diff --git a/example/markdown/navigation.html b/example/markdown/navigation.html
       t@@ -0,0 +1,24 @@
       +        <div id="menu">
       +                <span class="left">
       +                <a class="thisSite" href="https://parazyd.cf">home</a>
       +                <a href="https://moo.parazyd.cf">moo</a>
       +                <a href="https://pub.parazyd.cf">pub</a>
       +                </span>
       +        </div>
       +
       +        <div id="content">
       +        <div id="nav">
       +
       +        <ul>
       +        <li><a  href="/">main</a></li>
       +        <li><a href="https://git.parazyd.cf">code/</a></li>
       +        <li><a href="/blog/">blog/</a></li>
       +        <li><a href="/blog/musings/">&nbsp;&nbsp;&nbsp;&nbsp;musings/</a></li>
       +        <li><a href="/projects/">projects/</a></li>
       +        <li><a href="/contact.html">contact</a></li>
       +        <li><a href="https://www.dyne.org">../dyne.org</a></li>
       +        </ul>
       +
       +        </div>
       +
       +        <div id="main">
 (DIR) diff --git a/example/footer.php b/example/php/footer.php
 (DIR) diff --git a/example/php/header.php b/example/php/header.php
       t@@ -0,0 +1,14 @@
       +<!DOCTYPE html>
       +<html>
       +<head>
       +        <meta charset="utf-8">
       +        <meta name="description" content="Who is parazyd, software developer, designer, crypto, bitcoin, linux administrator">
       +        <title><?php echo $title; ?> : parazyd.cf</title>
       +        <link rel="stylesheet" type="text/css" href="../style.css">
       +</head>
       +        <div id="header">
       +                <a href="/"><img alt="logo" src="../logo.svg"></a>
       +                <a id="headerLink" href="/">parazyd.cf</a> <span id="headerSubtitle">something something</span>
       +        </div>
       +
       +<?php include "navigation.php"; ?>
 (DIR) diff --git a/example/index.php b/example/php/index.php
 (DIR) diff --git a/example/navigation.php b/example/php/navigation.php
 (DIR) diff --git a/mars.sh b/mars.sh
       t@@ -42,7 +42,10 @@ countdown() {
                printf "\n===========================================================\n\n"
        }
        
       -trapctrlc() { print "\n\n"; wrn "aborting..."; exit 2 }
       +trapctrlc() {
       +        rm -f $tmpage
       +        print "\n\n"; wrn "aborting..."; exit 2
       +}
        trap "trapctrlc" 2
        # }}}
        
       t@@ -81,15 +84,23 @@ process-page() {
                                        || print "$(msgnope) $name.$pageformat                ->        $name.html";;
        
                        md|markdown)
       +                        rm -f $name.html
                                [[ -z $precontent ]] || {
                                        for i in $precontent; do
                                                cat $i >> $name.html
                                        done }
        
       -                        python -m markdown $page >> $name.html \
       +                        local pagetitle=`grep '^##+ ' $page | cut -c 5- -`
       +                        sed -i -e 's/DEFAULT_TITLE/'$pagetitle'/' $name.html
       +                        tmpage=`mktemp` && cp $page $tmpage
       +                        sed -i -e 's/##+ .*//' $tmpage
       +
       +                        python -m markdown $tmpage >> $name.html \
                                        && print "$(msgokay) $name.$pageformat                ->        $name.html" \
                                        || print "$(msgnope) $name.$pageformat                ->        $name.html"
        
       +                        rm $tmpage
       +
                                [[ -z $postcontent ]] || {
                                        for i in $postcontent; do
                                                cat $i >> $name.html
 (DIR) diff --git a/webtree b/webtree
       t@@ -20,8 +20,11 @@ pageformat=md
        #        pub/tmp
        #        pub/tmp/screenshots
        # )
       +# tree=(
       +#        example/php
       +# )
        tree=(
       -        example
       +        example/markdown
        )
        
        # here add files you want excluded from being generated as .html
       t@@ -37,7 +40,7 @@ exclude=(
        # )
        
        ## markdown specific settings
       -[[ $pageformat == md ]] && { ## markdown specific settings
       +[[ $pageformat == md ]] && {
        
                # html that is put in order before the conten
                precontent=(header.html navigation.html)