dot

packages and services management
Log | Files | Refs | README

commit 0aa53e811601487d38d2dab974e025b50b34a6e6
parent 553415fa301fa1eb27846a063c030f04a876a08a
Author: josuah <mail@josuah.net>
Date:   Sat,  5 Nov 2016 20:41:44 -0400

Adding a man page to www.

Diffstat:
Mbin/www | 40+---------------------------------------
Abin/www.1 | 95+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mgit/projects | 2+-
DvmR8opj/3 | 36------------------------------------
DvmR8opj/4 | 45---------------------------------------------
DvtGCE6H/2 | 36------------------------------------
DvtGCE6H/3 | 36------------------------------------
7 files changed, 97 insertions(+), 193 deletions(-)

diff --git a/bin/www b/bin/www @@ -1,42 +1,4 @@ -# , , , , , , , , , -# | | | | | | | | | -# `-'-' `-'-' `-'-' 2016-11-04 -#------------------------------------------------------------------------------- -# Static website generator -# -# -# NAME -# www - static website generator -# -# USAGE -# www -# -# DESCRIPTION -# INPUT Source directory from which generate the website -# -# FILES -# INPUT/%s -# File containing the pages layout -# -# INPUT/_* -# Any file starting by "_" will be ignored -# -# INPUT/*/README -# The "README" files content can be displayed on the pages. -# -# LAYOUT FORMAT -# Within a layout.html, there is some templating features, using keywords. -# -# {{ content }} -# Content of README file in the current directory. -# {{ list }} -# List of subpages for the current directory. -# {{ nav }} -# List of top level directories, for use as a <nav> element. -# {{ root }} -# Relative path to the root of the website, for relative links. -# {{ title }} -# Page title, given by the path, with "/" replaced by " > ". +# Mostly plain text static website generator LAYOUT="layout.html" diff --git a/bin/www.1 b/bin/www.1 @@ -0,0 +1,95 @@ +.Dd $Mdocdate: November 11 2016$ +.Dt WWW 1 +.Os +.Sh NAME +. +.Nm www +.Nd static website generator kept as simple as possible +. +.Sh SYNOPSIS +. +.Li cd +.Pa path +.Li && www +. +.Sh DESCRIPTION +. +.Bl -tag +.It path +Source directory from which generate the website. It is also where the website +will be generated. +.El +.Pp +The only thing this script does is building one index.html for each directory, +including +.Pa DIR +itself. +.Pp +Each index.html has the content of a +.Pa layout.html +file in the top +.Pa path +directory, after being parsed. +. +.Sh FILES +. +Some files are treated particularly. +. +.Bl -tag +.It dir/layout.html +File containing the index.html pages layout. +. +.It dir/*/README +The "README" files content can be displayed on the pages if the layout +contains a +.Li {{ content }} +keyword. +. +.It dir/.* +All +.Sy directories +starting with a +.So +\&. +.Sc +will be ignored. +.El +.Pp +All other directories are ignored and let unchanged. +. +.Sh LAYOUT FORMAT +. +Within a layout.html, some templating permit to insert dynamic content into +the index files, by using the following keywords. +. +.Bl -tag +.It {{ content }} +Content of the README file in the current directory, if any. +. +.It {{ list }} +List of links to subpages for the current directory (including dotfiles). +. +.It {{ nav }} +List of top level directories, for use as a <nav> element. +. +.It {{ root }} +Relative path to the root of the website, for relative links. +. +.It {{ title }} +Page title, given by the path, with "/" replaced by " > ". +.El +. +.Sh SEE ALSO +. +.Pa http://marmaro.de +the website that gave me the idea. +.Pp +.Xr werc 1 +.Xr swerc 1 +. +.Sh AUTHORS +. +.Nm www +is made by +.An Josuah Demangeon Aq mail@josuah.net +.Md $$ diff --git a/git/projects b/git/projects @@ -3,7 +3,7 @@ http://github.com/josuah/iirc http://github.com/josuah/cgr http://github.com/josuah/barkdown http://github.com/josuah/Notes ../Notes -http://github.com/josuah/iomenu +ssh://repo.or.cz/iomenu.git http://github.com/josuah/vis http://github.com/josuah/fungus-vs-pathogen http://github.com/josuah/miniwi diff --git a/vmR8opj/3 b/vmR8opj/3 @@ -1,36 +0,0 @@ -# | | -# ,--- |-- ,--. |-- , , ,--- -# `--. | ,--| | | | `--. -# ---' ' `--` ' `--` ---' 2016-11-01 -#------------------------------------------------------------------------------- -# Plain text status line for wherever useful - -mail="$(ls "$MAIL/new" | wc -l)" -mail="${mail#0}" -mail="${mail:+mail $mail}" - -date="$(date +'%Y-%m-%d %H:%M')" - -cpu="$(awk '/cpu/ { - usage = ($2 + $4) / ($2 + $4 + $5) * 100; -} -END { - printf("%i%%", usage); -}' /proc/stat)" - -battery="$(tee < /sys/class/power_supply/BAT1/capacity)%" - -main() { - printf ' ' - while [ "$#" -gt 0 ] - do - printf '%s' "$1" - - [ "$1" -a "$#" -gt 1 ] && printf ' | ' - - shift - done - printf ' ' -} - -main "$mail" "cpu $cpu" "bat $battery" "$date" diff --git a/vmR8opj/4 b/vmR8opj/4 @@ -1,45 +0,0 @@ -# | | -# ,--- |-- ,--. |-- , , ,--- -# `--. | ,--| | | | `--. -# ---' ' `--` ' `--` ---' 2016-11-01 -#------------------------------------------------------------------------------- -# Plain text status line for wherever useful - - -if [ -d "$MAIL/new" ] -then - mail="$(ls "$MAIL/new" | wc -l)" - mail="${mail#0}" - mail="${mail:+mail $mail}" -fi - - -date="$(date +'%Y-%m-%d %H:%M')" - - -cpu="$(awk '/cpu/ { - usage = ($2 + $4) / ($2 + $4 + $5) * 100; -} -END { - printf("%i%%", usage); -}' /proc/stat)" - - -read battery < /sys/class/power_supply/*/capacity -battery="$battery%" - - -main() { - printf ' ' - while [ "$#" -gt 0 ] - do - printf '%s' "$1" - - [ "$1" -a "$#" -gt 1 ] && printf ' | ' - - shift - done - printf ' ' -} - -main "$mail" "cpu $cpu" "bat $battery" "$date" diff --git a/vtGCE6H/2 b/vtGCE6H/2 @@ -1,36 +0,0 @@ -# | | -# ,--- |-- ,--. |-- , , ,--- -# `--. | ,--| | | | `--. -# ---' ' `--` ' `--` ---' 2016-11-01 -#------------------------------------------------------------------------------- -# Plain text status line for wherever useful - -mail="$(ls "$MAIL/new" | wc -l)" -mail="${mail#0}" -mail="${mail:+mail $mail}" - -date="$(date +'%Y-%m-%d %H:%M')" - -cpu="$(awk '/cpu/ { - usage = ($2 + $4) / ($2 + $4 + $5) * 100; -} -END { - printf("%i%%", usage); -}' /proc/stat)" - -battery="$(tee < /sys/class/power_supply/BAT1/capacity)%" - -main() { - printf ' ' - while [ "$#" -gt 0 ] - do - printf '%s' "$1" - - [ "$1" -a "$#" -gt 1 ] && printf ' | ' - - shift - done - printf ' ' -} - -main "$mail" "cpu $cpu" "bat $battery" "$date" diff --git a/vtGCE6H/3 b/vtGCE6H/3 @@ -1,36 +0,0 @@ -# | | -# ,--- |-- ,--. |-- , , ,--- -# `--. | ,--| | | | `--. -# ---' ' `--` ' `--` ---' 2016-11-01 -#------------------------------------------------------------------------------- -# Plain text status line for wherever useful - -mail="$(ls "$MAIL/new" | wc -l)" -mail="${mail#0}" -mail="${mail:+mail $mail}" - -date="$(date +'%Y-%m-%d %H:%M')" - -cpu="$(awk '/cpu/ { - usage = ($2 + $4) / ($2 + $4 + $5) * 100; -} -END { - printf("%i%%", usage); -}' /proc/stat)" - -battery="$(tee < /sys/class/power_supply/BAT2/capacity)%" - -main() { - printf ' ' - while [ "$#" -gt 0 ] - do - printf '%s' "$1" - - [ "$1" -a "$#" -gt 1 ] && printf ' | ' - - shift - done - printf ' ' -} - -main "$mail" "cpu $cpu" "bat $battery" "$date"