Convert a system text file to a list of titles (as clickable URLs) on a web page?

24 views
Skip to first unread message

Philip Rhoades P

unread,
Jun 21, 2021, 7:27:09 AM6/21/21
to emscripten-discuss
People,

Newbie question:

I have a system text file with lines of the format:

Description | URL

that is constantly being updated.  Since it is tedious to repetitvely run a script that will create a new web page every time, I thought I might use WASM do display this file as a web page (ie the web page would always be up to date) - and since I more familiar with C than Rust, I thought that might be the easiest place to start.

I have created the WASM web page calculator but I couldn't find any examples reading from a system text file, processing it and displaying the result - although it seems using:

emcc test.cpp -s WASM=1 -o test.html -v --embed-file test.txt

would be the command to do this . .

Anyone know of examples around that I can look at?

Thanks,

Phil.

Sam Clegg

unread,
Jun 24, 2021, 8:44:03 PM6/24/21
to emscripte...@googlegroups.com
On Mon, Jun 21, 2021 at 4:27 AM 'Philip Rhoades P' via emscripten-discuss <emscripte...@googlegroups.com> wrote:
People,

Newbie question:

I have a system text file with lines of the format:

Description | URL

that is constantly being updated.  Since it is tedious to repetitvely run a script that will create a new web page every time, I thought I might use WASM do display this file as a web page (ie the web page would always be up to date) - and since I more familiar with C than Rust, I thought that might be the easiest place to start.

I have created the WASM web page calculator but I couldn't find any examples reading from a system text file, processing it and displaying the result - although it seems using:

emcc test.cpp -s WASM=1 -o test.html -v --embed-file test.txt

Seems like you are on the right track.. that should work.    If you want to avoid recompiling every time you change the file you probably don't want to embed it but instead run a local web server and download the file using emscripten_fetch or emscripten_wget APIs.

cheers,
sam


 

would be the command to do this . .

Anyone know of examples around that I can look at?

Thanks,

Phil.

--
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 emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/26aa82d2-52d5-4583-a130-f0b16871546cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages