I think most of those details aren't important in most cases. As far as I 
understand it, those text replacements just replace special HTML characters 
like &, < and > with escape sequences in case you don't want to print text 
output to the Javascript console, but instead want to "print" it into the 
HTML page DOM somehow.

AFAIK there's two important parts to a shell.html file: the global Module 
object, which is sort-of the global kitchen-sink for all emscripten-runtime 
objects. A few user-provided things must exist there (like a print() 
function which returns a callback function which implements text output).

The other important part is a "{{{ SCRIPT }}}" placeholder. This will 
replaced by emscripten with the code which loads the Javascript runtime and 
WASM blob.

I have created an even more minimal shell.html for my own projects, which 
only contains a WebGL canvas which is stretched over the whole window 
client area, I think this is a bit easier to understand:

https://github.com/floooh/sokol-samples/blob/master/webpage/shell.html

Cheers!
-Floh.

On Thursday, 7 February 2019 02:44:07 UTC+1, Rick Battagline wrote:
>
> I'm trying to gain a better understanding of compiling with the 
> --shell-file flag.  Reading through the code inside of shell_minimal.html 
> I wee the following commented code:
>
> // These replacements are necessary if you render to raw HTML
> //text = text.replace(/&/g, "&amp;");
> //text = text.replace(/</g, "&lt;");
> //text = text.replace(/>/g, "&gt;");
> //text = text.replace('\n', '<br>', 'g');
>
> What exactly is this doing?
>
> Is there any documentation specifically about these shell files?  I'm not 
> able to find anything that goes into any detail.
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to