dot

packages and services management
Log | Files | Refs | README

commit 8e227c363412fce5b8a65417b0d9600a45fd44a6
parent f7ca7f15404578bd018cf897e2c4828b63db85d8
Author: Josuah Demangeon⠠⠵ <mail@josuah.net>
Date:   Mon,  6 Mar 2017 01:48:08 +0100

Merge branch 'master' of http://github.com/josuah/config

Diffstat:
M.config/git/config | 2--
D.config/git/ignore | 6------
D.config/git/projects | 9---------
M.profile | 8+++++---
M.xinitrc | 3+--
Mbin/gix | 58+++++++++++++++-------------------------------------------
Mbin/index | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------
7 files changed, 83 insertions(+), 85 deletions(-)

diff --git a/.config/git/config b/.config/git/config @@ -1,6 +1,5 @@ # git configuration file - [user] email = mail@josuah.net name = Josuah Demangeon⠠⠵ @@ -12,7 +11,6 @@ ui = auto [alias] - # Most common operations a = add -A c = commit diff --git a/.config/git/ignore b/.config/git/ignore @@ -1,6 +0,0 @@ -*.swp -*.swo -*~ - -# Compiled files -*.o diff --git a/.config/git/projects b/.config/git/projects @@ -1,9 +0,0 @@ -ssh://repo.or.cz/iomenu.git -http://github.com/josuah/iode -http://github.com/josuah/josuah.github.io -http://github.com/josuah/cgr -http://github.com/josuah/barkdown -http://github.com/josuah/notes -http://github.com/josuah/fungus-vs-pathogen -http://github.com/josuah/miniwi -http://github.com/josuah/drawille diff --git a/.profile b/.profile @@ -5,9 +5,11 @@ [ "$PROFILE" ] && return 0 || PROFILE=1 -[ -e ~/.local/bin/build ] && . ~/.local/bin/build +export CONFIG= -export PATH="$(dirname "$(readlink "$HOME/.profile")")/bin:$PATH" +. "$(dirname "$(readlink ~/.profile)")/bin/build" + +export PATH="$(dirname "$(readlink ~/.profile)")/bin:$PATH" export ENV="$HOME/.profile" export TZ='Europe/Paris' @@ -17,7 +19,7 @@ export EMAIL='mail@josuah.net' export MAIL="$HOME/mail/INBOX" # default commands -export EDITOR='vis' VISUAL="$EDITOR" FCEDIT="$EDITOR" +export EDITOR='vi' VISUAL="$EDITOR" FCEDIT="$EDITOR" export PAGER='less' MANPAGER='less -R' # dvtm diff --git a/.xinitrc b/.xinitrc @@ -7,4 +7,4 @@ do sleep 5 done & -exec dwm- \ No newline at end of file +exec dwm diff --git a/bin/gix b/bin/gix @@ -17,18 +17,10 @@ head() </head> <body> -' "$2" "$1" "$1" -} - - -# 1: path to the root - -header() -{ - printf '<pre> +<pre> <a href="%s/..">&lt;</a> <b>%s</b> - <span style="color: grey;">%s</span> <a href="%s/files.html">Files</a> | <a href="%s/commits.html">Commits</a>' \ - "$1" "${PWD##*/}" "$(cat .git/description)" "$1" "$1" + "$2" "$1" "$1" "$1" "${PWD##*/}" "$(cat .git/description)" "$1" "$1" [ -f .gitmodules ] && printf ' | <a href="file/%s/.gitmodules.html">Submodules</a>' "$1" @@ -101,7 +93,6 @@ commits() do { head '../..' "Files - ${PWD##*/}" - header '..' commit "$hash" foot } > "$1/commit/$hash.html" @@ -120,7 +111,7 @@ commits() file() { - printf '<p>%s</p>\n<table class="file"' + printf '<p>%s</p>\n<table>' printf '<tr>\n<td>\n<pre id="num">\n' if grep -qI . "$1" 1>/dev/null @@ -128,7 +119,7 @@ file() seq "$(wc -l < "$1")" | sed 's|.*|<a id="&" href="#&">&</a>|' - printf '</pre></td>\n<td><pre>\n' + printf '</pre></td>\n<td id="file"><pre>\n' sed 's|&|\&amp;|g; s|<|\&lt;|g' "$1" else @@ -157,8 +148,6 @@ files() { head "../$root" "$file - ${PWD##*/}" - - header "$root" file "$file" foot } > "$1/file/$file.html" @@ -182,26 +171,26 @@ repo() { { head '..' "Commits - ${1##*/}" - header '.' commits "$1" foot } > $1/commits.html { head '..' "Files - ${1##*/}" - header '.' files "$1" foot } > $1/files.html ln -sf files.html "$1/index.html" - printf '<tr>' - printf '<td>%s</td>' \ - "$(git -C "$repo" log -1 --format='%cd' --date='short')" \ - "<a href=\"${repo##*/}\">${repo##*/}</a>" \ - "$(cat "$repo/.git/description")" - printf '</tr>\n' + printf '<li>%s <span style="color: grey;">%s</span>' "${PWD##*/}" "$( + grep "${PWD##*/}" "${1%/git/*}/description" | + sed 's/^[^ ]* //' + )" + printf '<span class="nav">' + printf '<a href="git/%s">%s</a>' "${PWD##*/}/files.html" 'files' + printf ' - <a href="git/%s">%s</a>' "${PWD##*/}/commits.html" 'commits' + printf '</span></li>\n' } @@ -209,18 +198,13 @@ repo() repos() { - printf '<table>\n<thead>\n<tr>' - printf '<th>%s</th>' 'Last commit' 'Name' 'Description' - printf '</tr>\n</thead>\n<tbody>\n' + printf '<ul>\n' find "$1" -maxdepth 1 -mindepth 1 -type d | sort | while IFS='' read -r repo do printf '%s\n' "$repo" 1>&2 - grep "${repo##$1/}" ../description | - sed 's/^[^ ]* //' > "$repo/.git/description" - mkdir -p "${repo##*/}" ( @@ -229,19 +213,8 @@ repos() ) done - printf '</tbody>\n</table>\n' -} - - -main() -{ - { - head '.' 'Repositories' - printf '<a href="..">&lt;</a>\n<hr/>' - repos "${1%/}" - foot - } > index.html + printf '</ul>\n' } -main "$@"- \ No newline at end of file +repos "$@" diff --git a/bin/index b/bin/index @@ -1,34 +1,76 @@ -printf '<h2 id="%s">%s</h2>\n\n' 'blog' 'blog' +#!/bin/sh -find 'blog' -type d -mindepth 1 -maxdepth 1 | while IFS='' read -r dir + +printf '<!DOCTYPE html> +<head> +<title>josuah.net</title> +<meta charset="UTF-8"> +<link rel="stylesheet" type="text/css" href="style.css"> +<link rel="icon" href="favicon.png"> +</head> + +<body> +<img src="logo.png"/>\n\n' + + +# about ------------------------------------------------------------------------ + +mandoc -T html -O fragment 'about.7' | tail -n +8 | head -n -6 +printf '\n' + + +# git -------------------------------------------------------------------------- + +printf '<h1 id="%s">%s</h1>\n\n' 'git' 'git' + +[ -d git ] && rm -rf git +(mkdir -p git && cd git && gix ~/git) + + +# blog ------------------------------------------------------------------------- + +printf '<h1 id="%s">%s</h1>\n\n' 'blog' 'blog' + +find 'blog' -mindepth 1 -maxdepth 1 -type d | sort | +while IFS='' read -r dir do - printf '<h3>%s</h3>' "${dir##*/}" + printf '<h2>%s</h2>' "${dir##*/}" printf '<ul>' - find "$dir" -type f -name "*.8" -mindepth 1 -maxdepth 1 | + find "$dir" -mindepth 1 -maxdepth 1 -type f -name "*.7" | sort | while IFS='' read -r file do - printf '<li>%s\n' "$(sed -n '/^.Nm/ s/^.Nm // p' "$file")" - printf '<nav>' - printf '<a href="%s">html</a> |' "${file%$EXT}" - printf '<a href="%s">8</a>' "$file" - printf '</nav>\n</li>\n' + 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' done printf '</ul>\n\n' done -printf '<h2 id="%s">%s</h2>\n\n' 'news' 'news' +# links ------------------------------------------------------------------------ + +mandoc -T html -O fragment 'links.7' | tail -n +8 | head -n -6 +printf '\n' -printf '<ul>' -find 'news' -type f -name "*.8" -mindepth 1 -maxdepth 1 | while IFS='' read -r file -do - printf '<li>%s\n' "$(sed -n '/^.Nm/ s/^.Nm // p' "$file")" - printf '<nav>' - printf '<a href="%s">html</a> |' "${file%$EXT}" - printf '<a href="%s">%s</a>' "$file" "$EXT" - printf '</nav>\n</li>\n' -done -printf '</ul>\n\n' +#------------------------------------------------------------------------------- +printf '\n</body>\n</html>\n' + + +# pages ------------------------------------------------------------------------ + +find . -mindepth 2 -name '*.7' -type f | sort | +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 locale "$file" | sed 's/.//g' > "${file%.7}.txt" +done