Compare commits

...

2 commits

Author SHA1 Message Date
Yann Esposito (Yogsototh) 18406ffbb6
Added computer modern fonts, but I do not use them. 2020-05-24 13:37:21 +02:00
Yann Esposito (Yogsototh) eefd8e1210
use lorri for envrc, faster better 2020-05-21 18:33:34 +02:00
108 changed files with 1167 additions and 450 deletions

154
.envrc
View file

@ -1,153 +1 @@
# Usage: use_nix [...]
#
# Load environment variables from `nix-shell`.
# If you have a `default.nix` or `shell.nix` one of these will be used and
# the derived environment will be stored at ./.direnv/env-<hash>
# and symlink to it will be created at ./.direnv/default.
# Dependencies are added to the GC roots, such that the environment remains persistent.
#
# The resulting environment is cached for better performance.
#
# To trigger switch to a different environment:
# `rm -f .direnv/default`
#
# To derive a new environment:
# `rm -rf .direnv/env-$(md5sum {shell,default}.nix 2> /dev/null | cut -c -32)`
#
# To remove cache:
# `rm -f .direnv/dump-*`
#
# To remove all environments:
# `rm -rf .direnv/env-*`
#
# To remove only old environments:
# `find .direnv -name 'env-*' -and -not -name `readlink .direnv/default` -exec rm -rf {} +`
#
set -eo pipefail
use_nix() {
# define all local variables
local shell f env_hash dir default wd drv dump path_backup
local files_to_watch=()
declare opt
declare OPTARG
declare OPTIND
while getopts ":s:w:" opt; do
case "${opt}" in
s)
shell="${OPTARG}"
files_to_watch=("${files_to_watch[@]}" "${shell}")
;;
w)
files_to_watch=("${files_to_watch[@]}" "${OPTARG}")
;;
:)
>&2 echo "Invalid option: $OPTARG requires an argument"
;;
\?)
>&2 echo "Invalid option: $OPTARG"
exit 1
;;
esac
done
shift $((OPTIND -1))
if [[ -z "${shell}" ]]; then
>&2 echo "ERR: no shell was given"
exit 1
fi
for f in "${files_to_watch[@]}"; do
if ! [[ -f "${f}" ]]; then
>&2 echo "cannot watch file ${f} because it does not exist"
exit 1
fi
done
# compute the hash of all the files that makes up the development environment
env_hash="$(hashContents "${files_to_watch[@]}")"
dir="$(direnv_layout_dir)"
default="${dir}/default"
if [[ ! -L "${default}" ]] || [[ ! -d $(readlink "${default}") ]]; then
wd="${dir}/env-${env_hash}"
mkdir -p "${wd}"
drv="${wd}/env.drv"
if [[ ! -f "${drv}" ]]; then
log_status "use nix: deriving new environment"
IN_NIX_SHELL=1 nix-instantiate --add-root "${drv}" --indirect "${shell}" > /dev/null
nix-store -r $(nix-store --query --references "${drv}") --add-root "${wd}/dep" --indirect > /dev/null
fi
rm -f "${default}"
ln -s $(basename "${wd}") "${default}"
fi
drv=$(readlink "${default}/env.drv")
dump="${dir}/dump-$(hashFile ".envrc")-$(hashFile ${drv})"
if [[ ! -f "${dump}" ]] || [[ "${XDG_CONFIG_DIR}/direnv/direnvrc" -nt "${dump}" ]]; then
log_status "use nix: updating cache"
old=$(find "${dir}" -name 'dump-*')
nix-shell --pure "${drv}" --show-trace --run "$(join_args "$direnv" dump bash)" > "${dump}"
rm -f ${old}
fi
# evaluate the dump created by nix-shell earlier, but have to merge the PATH
# with the current PATH
# NOTE: we eval the dump here as opposed to direnv_load it because we don't
# want to persist environment variables coming from the shell at the time of
# the dump. See https://github.com/direnv/direnv/issues/405 for context.
path_backup="${PATH}"
eval $(cat "${dump}")
export PATH="${PATH}:${path_backup}"
for f in "${files_to_watch[@]}"; do
watch_file "${f}"
done
}
hashContents() {
if has md5sum; then
cat "${@}" | md5sum | cut -c -32
elif has md5; then
cat "${@}" | md5 -q
fi
}
hashFile() {
if has md5sum; then
md5sum "${@}" | cut -c -32
elif has md5; then
md5 -q "${@}"
fi
}
fail() {
log_error "${@}"
exit 1
}
validateVersion() {
local version="$("${direnv}" version)"
local major="$(echo "${version}" | cut -d. -f1)"
local minor="$(echo "${version}" | cut -d. -f2)"
local patch="$(echo "${version}" | cut -d. -f3)"
if [[ "${major}" -gt 2 ]]; then return 0; fi
if [[ "${major}" -eq 2 ]] && [[ "${minor}" -gt 18 ]]; then return 0; fi
if [[ "${major}" -eq 2 ]] && [[ "${minor}" -eq 18 ]] && [[ "${patch}" -ge 2 ]]; then return 0; fi
return 1
}
if ! validateVersion; then
echo "This .envrc requires direnv version 2.18.2 or above."
exit 1
fi
use_nix -s shell.nix
eval "$(lorri direnv)"

