diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..42c760a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +root=true +[*] +line_ending diff --git a/src/_tape/.editorconfig b/src/_tape/.editorconfig new file mode 100644 index 0000000..4519085 --- /dev/null +++ b/src/_tape/.editorconfig @@ -0,0 +1,4 @@ +root=false +[*.pl] +indent_type=space +indent_size=1 diff --git a/src/lib.m4 b/src/_tape/lib.m4 similarity index 100% rename from src/lib.m4 rename to src/_tape/lib.m4 diff --git a/src/main.html.m4 b/src/_tape/main.html.m4 similarity index 100% rename from src/main.html.m4 rename to src/_tape/main.html.m4 diff --git a/src/render.sh b/src/_tape/render.sh similarity index 97% rename from src/render.sh rename to src/_tape/render.sh index 3838e95..1bfba21 100755 --- a/src/render.sh +++ b/src/_tape/render.sh @@ -1,5 +1,6 @@ #!/bin/bash # render.sh: part of the tape-and-string framework. +cd .. declare -A title=([not_found]="404 - Page Not Found" [index]="Atlas48's Archives") for i in *.txti; do flatiron < $i | m4 -DTITLE=${title[${i##.html}]} main.html.m4 | sed '/^$/d' > ../${i/txti/html} diff --git a/src/_tape/string.pl b/src/_tape/string.pl new file mode 100644 index 0000000..c7adbbb --- /dev/null +++ b/src/_tape/string.pl @@ -0,0 +1,20 @@ +#!/usr/bin/env perl +use strict; use warnings; +use "dat.pl"; +use Text::Textile; +use Text::Markdown; +use Org::To::HTML +if($ARGV[1][0]=='_') { + print STDERR "Skipping file: $ARGV[1], ignored."; + exit 0; +} +my @fi = split(/\./, $ARGV[1]) +if(!exists($fn{$fi[1]}) { + print STDERR "Skipping file: $ARGV[1], no way to process extension."; + exit 1; +} +open $if, "<$ARGV[1]"; +open $of, ">_tmp"; +$fn{$fi[1]}($if); +close $if; +close $of;