This might be just a question/docs tweak.
(Can't tell if the feature I need exists or not...)
I found these promising bits in Readme.md:
And:
But...
ReDoc's client-side JavaScript rendered docs work well. We're using that for most clients.
But like #124, sometimes server-side static HTML is needed for PDF engines and SEO. If the client is a search engine/print app that doesn't run JavaScript (or not extensively enough) and therefore _cannot search index or print JavaScript-rendered docs_, then I need to return static HTML instead.
Does ReDoc CLI do this?
redoc-cli says "starts the server" but not much else
use redoc-cli's bundle command instead of serve which
bundles spec and ReDoc into zero-dependency HTML file
@RomanGotsiy Sorry, but that doesn't yield a yes/no answer... That's why I had to ask.
"Zero-dependency HTML file" is a sexy sound bite, but ambiguous.
For example, it _could_ mean one HTML file with embedded ReDoc. That would _not_ be what I need. Or it could mean static HTML, no JavaScript. Or no node.js dependencies. I can't tell. I need something less marketing-ish and more tech doc-ish about the feature's intended behaviour.
So... "Yes, bundles will be static HTML+CSS only (no JS)"? Or "No, bundles will still require a JS engine to render the page"?
ok, so "Zero-dependency HTML file" - server-side rendered ReDoc with embedded ReDoc.
So all the initial HTML + CSS are in the HTML and can be rendered by the browser immediately. But it is not interactive. That's why bundle contains ReDoc embedded js which hydrates the view and makes it interactive.
You can use ReDoc from the CDN instead of embedding it into the page by passing --cdn option to bundle command.
It works exactly same as any Server Side rendered React application so look there for more detailed information.
Practically, it means you can deploy resulting HTML to any static hosting or just send it via email and user will be able to just double-click your file to see it.
Hope this answer is more useful!
Perfect. That's what I needed to know. Thanks!
Most helpful comment
ok, so "Zero-dependency HTML file" - server-side rendered ReDoc with embedded ReDoc.
So all the initial HTML + CSS are in the HTML and can be rendered by the browser immediately. But it is not interactive. That's why bundle contains ReDoc embedded js which hydrates the view and makes it interactive.
You can use ReDoc from the CDN instead of embedding it into the page by passing
--cdnoption tobundlecommand.It works exactly same as any Server Side rendered React application so look there for more detailed information.
Practically, it means you can deploy resulting HTML to any static hosting or just send it via email and user will be able to just double-click your file to see it.
Hope this answer is more useful!