hglmandel/create_ymd.sh

61 lines
1.5 KiB
Bash
Raw Normal View History

2012-05-03 13:40:35 +00:00
#!/usr/bin/env zsh
function writeTOC() {
# Create the TOC
cat <<END
> <center><hr style="width:30%;float:left;border-color:#CCCCD0;margin-top:1em"/><span class="sc"><b>Table of Content</b></span><hr style="width:30%;float:right;border-color:#CCCCD0;margin-top:1em"/></center>
>
2012-05-11 14:53:51 +00:00
> * This will be replaced by the ToC
> {:toc}
2012-05-03 13:40:35 +00:00
>
END
2012-05-11 14:53:51 +00:00
}
2012-05-03 13:40:35 +00:00
cat <<END
-----
isHidden: false
menupriority: 1
kind: article
created_at: 2012-02-08T15:17:53+02:00
en: title: Haskell OpenGL Mandelbrot
en: subtitle: A kind of real world example
fr: title: Afficher mandelbrot en OpenGL avec Haskell
fr: subtitle: Un exemple d'utilisation d'Haskell
author_name: Yann Esposito
author_uri: yannesposito.com
tags:
- Haskell
- programming
- functional
- tutorial
-----
2012-05-10 14:51:24 +00:00
blogimage("mandelbrot_3D.png","3D Mandelbrot Set")
2012-05-03 13:40:35 +00:00
begindiv(intro)
en: %tldr A progressive real world example.
fr: %tlal Un exemple progressif de programmation avec Haskell.
END
2012-05-10 14:51:24 +00:00
writeTOC
2012-05-03 13:40:35 +00:00
cat <<END
enddiv
END
2012-05-03 16:09:00 +00:00
for fic in **/*.lhs(.N); do
2012-05-03 13:40:35 +00:00
contains_haskell=$(( $( egrep '^>' $fic | wc -l) > 0 ))
((contains_haskell)) && \
print -- "\n<hr/><a href=\"code/$fic\" class=\"cut\">${fic:h}/<strong>${fic:t}</strong></a>\n"
cat $fic
((contains_haskell)) && \
print -- "\n<a href=\"code/$fic\" class=\"cut\">${fic:h}/<strong>${fic:t}</strong> </a>\n"
2012-05-04 14:29:32 +00:00
done | perl -pe 'BEGIN{$/="";} s#((^>.*\n)+)#<div class="codehighlight">\n<code class="haskell">\n$1</code>\n</div>\n#mg' | perl -pe 's#^> ?##' | perl -pe 's/^ #/#/'