emgithub icon indicating copy to clipboard operation
emgithub copied to clipboard

[Feature Request] Compile to static HTML

Open louis1001 opened this issue 2 years ago • 7 comments

This is probably too broad for a feature request, but I would like to use this without needing JavaScript enabled on my browser.

I'm planning on adding it to a page that uses Nuxt, so I imagine this being a library with a function or a Vue component you can import and place on your view, and when generating the static site it builds the HTML like it would on a browser.

But I can see that might mean making a entirely different repo, and then maybe using that as a dependency of the emgithub page.

louis1001 avatar Feb 06 '23 23:02 louis1001

So it would be an npm library and a CDN that provides the js for sites like yours that do the embedding in the browser.

louis1001 avatar Feb 06 '23 23:02 louis1001

I'm not a front-end developer so I don't write much Vue/React code. For me, the need of code embedding only happens when I am writing static blogs. That's why emgithub is designed to be used by embedding a script tag.

The idea of making emgithub a Vue/React component sounds interesting and helpful. But I may not be able to implement this, since I haven't written Vue/React code for years. Anyway, I'll mark this as help-wanted in case someone could do this.

yusanshi avatar Feb 07 '23 09:02 yusanshi

On my fork I'll try to decouple the html code generation from the browser writing. I'll comment here if it seems it can be included without breaking changes.

louis1001 avatar Feb 07 '23 15:02 louis1001

It'd be really useful, if the script tag wasn't needed, because now emgithub can't be used in places like a GitHub readme, where regular iframe embeds still work. Should I open a separate issue for that, or are they related?

NomarCub avatar Jul 20 '23 11:07 NomarCub

It'd be really useful, if the script tag wasn't needed, because now emgithub can't be used in places like a GitHub readme, where regular iframe embeds still work. Should I open a separate issue for that, or are they related?

I believe they mean the different things: compiling with a static site generator, vs embedding with a iframe.

However, it seems like GitHub doesnot support rendering iframe tag 🤔 https://stackoverflow.com/questions/48402823/embed-openstreetmap-iframe-in-github-markdown

Personally, I think iframe may be too heavy?!

yusanshi avatar Jul 20 '23 11:07 yusanshi

@louis1001 did you have any work started for this? I'm facing the same case where I'm generating a static site and would like to generate my embeds at build time - rather than at load time (e.g. what if GitHub is down?).

As you said decoupling the HTML generation would be perfect!

whitfin avatar Mar 07 '24 17:03 whitfin

@whitfin I think I might have lost my local changes, it was a while ago. I do have a fork for a lib version of this tool, but no progress uploaded. If you'd like to contribute we can work there, or just let me know of a your own repo if you make one.

either way, yeah I'll try to get it working again. Here's my fork: https://github.com/louis1001/libemgithub

louis1001 avatar Mar 08 '24 02:03 louis1001