tMerge branch 'master' of z3bra.org:monochromatic - monochromatic - monochromatic blog: http://blog.z3bra.org
(HTM) git clone git://z3bra.org/monochromatic
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit 607588b14657ed7c53dfca329389e0d44cca734e
(DIR) parent 6c75041a5a65bacae3ea5828252336f08dd8ed16
(HTM) Author: z3bra <willy@mailoo.org>
Date: Mon, 20 Apr 2015 01:01:38 +0200
Merge branch 'master' of z3bra.org:monochromatic
Conflicts:
css/monochrome.css
Diffstat:
M css/monochrome.css | 24 ++++++++++++++++--------
M publi.sh | 14 +++++++++-----
2 files changed, 25 insertions(+), 13 deletions(-)
---
(DIR) diff --git a/css/monochrome.css b/css/monochrome.css
t@@ -85,15 +85,21 @@ header h1 a:hover {
/* }}} */
/* Coding style (<code>) {{{ */
-code {
+code, pre {
color: inherit;
- padding: 2px;
font-family: monospace;
+ font-size: 90%;
+ padding: 4px;
+ background-color: #eee;
+ border: 1px solid #bbb;
+ border-radius: 4px;
}
-code:before, code:after {
- content: "`";
-}
+/*
+ * code:before, code:after {
+ * content: "`";
+ * }
+ */
pre code:before, pre code:after {
content: none;
t@@ -101,12 +107,14 @@ pre code:before, pre code:after {
pre {
padding: 10px;
- background-color: #ddd;
- border: 1px solid #666;
- border-radius: 4px;
overflow-x: auto;
overflow-y: hidden;
}
+
+pre code {
+ padding: 0;
+ border: none;
+}
/* }}} */
/* Text Formatting {{{ */
(DIR) diff --git a/publi.sh b/publi.sh
t@@ -4,16 +4,20 @@ link=$(ls -l last.txt | sed 's^.*-> /')
test -z "$EDITOR" && EDITOR=vi
-sed '1s/^# /* 0x0000 - /;1p;d' last.txt > tmp.txt
-sed -i "s(#)(${link/.txt/.html})" tmp.txt
+# get last number used (in hexa) and increment it
+last=$(<index.txt cut -d' ' -f2 | sed 's/0x0*//;1q')
+next=$(printf "0x%04x" `echo "1 16i${last}+p"|dc`)
-$EDITOR tmp.txt
+# format our title and put it in a temp file
+sed '1s/^# /* '$next' - /;1p;d' last.txt > tmp.txt
+sed -i "s(#)(${link/.txt/.html})" tmp.txt
+# present out the final index for reviewing
cat index.txt >> tmp.txt
-
sed 10q tmp.txt
-echo -n 'Is everything okay? [N/y] '
+printf 'Is everything okay? [N/y] '
read choice
+# replace the index with the temp file
test "$choice" = "y" && mv tmp.txt index.txt