-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"exporting static HTML documentation" would be a great feature #664
Comments
You can add this to your branding.css file to hide anything but the preview .total-wrapper > header,
.editor.pane,
.ui-splitbar,
[tooltip-popup],
.jump-to-yaml {
display: none !important;
}
.preview.pane {
position: fixed;
left: 0 !important;
top: 0 !important;
right: 0 !important;
width: 100% !important;
height: 100% !important;
} Swagger Editor preview pane is not designed to be a replacement of Swagger UI so the "hack" above is not officially supported. We will add more editor specific stuff to the right pane. I've started a project based on this feedback for rendering Swagger documents in a nicer way. Check it out here: https://github.com/mohsen1/swagger-docs |
given the amount of time it takes swagger to render the ArangoDB Documentation, it would indeed cool if it could be pre-generated on the server, so the client doesn't have to do as much work. |
I really like the HTML rendering available in the editor (It is better for an overview and as a standalone documentation than swagger-ui), and I would appreciate an "export as HTML" feature (and/or a way to produce this rendering from a command line tool). If the right pane could be rendered in separate browser window/tab, we could easily save it using browser UI functions... |
The modification of this 2 files do the similar trick that suit my needs. Or use it @ http://io.api.zay-dev.com Step 1. Replace the whole content of the index.html under the root directory with the following HTML
Step 2. Replace the whole content of the header.html under views/header with the following HTML
[optional] Step 3. Copy the following folders into the desctination folder of the download: |
It would be awesome to split editor and preview to different windows. I'm working on two monitors, one would be for editing, another for preview. x) |
I think that the editor pane for previsualizing html looks nicer than swagger ui. +1 for being able to export html from swagger-editor |
+1 export as html and/or option to display the preview without the editor and menu components would be nice |
+1 for exporting the html (preview of editor) for customers! |
+1 for exporting the html view of the preview editor pane, the docs produced by the server ui are not as good. |
The discrepancy between preview documentation and the one generated by |
+1 for exporting the html |
1 similar comment
+1 for exporting the html |
+1 |
+1 |
This helped me: https://github.com/nknapp/bootprint-openapi Also, check out this link to his bootprint-openapi playground...just paste your YAML file and view generated HTML doc: https://bootprint.knappi.org/ |
Thanks for your suggestion, I've already used it and is very nice, still I think it would be "natural" to have an export to HTML directly in the editor. Il giorno 12 feb 2016 22:49, alle ore 22:49, Benson Hougland notifications@github.com ha scritto:
|
One of the main reasons I started using Swagger editor was because I saw how beautiful the documentation part of the editor looked like in the online demo. I must say I'm disappointed that you cannot export that (I was hoping for even an "Export as PDF" option). For now, generating a static HTML client will do. |
If you want to save it as PDF, you can print as pdf in chrome (just hide the editor section by clicking on the middle border and drag it to left). BTY this approche might be workaround to use this UI without the editor (and of course, hide the upper menu -all with js) |
+1 for exporting the HTML |
+1 get swagger editor preview window, into static html files for easy hosting. |
+1 for downloading the doc as static HTML |
Sorry but we have no plans to do this. If you're interested, you can make a static Swagger documents renderer using this project's HTML/CSS in Swagger Code-Gen Project, then Swagger Editor will show it in Generate Client section. |
😢 |
You can generate HTML, PDF and EPUB from your Swagger Spec by converting it into Asciidoctor and then run the Asciidoctor plugin. |
You could also just generate Markdown and use a static site generator which support Markdown to create your own custom HTML documentation. |
You can customize the .pane.editor, .ui-splitbar{
display: none;
}
.pane.preview{
left: 0 !important;
width: 100% !important;
} With the following javascript you can start with the editor closed, but still have the ability to open it: SwaggerEditor.run(function($timeout){
$timeout(function(){
document.getElementsByClassName('ui-splitbar-icon-left')[0].click();
});
}); |
I wrote a tool to generate a similar looking page. Some of you might find it useful. |
@saharj Any explanation on why there are no plans of doing this? It'll make all swagger users life easier |
I'd suggest to anyone following this issue to simply use the (very nice and clean) https://github.com/Rebilly/ReDoc instead. |
+1 for exporting the HTML |
+1 |
+1 for exporting the HTML |
+1 |
+1 For exporting to html in 2018 😅 |
+1 for exporting to html |
+1 |
There's a temporary solution. InstallActually, there's only one html file. UsageJust double click You can either open
ConfigThis html uses A Example Yaml by default. You can customize the yaml file by adding a query
Or you can just change |
I have tried using static.html to open an open API 3.0 yaml doc, but got an error, No operations defined in spec! |
@relaxrq888 So sorry that it is only for 2.0. |
+1 for exporting html documentation (for 3.0) |
1 similar comment
+1 for exporting html documentation (for 3.0) |
Hey people. It worked for me and maybe it's gonna work for some of your use cases. Solution is very similar to @Andiedie approach as it turned out, but with less inline styles. |
As an addendum to htmls provided by @Andiedie, and @v1adko in comments above (in case you do not want to or cannot export your YAML spec on an HTTP server, or have a CORS problem b/w the server with static.html, and your YAML): Keep in mind that there is also the option of taking care of everything in a single file:
(While making your documentation offline-available/portable, you may also want to consider setting |
Just wanted to add a vote for this and second @SGrondin's constructive criticism. |
Also adding a vote and support for @SGrondin's constructive criticism. |
+1 For exporting to html in 2019 😅 |
+1 For exporting to HTML |
Can't you use swagger-ui deferred generation to fulfill your objective? |
This seems like such an obvious feature I can't believe a) it's not there already and b) the request gets shut down like that. Surely having a nice documentation at the end is one of the main reasons to use this editor in the first place? I see that there are a couple html options in the "Generate Client" section, but those are not anywhere near the superior look and feel of the view in the editor. |
+1 For exporting to HTML in 2024 :( |
I really like the swagger YAML format and the HTML document generated by the swagger-editor. Actually, I really hope I can get a standalone HTML document, with exactly the same look as the one generated by the editor, but without the YAML editing part.
I understand there are other tools like swagger-codegen and swagger-to-markdown to generate static document. But the HTML document interactively generated by the editor is obviously a much better choice for a lot people:
(1) It's interactive, meaning easier to correct mistakes.
(2) The HTML generated is very user friendly, and based on my research, looks better than the static documents generated by other tools.
(3) Most importantly, it's easy to use and there is no need to deploy anything. For people like me who really just want to generate a tiny RESTful document it doesn't make sense to go through all the complicated tools.
Hence, I would really appreciate if swagger-editor can support exporting the interactively generated HTML document to a standalone HTML page, and I can ship to customer right away.
The text was updated successfully, but these errors were encountered: