From 0aab70d51e60388e27639f843599ba401a0281e5 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 7 Nov 2023 20:52:46 +0100 Subject: [PATCH] sample: serve text file as proper sample.txt page Link to a stable endpoint, with appropriate charset header. --- .htaccess | 1 + sample.plp | 10 +++++++--- sample.txt | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) create mode 120000 sample.txt diff --git a/.htaccess b/.htaccess index 61d5f36..22602d7 100644 --- a/.htaccess +++ b/.htaccess @@ -1,6 +1,7 @@ Options -MultiViews -Indexes DirectoryIndex index.plp DirectorySlash Off +AddCharset utf-8 .txt RewriteEngine on RewriteBase / diff --git a/sample.plp b/sample.plp index 79df033..12460ec 100644 --- a/sample.plp +++ b/sample.plp @@ -1,6 +1,6 @@ <(common.inc.plp)><: -my $textinc = 'data/unicode-sampler/unicode.txt'; +my $textinc = 'sample.txt'; my $proto = sprintf('http%s://', !!$ENV{HTTPS} && 's'); my $preview = "$proto$ENV{HTTP_HOST}/sample.png"; @@ -19,8 +19,12 @@ local $/ = "\n\n"; my $top = readline $source; my ($title, $hr, $intro) = split /\n(\pP)\1+\n/, $top, 2; say "

$title

"; -printf '

HTML display of plain text', $textinc; -say ' intended for monospaced (terminal) output.

'; +say <<"."; +

HTML display of plain text +intended for monospaced (terminal) output. +Compare an expected rendering of the overview. +

+. say '
';
 print $intro;
diff --git a/sample.txt b/sample.txt
new file mode 120000
index 0000000..9ce7fc7
--- /dev/null
+++ b/sample.txt
@@ -0,0 +1 @@
+data/unicode-sampler/unicode.txt
\ No newline at end of file
-- 
2.30.0