add and document more build options
This commit is contained in:
parent
eb1ab2eddf
commit
facd2dd570
2 changed files with 34 additions and 2 deletions
14
README.md
14
README.md
|
@ -18,6 +18,20 @@ Eureka also parses a [twtxt](https://twtxt.readthedocs.io/en/latest/) file at `S
|
|||
6. Edit your `inc/meta.nav.htm` again to reference your new page.
|
||||
7. Run `./build.sh` again! You will be warned of any orphaned files.
|
||||
|
||||
## build options
|
||||
|
||||
Currently these build options are supported, and they must be supplied __in this order__ if used together:
|
||||
- `-r`: Regenerate all thumbnails
|
||||
- `-d`: Delete the latest twtxt entry; if used together with `-t`, the new entry replaces the old one
|
||||
- `-t`: Add the next arg (quoted string) as a twtxt entry
|
||||
|
||||
Combined argument format like `./build.sh -rdt "twt stuff"` is not supported. Use this format instead:
|
||||
```
|
||||
./build.sh -r -d -t "twt stuff"
|
||||
```
|
||||
|
||||
## debugging
|
||||
|
||||
If you run into issues with your markup crashing `eureka`, edit the `build.sh` file to uncomment the linux debug build line and comment the fast build; this will show you a stack trace of where you are running into buffer overflows, and give you a hint of where your markup is messed up. To see the individual file that has the error, also uncomment the line in `fpinject()` that prints the file names.
|
||||
|
||||
# markup
|
||||
|
|
18
build.sh
18
build.sh
|
@ -41,14 +41,32 @@ cc main.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -o main
|
|||
# echo "$(du -b ./main | cut -f1) bytes written"
|
||||
|
||||
# Run
|
||||
if [ "$1" = "-r" ]; then
|
||||
regen="true"
|
||||
shift
|
||||
fi
|
||||
if [ "$1" = "-d" ]; then
|
||||
shift
|
||||
tmptwtxt=$(mktemp)
|
||||
tail -n +2 ../www/twtxt.txt > ${tmptwtxt}
|
||||
cp ${tmptwtxt} ../www/twtxt.txt
|
||||
rm ${tmptwtxt}
|
||||
echo "Deleted latest twtxt"
|
||||
fi
|
||||
if [ "$1" = "-t" ]; then
|
||||
shift && ./tw.sh $@
|
||||
echo "Twtxt added"
|
||||
fi
|
||||
./main
|
||||
exitstatus=$?
|
||||
if [ "${exitstatus}" = "0" ]; then
|
||||
if [ "${regen}" = "true" ]; then
|
||||
echo "Clearing thumbnails and regenerating in the background"
|
||||
(./thumbnailer.sh clean > /dev/null 2>&1; ./thumbnailer.sh build > /dev/null 2>&1) &
|
||||
else
|
||||
echo "Generating thumbnails in the background"
|
||||
(./thumbnailer.sh build > /dev/null 2>&1) &
|
||||
fi
|
||||
fi
|
||||
|
||||
# Cleanup
|
||||
|
|
Loading…
Reference in a new issue