diff --git a/.editorconfig b/.editorconfig index 42c760a..7418fa3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,5 @@ root=true [*] -line_ending +end_of_line=lf +trim_trailing_whitespace=true +insert_final_newline=true \ No newline at end of file diff --git a/.hgignore b/.hgignore index 7029959..eaced04 100644 --- a/.hgignore +++ b/.hgignore @@ -1,2 +1,3 @@ \#* .\#* +src/_tape/titlelookup diff --git a/src/_tape/render.sh b/src/_tape/render.sh index a8d179a..4e7f9a4 100755 --- a/src/_tape/render.sh +++ b/src/_tape/render.sh @@ -7,7 +7,7 @@ for i in ${files[@]}; do if test -d $i; then mkdir -p ../$i elif test -f $i; then - _tape/render.pl $i + tape $i | m4 -DTITLE=`${prog[title]} $i` . else echo "Skipping $i, unknown file type" fi diff --git a/src/_tape/string.pl b/src/_tape/string.pl deleted file mode 100755 index 60ad8db..0000000 --- a/src/_tape/string.pl +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env perl -use strict; use warnings; -use File::Slurp; use File::Basename; -push(@INC,dirname(__FILE__)); -use tape; -my $fi = $ARGV[1]; -if(substr($fi,0,1)=='_') { - print STDERR "Skipping file: $fi, ignored."; - exit 0; -} -my @fc = split(/\./, $fi); -my $fo = $fc[0].'.html'; -if(!exists($fc{$fc[1]}) { - print STDERR "Skipping file: $fi, no way to process extension."; - exit 1; -} -my $out=tape::render{$fc[1]}(read_file($fi); -open $of, ">_tmp"; -if(exists($tape::titles{$fi})) { - print $of `m4 -DTITLE=$tape::titles{$fi} main.html.m4<<. -$out -.`; -} -close $of; diff --git a/src/_tape/tape.pm b/src/_tape/tape.pm deleted file mode 100644 index b48d072..0000000 --- a/src/_tape/tape.pm +++ /dev/null @@ -1,40 +0,0 @@ -package tape; -use strict; use warnings; -use Text::Textile; -use Text::Markdown; -use Org::Parser; use Org::To::HTML; -use CSS::Sass; -use Exporter qw(Export); -use constant { - true => 1, - false => 0 -} -our @EXPORT = qw(render titles); -sub scss { - my $sassc = CSS::Sass->new; - return $sassc->compile($_[0])[0]; -} -my %render = ( - 'txti' => sub { - my $p = Text::Textile->new; - $p->css(false); - return $p->process($_[0]); - }, - 'md' => sub { - my $p = Text::Markdown->new; - return $p->markdown($_[0]); - }, - 'org' => sub { - my $p = Org::Parser->new; - my $o = Org::To::HTML->new; - return $o->export_document($p->parse($_[0])); - }, - 'sass' => sub { - return scss(sass2scss($_[0])); - }, - 'scss' => &scss -); -my %titles = ( - "not_found.txti" => "404 - Page Not Found", - "index.txti" => "Atlas48's Archives" -); diff --git a/src/_tape/titlelookup.rs b/src/_tape/titlelookup.rs new file mode 100644 index 0000000..8e65195 --- /dev/null +++ b/src/_tape/titlelookup.rs @@ -0,0 +1,9 @@ +use std::env::args; +fn main() { + let l:String = args().next().unwrap(); + match l.as_str() { + "not_found.txti" => println!("404 - Page Not Found"), + "index.txti" => println!("Atlas48's Archives"), + _ => println!("Atlas48's Archives"), + } +} \ No newline at end of file