twskj / pretty-swag

Pretty UI for Swagger spec
MIT License
122 stars 20 forks source link

Pre-generate html #26

Open edahlseng opened 7 years ago

edahlseng commented 7 years ago

It appears that the html output doesn't actually contain all of the information when it's generated, but rather it has insert points that a script injects into when the page is first loaded – is that correct?

Would it be possible to inject the information into the html output when it's first generated as opposed to when it's first viewed? It seems that this approach would be a bit cleaner. (It also would make it easier to embed these documents, which, admittedly, is my primary use case.)

twskj commented 7 years ago

That's correct. I think it is possible. I'll investigate "server side rendering" and let you know.

twskj commented 7 years ago

I got a POC up and running and will release this feature as an option in a bit. A few bugs come up, probably going to take longer than I thought.

edahlseng commented 7 years ago

Excited to try it out when it's ready!

twskj commented 7 years ago

I found a workaround that works on Linux, and maybe Mac? It' kinda limited (without javascript bell and whistle) but maybe good enough for your case? You'll also need the latest Google Chrome to hydrate the page. Not sure if it fit your use case. Let me know.

edahlseng commented 7 years ago

Seem's okay so far. As I use it more I can add more feedback. Thanks for working on this!