I think I would disagree. I spent some time time reading through the glue
code trying to figure out exactly what was going on and I found it
helpful. A lot of the shell_minimal.html isn't really necessary, but you
do need a good chunk of that "Module" javascript code, and the {{ SCRIPT }}
tag (like you said).
Anyway, it really isn't all that complicated. I was just wondering if
there was any documentation, which it sounds like there really isn't. At
the moment it looks like you just have to read through the code and figure
out what is going on, which wasn't as difficult as I thought it might be.
Thanks for getting back to me.
On Mon, Feb 11, 2019 at 10:24 AM Floh <[email protected]> wrote:
> 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, "&");
>> //text = text.replace(/</g, "<");
>> //text = text.replace(/>/g, ">");
>> //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.
>
--
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.