#+name: menu
#+BEGIN_SRC sh :exports both
sed -n '/<nil id="nil">/,/<\/nil>/p' sitemap.html > menu.html
sed -i '/index\.html/d' menu.html
sed -i -e 's/href="/href="..\//g' menu.html
sed -i -r 's/<li>([0-9]-)(.*)/<li><a href="\.\.\/\1\2\/index.html">\2<\/a>/g' menu.html
sed -i -e 's/<nil id="nil">/<nav class="navbar">\n<h2 class="titlenav">indice<\/h2>/g' menu.html
sed -i -e 's/\/nil/\/nav/g' menu.html
sed 's/\.\.\//.\/stories\//g' menu.html > menu-lev0.html
#+END_SRC

#+RESULTS: menu
