mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-15 09:18:27 +00:00
examples: Print a description of the program to the console on startup.
This commit is contained in:
parent
a6407e88da
commit
6a25e94472
11 changed files with 38 additions and 11 deletions
|
@ -103,6 +103,19 @@ sub handle_example_dir {
|
|||
my $jsdst = "$dst/$jsfname";
|
||||
my $wasmdst = "$dst/$wasmfname";
|
||||
|
||||
my $print_description = '';
|
||||
if (open(my $readmetxth, '<', "$examples_dir/$category/$example/README.txt")) {
|
||||
my $spc = '';
|
||||
while (<$readmetxth>) {
|
||||
chomp;
|
||||
s/\"/\\"/g;
|
||||
$print_description .= "${spc}Module.print(\"$_\");";
|
||||
$spc = ' ';
|
||||
}
|
||||
$print_description .= "${spc}Module.print(\"\");";
|
||||
close($readmetxth);
|
||||
}
|
||||
|
||||
do_mkdir($dst);
|
||||
do_copy($jssrc, $jsdst);
|
||||
do_copy($wasmsrc, $wasmdst);
|
||||
|
@ -142,6 +155,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;
|
||||
$html .= $_;
|
||||
}
|
||||
close($htmltemplate);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue