emmett-framework / rest

REST extension for Emmett framework
BSD 3-Clause "New" or "Revised" License
14 stars 2 forks source link

[openapi] Export api doc to pdf #13

Open josejachuf opened 2 years ago

josejachuf commented 2 years ago

I share a simple way to export the documentation to PDF using rapipdf [1]. You must export the documentation to YAML and then use it with


<!DOCTYPE html>
<html>
  <head>
    <script src="https://unpkg.com/rapipdf/dist/rapipdf-min.js"></script>
  </head>
  <body>    
    <rapi-pdf style="width:700px; height:40px; font-size:18px;" spec-url="openapi.yaml" >
    </rapi-pdf>
  </body>
</html>

Or use it online from: http://127.0.0.1:8000/main/openapi.yaml

Best regards Jose

[1] https://github.com/mrin9/RapiPdf