From 7011f93b733bb47fb9d0f98908b985d3339eff49 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Sat, 25 May 2013 11:09:26 -0400 Subject: [PATCH] Index menu generation --- Makefile | 2 +- style.css | 20 +++++++++++++++++++- tpl/.config | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 072fda0..2a633bb 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ thoughts: articles: $(articles) www-root: articles thoughts mkdir -p www-root/papers - ( cd docs/ && find . -name '*.html' -exec cp {} ../www-root/{} \; ) + ( cd docs/ && find . -name '*.html' -exec ../tools/doc-cp {} ../www-root/{} \; ) cp -r images/ www-root/ cp style.css www-root/ ln -sf ../images www-root/papers/images diff --git a/style.css b/style.css index 2041174..645c0f3 100644 --- a/style.css +++ b/style.css @@ -14,7 +14,7 @@ header, footer, text-align: left; } -h1, h2, h3 { +h1, h2, h3, #menu { font-family: 'URW Gothic L', 'Avant Garde', sans-serif; font-weight: normal; } @@ -48,6 +48,24 @@ h2.desc { margin-bottom: 3em; } +#menu { + text-align: center; +} +#menu li { + display: inline; + font-size: 1.4em; + letter-spacing: 0.05em; +} +#menu li a { + color: #666f63; + text-decoration: none; + border-left: 1px solid #868f83; + padding: 0.15em 1em; +} +#menu li:first-child a { + border-left: none; +} + p#ref-0 { margin-top: 2em; } diff --git a/tpl/.config b/tpl/.config index ef75637..053e306 100644 --- a/tpl/.config +++ b/tpl/.config @@ -2,8 +2,40 @@ # # Basic template configuration; command-line options will override +get-menu-docs() +{ + paths=$( + find "$path_root/docs" -maxdepth 1 -name '*.htm?' -exec basename {} \; \ + | sort + ) + + for p in $paths; do + # we shall consider the name of the link to be the path with the extension + # and sorting prefix stripped + name="$( basename "${p%%.htm?}" )" + echo "${name#??-}" + done +} + html_external_css=/style.css +# menu just below the header, above the index +html_pre_index="$( + + echo '' +)" + + # additional content in the footer before the copyright (the awkward newline # positions are to prevent spaces in the output) html_footer=$(cat <