* Run examples with php wasm
* make examples editable
* load wasm only when running code
* handle empty code
Co-authored-by: lwlinux <1053317536@qq.com>
This patch adds some missing newlines, trims some multiple redundant
final newlines into a single one, and trims few redundant leading
newlines.
According to POSIX, a line is a sequence of zero or more non-'<newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.
C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."
Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
The country-level host names get listed as unofficial, probably not the best thing to have in the footer of *every* *single* *page*.
(This issue still affects mirror.php)
This reverts commit 635dbd4bb1, reversing
changes made to 92a271f315.
This uses Twitter's typeahead.js for the actual autocompletion, and uses our
existing search-index.json and search-description.json files. These are pretty
big, and an obvious fix down the track would be to combine them into one,
preferably much smaller file. mod_gzip should help to some extent, as should
the HTML 5 Local Storage caching I've implemented.
I've also pulled in Hogan.js for templating, since typeahead.js really needs
some sort of templating engine to be useful.
Excluding the JSON files, the added JS dependencies are around 50k
uncompressed. I think this is reasonable, but honestly, it's not really a
significant win over the autocomplete bits of jQuery UI. I've used typeahead.js
more for its multiple section functionality than anything else.
The styling on this is pretty average, but I'm mostly interested in testing
functionality right now. Fixes welcome.
$v is never defined in site_footer()'s scope — I've just nicked the declaration
from header.inc for now, but we probably should have a better way of defining
this before "beta" becomes "stable".