From f692fca82456c283324e310c9cba14546edd743c Mon Sep 17 00:00:00 2001 From: gauthiier Date: Sun, 5 Dec 2021 18:12:01 +0100 Subject: [PATCH] all set up vibes --- .gitignore | 10 ++- Makefile | 14 +++++ setenv | 33 ++++++++++ templates/index.html | 106 +++++++++++++++++++++++++++++++ templates/pad.html | 17 +++++ templates/pad_colors.html | 17 +++++ templates/pad_index.html | 128 ++++++++++++++++++++++++++++++++++++++ templates/rss.xml | 33 ++++++++++ 8 files changed, 356 insertions(+), 2 deletions(-) create mode 100644 Makefile create mode 100755 setenv create mode 100644 templates/index.html create mode 100644 templates/pad.html create mode 100644 templates/pad_colors.html create mode 100644 templates/pad_index.html create mode 100644 templates/rss.xml diff --git a/.gitignore b/.gitignore index 758ea31..8007c2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,10 @@ -# ---> macOS +# pppadump +venv/ +padinfo.json +.etherdump +out/ + +# ---> macOS *.DS_Store .AppleDouble .LSOverride @@ -25,4 +31,4 @@ Icon Network Trash Folder Temporary Items .apdisk - + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3df73ef --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +all: pull index + +init: + etherdump init + mkdir out + +pull: + etherdump pull --all --force --css styles/html.css --pub out/p --group out/g + +index: + etherdump index input out/p/*.meta.json --title "Notes, __MAGICWORDS__, readers & more ..." --templatepath templates/ --output out/index.html + +clean: + rm -Rf out/ \ No newline at end of file diff --git a/setenv b/setenv new file mode 100755 index 0000000..94754a4 --- /dev/null +++ b/setenv @@ -0,0 +1,33 @@ +#!/bin/bash + +if [ ! -d "venv/" ] +then + echo "venv DOES NOT exists..." + if [[ "$(read -e -p 'Setup venv? [y/N]> '; echo $REPLY)" == [Yy]* ]] + then + echo "Creating python3 venv" + python3 -m venv venv/ + echo "Done." + else + echo "Aborting..." + return + fi +fi + +source venv/bin/activate + +if [ ! "$(pip list | grep -F etherdump)" ] +then + echo "etherdump IS NOT installed" + if [[ "$(read -e -p 'pip install etherdump? [y/N]> '; echo $REPLY)" == [Yy]* ]] + then + echo "Pip installing etherdump" + pip install -e etherdump/ + echo "Done." + else + echo "Aborting..." + return + fi +fi + +echo "--------------------------------> env set" \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..2804830 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,106 @@ + + + + + {{title}} + + + {% block scripts %} + + + {% endblock scripts %} + + +{% block namefilter %} +
+ + +
+ +{% endblock %} + + + + + + + + + + + + +{% for pad in pads %} + + + + + + + +{% endfor %} + +
nameversionslast editedrevisionsauthors
+ {{ pad.padid }} + + {% for v in pad.versions %}{{v.type}} {% endfor %} + {{ pad.lastedited_iso|datetimeformat }}{{ pad.revisions }}{{ pad.author_ids|length }}
+ +{% block info %}

Last update {{timestamp}}.

{% endblock %} + + + diff --git a/templates/pad.html b/templates/pad.html new file mode 100644 index 0000000..41385f0 --- /dev/null +++ b/templates/pad.html @@ -0,0 +1,17 @@ + + + + + {{title}} + + + + + + + +{{body}} + + diff --git a/templates/pad_colors.html b/templates/pad_colors.html new file mode 100644 index 0000000..39cdf25 --- /dev/null +++ b/templates/pad_colors.html @@ -0,0 +1,17 @@ + + + +{{padid}} + + + +{{ style }} + + +{{ html }} + + + + \ No newline at end of file diff --git a/templates/pad_index.html b/templates/pad_index.html new file mode 100644 index 0000000..1d52f8d --- /dev/null +++ b/templates/pad_index.html @@ -0,0 +1,128 @@ + + + + + + + +
+ +
+
+ versions +
+ + + + + + + + +
padid{{padid}}
lastedited{{lastedited_iso}}
revisions{{revisions}}
versions + +
+
+ + + + diff --git a/templates/rss.xml b/templates/rss.xml new file mode 100644 index 0000000..8c7e829 --- /dev/null +++ b/templates/rss.xml @@ -0,0 +1,33 @@ + + + + {{title}} + + {{siteurl}} + {{description}} + {{utcnow}} + {{language}} + {{updatePeriod}} + {{updateFrequency}} + {{generator}} + +{% for p in pads %} + + {{p.pad}} + {{p.link}} + {{p.lastedited_822}} + {{p.link}} + + {% if content %}{% endif %} + +{% endfor %} + + +