From 57e9d96ad73493041905921f218a264ee9d8155b Mon Sep 17 00:00:00 2001 From: Atlas Cove <5618106+Atlas48@users.noreply.github.com> Date: Sat, 21 Jan 2023 23:40:35 +0000 Subject: [PATCH] Work on tape and string framework --- src/_tape/dat.pm | 16 ++++++++++++++++ src/_tape/render.sh | 13 ++++++++++--- src/_tape/string.pl | 2 +- 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 src/_tape/dat.pm mode change 100644 => 100755 src/_tape/string.pl diff --git a/src/_tape/dat.pm b/src/_tape/dat.pm new file mode 100644 index 0000000..5f706e5 --- /dev/null +++ b/src/_tape/dat.pm @@ -0,0 +1,16 @@ +package tape; +use strict; use warnings; +use Exporter qw(Export); +our @EXPORT = qw(fn titles); +my %fn = ( + 'txti' => sub { + }, + 'md' => sub { + }, + 'org' => sub { + } +); +my %titles = ( + "not_found.txti" => "404 - Page Not Found", + "index.txti" => "Atlas48's Archives" +); diff --git a/src/_tape/render.sh b/src/_tape/render.sh index 1bfba21..a8d179a 100755 --- a/src/_tape/render.sh +++ b/src/_tape/render.sh @@ -1,7 +1,14 @@ #!/bin/bash # render.sh: part of the tape-and-string framework. +# v2.0 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} +files=(`find -not -path '_*'`) +for i in ${files[@]}; do + if test -d $i; then + mkdir -p ../$i + elif test -f $i; then + _tape/render.pl $i + else + echo "Skipping $i, unknown file type" + fi done diff --git a/src/_tape/string.pl b/src/_tape/string.pl old mode 100644 new mode 100755 index c7adbbb..67d1d12 --- a/src/_tape/string.pl +++ b/src/_tape/string.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl use strict; use warnings; -use "dat.pl"; +use "dat.pm"; use Text::Textile; use Text::Markdown; use Org::To::HTML