From 69a2d7960cef29d1cda4283c9744c6d349e5e0b3 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 30 Jul 2024 13:18:37 -0400 Subject: [PATCH] examples: first shot at description text at top of page. Not working yet. --- build-scripts/build-web-examples.pl | 7 +++---- examples/template.html | 11 ++++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/build-scripts/build-web-examples.pl b/build-scripts/build-web-examples.pl index 6f4351b326..516fe853ea 100755 --- a/build-scripts/build-web-examples.pl +++ b/build-scripts/build-web-examples.pl @@ -103,16 +103,15 @@ sub handle_example_dir { my $jsdst = "$dst/$jsfname"; my $wasmdst = "$dst/$wasmfname"; - my $print_description = ''; + my $description = ''; if (open(my $readmetxth, '<', "$examples_dir/$category/$example/README.txt")) { my $spc = ''; while (<$readmetxth>) { chomp; s/\"/\\"/g; - $print_description .= "${spc}Module.print(\"$_\");"; + $description .= "$spc$_"; $spc = ' '; } - $print_description .= "${spc}Module.print(\"\");"; close($readmetxth); } @@ -155,7 +154,7 @@ sub handle_example_dir { s/\@example_name\@/$example/g; s/\@javascript_file\@/$jsfname/g; s/\@htmlified_source_code\@/$htmlified_source_code/g; - s/\@print_description\@/$print_description/g; + s/\@description\@/$description/g; $html .= $_; } close($htmltemplate); diff --git a/examples/template.html b/examples/template.html index c1284e2b74..268d0c4a20 100644 --- a/examples/template.html +++ b/examples/template.html @@ -133,10 +133,20 @@ height: 100%; overflow: scroll; } + + #example-description { + background: black; + color: white; + height: 100%; + align-items: center; + } +
+ @description@ +
@@ -201,7 +211,6 @@ if (text) console.error('[post-exception status] ' + text); }; }; - @print_description@