Render Swagger API in LaTeX
Asked Answered
D

0

6

I have created a web application using the Loopback.io framework and have been writing documentation for it in LaTeX. I need to display the current API documentation in this LaTeX document. Loopback supports Swagger documentation for its API and I am able to export the API as a Swagger JSON file. However I can't find any way to easily render it inside a LaTeX document. I see plenty of HTML renderers, but no LaTeX renderers.

I'm looking for something visually similar to http://petstore.swagger.io/, but statically displayed in LaTeX rather than a dynamic HTML page. Is there any existing module that can render Swagger API into LaTeX?

Demarcation answered 26/5, 2016 at 4:57 Comment(4)
Maybe try to pandoc the html to tex?Monopolist
Interesting idea, unfortunately it doesn't seem to work too well. I can't get it to render the styling for the site, so everything has default HTML styles (I added each linked stylesheet with the -c option). I'm also embedding this as a part of a different document, so I had to mess with things like the \documentclass to get to compile in LaTeX, which could easily cause problems with some existing stylings. Is there a more direct way of using Pandoc to accomplish this or any other possibilities?Demarcation
@DouglasParker What did you do in the end?Passenger
Sadly, I didn't. Ended up cutting that section and replaced it with an explanation of Swagger and told readers to build the application and then go to /explorer. Not ideal, but I couldn't find any other options. Been debating writing my own LaTeX package to render Swagger since then, but I don't know that much about LaTeX and can't imagine I'll ever encounter this problem again. Sorry I don't have a better answer for you @phk.Demarcation

© 2022 - 2024 — McMap. All rights reserved.