View file

@ -12,7 +12,7 @@ retrieve_classes_in_html () {
retrieve_classes_in_css () {
cat $webdir/**/*.css(N) | \
perl -pe 's/\.([a-zA-Z-_][a-zA-Z0-9-_]*)/\nCLASS: $1\n/g'
perl -pe 's/ \.([a-zA-Z-_][a-zA-Z0-9-_]*)/\nCLASS:$1\n/g'
}
classes=( $( {retrieve_classes_in_html; retrieve_classes_in_css}| \

View file

@ -10,7 +10,7 @@
(defvar draft-publish-assets-dir (concat draft-publish-dir "/"))
(defvar posts-dir (concat base-dir "/posts"))
(defvar rss-title "Subscribe to articles")
(defvar css-path "/css/mk.css")
(defvar css-path "/css/y.css")
(defvar author-name "Yann Esposito")
(defvar author-email "yann@esposito.host")
@ -92,13 +92,14 @@
(format "<h2>%s</h2>" subtitle))
(when-let ((date (plist-get info :date)))
(concat
"<div class=\"metas\">"
"Published "
"<div class=\"author\">"
"Yann Esposito"
"<br/>"
(format "<span class=\"article-date\">%s</span>"
(format-time-string "%Y-%m-%d"
(org-timestamp-to-time
(car date))))
" on "
"<br/>on "
(format " <a href=\"%s\">Yann Esposito's blog</a>" websiteorigin)
(let ((permalink (gen-permalink (plist-get info :output-file))))
(concat
@ -109,7 +110,7 @@
(format " <a class=\"permalink\" href=\"%s\">§permalink</a>" permalink)))
"</div>"))
(when-let ((description (plist-get info :description)))
(format "<div class=\"notes\">%s</div>" description))
(format "<div class=\"abstract\">%s</div>" description))
"</div>"))
(defun rand-obfs (c)

Binary file not shown.

139
src/css/colors.css Normal file
View file

@ -0,0 +1,139 @@
/* COLORS */
/* colortheme switch */
body>input { display: none; }
#labels > .content { margin: 0 auto; text-align: center; }
label { font-weight: 700; }
label:hover { cursor: pointer; }
#logo { text-align: center; }
body { margin:0; padding: 0; border: 0; max-width: none;}
#content,.content,#preamble,#postamble {
max-width: 80ch;
overflow: hidden;
margin: 0 auto;
}
figure img { width: 100%; }
.footdef > sup { vertical-align: top; font-size: medium; }
.footdef > sup > a { padding: 0.5em; }
.footpara { display: inline; }
footer { margin: 3em 0; padding: 1em 0; border-top: solid 1px; border-bottom: solid 1px; line-height: 1em; }
#postamble td { border-bottom: none; }
nav { text-align: center; padding: 2em 0; }
:root {
--b03: #2E3440;
--b02: #3B4252;
/* not used because light mode is has more contrast
--b01: #656b74;
*/
--b00: #727781;
--b0: #989ea8;
--b1: #b0bac7;
--b2: #ECEFF4;
--b3: #fff;
--y: #c18600;
--o: #d84100;
--r: #e62729;
--m: #ec0085;
--v: #6c71c4;
--b: #0095ff;
--c: #00b0a3;
--g: #879a00;
/* default light */
--bg: var(--b3);
--rbg: var(--b2);
--fg0: var(--b0);
--fg: var(--b02);
--rfg: #000;
--hl: var(--o);
}
/* light checked */
input#l:checked ~ div {
--bg: var(--b3);
--rbg: var(--b2);
--fg0: var(--b0);
--fg: var(--b02);
--rfg: #000;
--hl: var(--o);
}
input#l:checked ~ div img {
filter: none;
}
/* dark checked */
input#d:checked ~ div {
--bg: hsl(210,20%,2%);
--rbg: var(--b03);
--fg: var(--b1);
--fg0: var(--b00);
--rfg: var(--b2);
--hl: var(--y);
}
input#d:checked ~ div img {
filter: brightness(0.5) saturate(0.5);
}
/* dark preferred */
@media (prefers-color-scheme: dark)
{
:root {
--bg: black;
--rbg: var(--b03);
--fg: var(--b1);
--fg0: var(--b00);
--rfg: var(--b2);
--hl: var(--y);
}
img { filter: brightness(0.5) saturate(0.5); }
}
body, body > div {
background: var(--bg);
color: var(--fg);
}
a,a:visited { color: var(--hl); }
/* ---- SYNTAX HIGHLIGHTING ---- */
.org-rainbow-delimiters-depth-1, .org-rainbow-delimiters-depth-9,
.org-css-selector, .org-nix-attribute, .org-builtin,
.IN_REVIEW {
color:var(--c);
}
.org-rainbow-delimiters-depth-2, .org-nix-builtin, .org-variable-name,
.org-haskell-definition, .org-haskell-operator, .org-function-name, .org-diff-changed {
color:var(--b);
}
.org-rainbow-delimiters-depth-3, .HOLD, .WAITING {
color:var(--v);
}
.org-rainbow-delimiters-depth-4, .org-diff-hunk-header, .org-sh-quoted-exec,
.CANCELED {
color:var(--m);
}
.org-rainbow-delimiters-depth-5, .org-diff-removed, .TODO {
color:var(--r);
}
.org-rainbow-delimiters-depth-6, .org-haskell-constructor {
color:var(--o);
}
.org-rainbow-delimiters-depth-7, .org-type, .org-constant, .org-diff-header,
.org-haskell-keyword, .org-haskell-type, .IN_PROGRESS {
color:var(--y);
}
.org-rainbow-delimiters-depth-8, .org-sh-heredoc, .org-diff-added, .org-string,
.org-doc, .org-keyword, .DONE {
color:var(--g);
}
.org-highlight-numbers-number, .org-highlight-number-number,
.org-diff-none, .org-preprocessor, .org-comment-delimiter, .org-comment,
.org-outshine-level-1, .org-outshine-level-2, .org-outshine-level-3,
.org-outshine-level-4, .org-outshine-level-5, .org-outshine-level-6,
.org-outshine-level-7, .org-outshine-level-8, .org-outshine-level-9 {
color:var(--fg0);
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
src/css/fonts/LM-bold.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/LM-bold.woff Normal file

Binary file not shown.

BIN
src/css/fonts/LM-bold.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/LM-italic.ttf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,55 @@
Copyright (C) Authors of original metafont fonts:
Donald Ervin Knuth (cm, concrete fonts)
1995, 1996, 1997 J"org Knappen, 1990, 1992 Norbert Schwarz (ec fonts)
1992-2006 A.Khodulev, O.Lapko, A.Berdnikov, V.Volovich (lh fonts)
1997-2005 Claudio Beccari (cb greek fonts)
2002 FUKUI Rei (tipa fonts)
2003-2005 Han The Thanh (Vietnamese fonts)
1996-2005 Walter Schmidt (cmbright fonts)
Copyright (C) 2003-2009, Andrey V. Panov (panov@canopus.iacp.dvo.ru),
with Reserved Font Family Name "Computer Modern Unicode fonts".
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the copyright statement(s).
"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.

BIN
src/css/fonts/cmunbi.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbi.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbi.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbl.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbl.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbl.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbmo.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbmo.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbmo.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbmr.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbmr.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbmr.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbso.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbso.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbso.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbsr.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbsr.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbsr.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbtl.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbtl.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbtl.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbto.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbto.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbto.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbx.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbx.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunbx.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunci.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunci.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunci.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunit.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunit.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunit.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunobi.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunobi.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunobi.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunobx.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunobx.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunobx.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunorm.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunorm.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunorm.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunoti.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunoti.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunoti.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunrm.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunrm.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunrm.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunsi.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunsi.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunsi.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunsl.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunsl.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunsl.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunso.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunso.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunso.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunss.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunss.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunss.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunssdc.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunssdc.woff Normal file

Binary file not shown.

Binary file not shown.

BIN
src/css/fonts/cmunsx.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunsx.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunsx.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmuntb.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmuntb.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmuntb.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunti.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunti.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunti.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmuntt.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmuntt.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmuntt.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmuntx.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmuntx.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmuntx.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunui.ttf Normal file

Binary file not shown.

BIN
src/css/fonts/cmunui.woff Normal file

Binary file not shown.

BIN
src/css/fonts/cmunui.woff2 Normal file

Binary file not shown.

BIN
src/css/fonts/cmunvi.ttf Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more