diff --git a/_misc/import.pl b/_misc/import.pl new file mode 100755 index 0000000..f30da95 --- /dev/null +++ b/_misc/import.pl @@ -0,0 +1,52 @@ +#!/usr/bin/env perl +use warnings; +use 5.026; +use FindBin (); +use Path::Class qw/dir file/; + +# A quick and dirty script for importing stuff from webperl/master to gh-pages + +sub edit (&$$) { + my ($code,$source,$dest) = @_; + state $basedir = dir($FindBin::Bin)->parent->parent; + local $_ = file($source)->absolute($basedir)->slurp(iomode=>'<:raw:encoding(UTF-8)'); + $code->(); + file($dest)->absolute($basedir)->spew(iomode=>'>:raw:encoding(UTF-8)', $_); +} + +edit { + s{ iframe.perleditor\s*\{ [^\}]* border: \s* \K \N* (?=\n) }{1px dotted lightgrey;}xmsg==1 or die; + s{ }{<$+{x}>}xmsg==1 or die; + s{ ^ \s* \K /[/*] (?= \s* iFrameResize ) }{}xmsg==2 or die; +} 'web/democode/demo.html', 'pages/democode/index.html'; + +edit { + s{ ) }{index.html}xmsg==1 or die; + s{ }{<$+{x}>}xmsg==1 or die; +} 'web/democode/perleditor.html', 'pages/democode/perleditor.html'; + +edit { + s{ ) }{index.html}xmsg==1 or die; + s{ <(?script\s+src="[^"]*webperl\.js"\s*> }{}xmsg==1 or die; + s{ }{<$+{x}>}xmsg==1 or die; +} 'web/democode/perlrunner.html', 'pages/democode/perlrunner.html'; + +edit { +} 'web/democode/perleditor.css', 'pages/democode/perleditor.css'; + +edit { + my $msg = <<'ENDMSG'; +This is essentially a copy of +https://github.com/haukex/webperl/blob/master/web/regex_tester.html +with the following differences: +- webperl.js from CDN +- $RUN_CODE_IN_IFRAME enabled +- URL updated to https://github.com/haukex/webperl/blob/gh-pages/regex.html +(see import_regex_tester.pl) +ENDMSG + s{ <(?script\s+src="(?:webperl\.js|__WEBPERLURL__)"\s*> }{}xmsg==2 or die; + s{ }{<$+{x}>}xmsg==2 or die; + s{ ^ \s* our \s+ \$RUN_CODE_IN_IFRAME\s*=\s*\K[01](?=\s*;\s*) }{1}xmsg==1 or die; + s{ https?://github.com/haukex/webperl/blob/\Kmaster/web/regex_tester.html }{gh-pages/regex.html}xmsg==1 or die; + s{ \#\#\#\#\#\s*-->\n\K }{\n\n}xmsg==1 or die; +} 'web/regex_tester.html', 'pages/regex.html'; diff --git a/_misc/import_regex_tester.pl b/_misc/import_regex_tester.pl deleted file mode 100755 index 3b330a6..0000000 --- a/_misc/import_regex_tester.pl +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env perl -use warnings; -use strict; -use FindBin (); - -# A quick and dirty script for importing regex_tester.html to pages - -my $infn = "$FindBin::Bin/../../web/regex_tester.html"; -my $outfn = "$FindBin::Bin/../regex.html"; - -my $html = do { open my $ifh, '<:encoding(UTF-8)', $infn or die "$infn: $!"; local $/; <$ifh> }; - -my $msg = <<'ENDMSG'; -This is essentially a copy of -https://github.com/haukex/webperl/blob/master/web/regex_tester.html -with the following differences: -- webperl.js from CDN -- $RUN_CODE_IN_IFRAME enabled -- URL updated to https://github.com/haukex/webperl/blob/gh-pages/regex.html -(see import_regex_tester.pl) -ENDMSG - -( $html =~ s{ <(?script\s+src="(?:webperl\.js|__WEBPERLURL__)"\s*> }{}xmsg )==2 or die; -( $html =~ s{ }{<$+{x}>}xmsg )==2 or die; -( $html =~ s{ ^ \s* our \s+ \$RUN_CODE_IN_IFRAME\s*=\s*\K[01](?=\s*;\s*) }{1}xmsg )==1 or die; -( $html =~ s{ https?://github.com/haukex/webperl/blob/\Kmaster/web/regex_tester.html }{gh-pages/regex.html}xmsg )==1 or die; -( $html =~ s{ \#\#\#\#\#\s*-->\n\K }{\n\n}xmsg )==1 or die; - -open my $ofh, '>:encoding(UTF-8)', $outfn or die "$outfn: $!"; -print $ofh $html; -close $ofh; diff --git a/building.md b/building.md index fb429e5..4c6ec77 100644 --- a/building.md +++ b/building.md @@ -30,12 +30,12 @@ Prerequisites - [Emscripten](http://emscripten.org) SDK, 1.38.10 and up, please see the prerequisites and installation instructions at -- The build script has several CPAN dependencies. One way to install them - is using [lazy](https://metacpan.org/pod/lazy): first, - install "lazy", then run e.g. `perl -Mlazy build.pl --help`. - Otherwise, the modules used by `build.pl` can be seen in - [its source](https://github.com/haukex/webperl/blob/master/build/build.pl) - grouped near the top of the file. +- The build script has several CPAN dependencies. You can install these + via [`cpanm`](https://metacpan.org/pod/App::cpanminus) and the provided + `cpanfile`: `cd` to the `build` directory, then run `cpanm --installdeps .` + (Otherwise, see the `cpanfile` or the source of `build.pl` and install these + modules with the installer of your choice. Another possibility is to use + [`lazy`](https://metacpan.org/pod/lazy), e.g. `perl -Mlazy build.pl --help`) - A working Internet connection is needed for installation and the first build. @@ -55,10 +55,10 @@ is checked out by the build script. Some of the central source files of WebPerl are: - [`webperl/build/build.pl`](https://github.com/haukex/webperl/blob/master/build/build.pl) -- [`emperl5/hints/emscripten.sh`](https://github.com/haukex/emperl5/blob/emperl_v5.28.0/hints/emscripten.sh) -- [`emperl5/perlmain_noexit_patch`](https://github.com/haukex/emperl5/blob/emperl_v5.28.0/perlmain_noexit_patch) -- [`emperl5/ext/WebPerl/WebPerl.xs`](https://github.com/haukex/emperl5/blob/emperl_v5.28.0/ext/WebPerl/WebPerl.xs) -- [`emperl5/ext/WebPerl/lib/WebPerl.pm`](https://github.com/haukex/emperl5/blob/emperl_v5.28.0/ext/WebPerl/lib/WebPerl.pm) +- [`emperl5/hints/emscripten.sh`](https://github.com/haukex/emperl5/blob/emperl_v5.28.1/hints/emscripten.sh) +- [`emperl5/perlmain_noexit_patch`](https://github.com/haukex/emperl5/blob/emperl_v5.28.1/perlmain_noexit_patch) +- [`emperl5/ext/WebPerl/WebPerl.xs`](https://github.com/haukex/emperl5/blob/emperl_v5.28.1/ext/WebPerl/WebPerl.xs) +- [`emperl5/ext/WebPerl/lib/WebPerl.pm`](https://github.com/haukex/emperl5/blob/emperl_v5.28.1/ext/WebPerl/lib/WebPerl.pm) - [`webperl/web/webperl.js`](https://github.com/haukex/webperl/blob/master/web/webperl.js) diff --git a/democode/perleditor.html b/democode/perleditor.html index 6bfd47c..f1e3bf5 100644 --- a/democode/perleditor.html +++ b/democode/perleditor.html @@ -58,10 +58,8 @@ function makeCM (textarea,plain,ro) { function runnerState (text) { $('#runnerstate').text( text - /* not available until WebPerl v0.09-beta: + (lastExitStatus ? ' (last exit status was '+lastExitStatus+')' : '') ); - */ ); } function updateButtonState () { diff --git a/democode/perlrunner.html b/democode/perlrunner.html index 00532be..e0362cc 100644 --- a/democode/perlrunner.html +++ b/democode/perlrunner.html @@ -39,8 +39,8 @@ If not, see http://perldoc.perl.org/index-licence.html --> - + ``` -- [**Download `webperl_prebuilt_v0.07-beta.zip`**](https://github.com/haukex/webperl/releases/download/v0.07-beta/webperl_prebuilt_v0.07-beta.zip) +- [**Download `webperl_prebuilt_v0.09-beta.zip`**](https://github.com/haukex/webperl/releases/download/v0.09-beta/webperl_prebuilt_v0.09-beta.zip) - [**Get the sources on GitHub**](https://github.com/haukex/webperl) For web applications written with WebPerl, see: @@ -49,14 +49,16 @@ Quick Start ----------- - Prerequisites: `perl` (a recent version is recommended, e.g. v5.26 and up), - [`plackup` from Plack](https://metacpan.org/pod/distribution/Plack/script/plackup), - and [Cpanel::JSON::XS](https://metacpan.org/pod/Cpanel::JSON::XS). + and [`cpanm`](https://metacpan.org/pod/App::cpanminus) to easily install + dependencies (otherwise, see the file `cpanfile` for the dependencies and + use the module installer of your choce). - In a shell: - $ wget https://github.com/haukex/webperl/releases/download/v0.07-beta/webperl_prebuilt_v0.07-beta.zip - $ unzip webperl_prebuilt_v0.07-beta.zip - $ cd webperl_prebuilt_v0.07-beta + $ wget https://github.com/haukex/webperl/releases/download/v0.09-beta/webperl_prebuilt_v0.09-beta.zip + $ unzip webperl_prebuilt_v0.09-beta.zip + $ cd webperl_prebuilt_v0.09-beta + $ cpanm --installdeps . $ plackup webperl.psgi HTTP::Server::PSGI: Accepting connections at http://0:5000/ diff --git a/notes.md b/notes.md index 844f1da..a441588 100644 --- a/notes.md +++ b/notes.md @@ -154,8 +154,8 @@ Release Checklist - Update version numbers everywhere; use `grep` to find them, for example: - $ grep -Er --exclude-dir=work --exclude-dir=.git --exclude-dir=emperl5 --exclude=emperl.* '0\.0[0-9]' . - $ ( cd emperl5; grep -Er '0\.0[0-9]' `git diff --numstat --diff-filter=A v5.28.0 HEAD | cut -f3` ) + $ grep -Er --exclude-dir=hostperl --exclude-dir=.git --exclude-dir=emperl5 --exclude=emperl.* '0\.[01][0-9]' . + $ ( cd emperl5; grep -Er '0\.[01][0-9]' `git diff --numstat --diff-filter=ACMRT v5.28.1 HEAD | cut -f3` ) At a minimum there is: - `web/webperl.js` - `Perl.WebPerlVersion` diff --git a/perl6.md b/perl6.md index e82258e..4001baf 100644 --- a/perl6.md +++ b/perl6.md @@ -47,8 +47,8 @@ Quick Start $ git clone https://github.com/haukex/webperl.git $ cd webperl - $ wget https://github.com/haukex/webperl/releases/download/v0.07-beta/webperl_prebuilt_v0.07-beta.zip - $ unzip -j webperl_prebuilt_v0.07-beta.zip '*/emperl.*' -d web + $ wget https://github.com/haukex/webperl/releases/download/v0.09-beta/webperl_prebuilt_v0.09-beta.zip + $ unzip -j webperl_prebuilt_v0.09-beta.zip '*/emperl.*' -d web $ cpanm --installdeps . $ cd experiments ; cpanm --installdeps . ; cd .. $ experiments/p6/6init.pl # this patches Perl 6 support in diff --git a/regex.html b/regex.html index 154163d..1b77e32 100644 --- a/regex.html +++ b/regex.html @@ -35,8 +35,7 @@ with the following differences: --> - + - - + +