diff options
author | Thomas Letan <lthms@soap.coffee> | 2020-02-23 16:00:42 +0100 |
---|---|---|
committer | Thomas Letan <lthms@soap.coffee> | 2020-02-23 16:00:42 +0100 |
commit | 4bb8750480c92ae90dd3498cb5bc8cf3c7cacd02 (patch) | |
tree | bed08cfe71bef3fe6aa9fa057879496f5a23ab01 /scripts | |
parent | Reworking cleopatra presentation (diff) |
Integrate the scripts and plugins used by soupault in Soupault.org
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/generate_history.sh | 54 | ||||
-rw-r--r-- | scripts/katex.js | 10 |
2 files changed, 0 insertions, 64 deletions
diff --git a/scripts/generate_history.sh b/scripts/generate_history.sh deleted file mode 100755 index cc70d55..0000000 --- a/scripts/generate_history.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/bash - -FORMAT="{\"subject\":\"%s\",\"abbr_hash\":\"%h\",\"hash\":\"%H\",\"date\":\"%cs\"" - -function generate_history_json () { - local file="${1}" - - local logs=$(git --no-pager log --follow --pretty=format:"${FORMAT}" "${file}") - - if [ ! $? -eq 0 ]; then - exit 1 - fi - - local count=0 - local name="${file}" - - while read -r line; do - local hash=$(echo "${line}}" | jq -j '.hash') - - local pre_name="$(git --no-pager show --stat=10000 ${hash} | sed -e 's/ *\(.*\){\(.*\) => \(.*\)}/\1\2 => \1\3/' | grep "=> ${name}" | xargs | cut -d' ' -f1)" - - if [[ ${count} -eq 0 ]]; then - echo -n "[ " - else - echo -n ", " - fi - - echo "${line}, \"filename\":\"${name}\"}" - - if [[ ! -z "${pre_name}" ]]; then - name="$(echo ${pre_name})" - fi - - count=$(( ${count} + 1 )) - done < <(echo "${logs}") - - echo -n "]" -} - -function generate_json () { - local file="${1}" - - echo "{" - echo " \"file\" : \"${file}\"," - echo " \"history\" : $(generate_history_json "${file}")" - echo "}" -} - -FILE=`cat` - -tmp_file=$(mktemp) -generate_json ${FILE} > ${tmp_file} -haskell-mustache ${1} ${tmp_file} -rm ${tmp_file} diff --git a/scripts/katex.js b/scripts/katex.js deleted file mode 100644 index b3f6925..0000000 --- a/scripts/katex.js +++ /dev/null @@ -1,10 +0,0 @@ -/* Render inline maths using KaTeX */ -var katex = require("katex"); -var fs = require("fs"); -var input = fs.readFileSync(0); - -var html = katex.renderToString(String.raw`${input}`, { - throwOnError: false -}); - -console.log(html) |