dot

packages and services management
Log | Files | Refs | README

commit 1fc7b73c409396c33ad7eb9907c688eff01d8866
parent 23ec137524ebcdb9a83a3785f5d47c524f64c6d2
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri,  7 Apr 2017 15:23:33 +0200

better, simpler www-git

Diffstat:
M.config/git/config | 2+-
M.emacs.d/init.el | 2++
Mbin/mb-all | 2+-
Mbin/www-git | 33+++++++++++++--------------------
Mbin/www-mandoc | 27++++++++++++---------------
Mdwm/config.h | 2+-
6 files changed, 30 insertions(+), 38 deletions(-)

diff --git a/.config/git/config b/.config/git/config @@ -2,7 +2,7 @@ [user] email = mail@josuah.net - name = Josuah Demangeon⠠⠵ + name = Josuah Demangeon [core] excludesfile = ~/.gitignore diff --git a/.emacs.d/init.el b/.emacs.d/init.el @@ -48,6 +48,8 @@ (lambda () (message "Emacs loaded in %s" (emacs-init-time)))) (defalias 'yes-or-no-p 'y-or-n-p) +(column-number-mode) + (require 'files) (setq backup-directory-alist ;Backup and autosaves diff --git a/bin/mb-all b/bin/mb-all @@ -1,4 +1,4 @@ # list mail from all inboxes using mblaze -mdirs "${MAIL%/*}" | xargs mlist | msort -r -d | mseq -S | mscan | +mdirs "$MAIL" | xargs mlist | msort -r -d | mseq -S | mscan | $PAGER diff --git a/bin/www-git b/bin/www-git @@ -6,23 +6,18 @@ head() { - printf '<!DOCTYPE html> + printf '<!doctype html> <html> <head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<meta charset="UTF-8" /> <title>%s</title> -<link rel="icon" type="image/png" href="%s/favicon.png" /> -<link rel="stylesheet" type="text/css" href="%s/git.css" /> +<link rel="icon" type="image/png" href="%s/favicon.png" /> +<link rel="stylesheet" type="text/css" href="%s/git.css" /> </head> <body> -<a href="%s">&lt;</a> -<b>%s</b> -- <span style="color: grey;">%s</span> -- <a href="%s">files</a> -- <a href="%s/commit">commits</a> -<hr> -' "$2" "$1" "$1" "$1" "$repo" "$desc" "$1/git/$repo" "$1/git/$repo" +<h1>%s<span id="description">%s</span></h1> +' "$2" "$1" "$1" "$repo" "$desc" } @@ -80,7 +75,8 @@ commits() printf '<th>%s</th>' 'Date' 'Commit message' 'Author' printf '</tr>\n</thead>\n<tbody>\n' - git log --format='<tr><td>%ad</td><td><a href="%H.html">%s</a></td><td>%an</td></tr>' --date='short' + f='<tr><td>%ad</td><td><a href="commit/%H.html">%s</a></td><td>%an</td></tr>' + git log --format="$f" --date='short' for hash in $(git log --format='%H') do @@ -147,7 +143,7 @@ files() printf '\n</tbody>\n</table>\n' - [ -f 'README' ] && printf '<hr/>\n' && file 'README' + [ -f 'README' ] && printf '<h2/>README</h2>\n' && file 'README' } @@ -156,14 +152,11 @@ repo() mkdir -p "$pwd/$repo/commit" { - head '../../..' "Commits - $repo" - commits - foot - } > "$pwd/$repo/commit/index.html" - - { - head '../..' "Files - $repo" + head '../..' "$repo" + printf '<h2>files</h2>\n' files + printf '<h2>commits</h2>\n' + commits foot } > "$pwd/$repo/index.html" diff --git a/bin/www-mandoc b/bin/www-mandoc @@ -1,25 +1,22 @@ -# walk a 2-level tree and convert .7 to .{html,txt,pdf) documents +# walk a 2-level tree and convert *.[1-9] troff to .{html,txt,pdf) documents find "$1" -mindepth 1 -maxdepth 1 -type d | sort | while IFS='' read -r dir do - printf '<h2>%s</h2>' "${dir##*/}" + printf '\n<h2>%s</h2>\n<table>\n' "${dir##*/}" - printf '<ul>' - find "$dir" -mindepth 1 -maxdepth 1 -type f -name "*.7" | sort | - while IFS='' read -r file + find "$dir" -mindepth 1 -maxdepth 1 -type f -name "*.[1-9]" | sort | + while IFS='' read -r f do - printf '<li>%s\n' "$(sed -n '/^.Nd/ s/^.Nd // p' "$file")" - printf '<span class="nav">' - - printf '<a href="%s">html</a> - ' "${file%.7}.html" - printf '<a href="%s">txt</a> - ' "${file%.7}.txt" - printf '<a href="%s">pdf</a> - ' "${file%.7}.pdf" - printf '<a href="%s">7</a>' "$file" - printf '</span>\n</li>\n' + printf '<tr>' + printf '<td>%s</td>' "$(sed -n '/^.Nd/ s/^.Nd // p' "$f")" + printf '<td class="nav">' + printf '<a href="%s">%s</a>' \ + "${f%.7}.html" html "${f%.7}.txt" txt "${f%.7}.pdf" pdf + printf '</td></tr>\n' done - printf '</ul>\n\n' + printf '</table>\n' done @@ -28,6 +25,6 @@ while IFS='' read -r file do root=".$(printf %s "$file" | sed 's|^./||; s|[^/]||g; s|.|/..|g')" mandoc -T html -O style="$root/style.css" "$file" > "${file%.7}.html" - mandoc -T pdf "$file" > "${file%.7}.pdf" + mandoc -T pdf "$file" > "${file%.7}.pdf" mandoc -T locale "$file" | sed 's/.//g' > "${file%.7}.txt" done diff --git a/dwm/config.h b/dwm/config.h @@ -17,7 +17,7 @@ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ /* tagging */ -static const char *tags[] = { "1", "2", "3 ○", "4 ▤", "5 ♫" }; +static const char *tags[] = { "1", "2", "3", "4", "5" }; static const Rule rules[] = { /* xprop(1):