computable-pandoc/scripts/make_dist.sh

33 lines
1.1 KiB
Bash

# Variables
NAME="literate.min.lua"
ROOT=$(git rev-parse --show-toplevel)
DIST=$ROOT/dist/$NAME
LICENSE="--[[
Literate Pandoc & Fennel Bundle:
A Pandoc filter for literate and natural programming
Fennel:
(C) 2016-2023 Calvin Rose and contributors
License: MIT License https://git.sr.ht/~technomancy/fennel/tree/main/item/LICENSE
Source: https://sr.ht/~technomancy/fennel or https://github.com/bakpakin/Fennel/issues
Website: https://fennel-lang.org
Literate Pandoc:
(C) 2023 perro hi@perrotuerto.blog
License: GPLv3 https://git.cuates.net/perro/literate-pandoc/src/branch/no-masters/LICENSE.txt
Source: https://git.cuates.net/perro/literate-pandoc
The following code is minified, check Literate Pandoc source for a readable version
]]--"
# Merges Fennel and Literate Pandoc
head -n -1 $ROOT/opt/fennel.lua > $DIST
echo "local fennel = mod" >> $DIST
tail -n +11 $ROOT/src/literate.lua >> $DIST
echo "Bundling complete"
# Minifies code
cd opt/luaminify
lua CommandLineMinify.lua $DIST $DIST.tmp
# Adds license
(echo "$LICENSE" && cat $DIST.tmp) > $DIST
rm $DIST.tmp