Generate a documentation web site from OpenApi JSON file #179
-
|
Hello |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
It's certainly possible, though there's no out-of-the-box solution. Perhaps the closest thing might be to take a look at the documentation for Spectre.Console: https://github.com/spectreconsole/spectre.console/tree/main/docs. It's not documenting an OpenAPI file or anything like that, but it is generating some bespoke documentation from a custom source. That might be a good starting point. In general the way I'd go about this if it were me is to write a custom module that reads the OpenAPI JSON file and outputs documents for each "symbol" (or maybe API endpoint?). Then you can write layouts, etc. that rely on the documents output from that module. Sorry I don't have a more specific answer or example for you! Statiq was intentionally designed to be extensible and flexible, so while it can absolutely handle scenarios like this, doing so in the absence of an out-of-the-box theme for it requires a little tinkering. Think of it as a "framework" for building your own specialized static site generator. That said, an OpenAPI experience has long been on my radar: statiqdev/Statiq.Web#511 - I likely won't get to it any time soon, but eventually I do hope to have something off the shelf. |
Beta Was this translation helpful? Give feedback.
It's certainly possible, though there's no out-of-the-box solution. Perhaps the closest thing might be to take a look at the documentation for Spectre.Console: https://github.com/spectreconsole/spectre.console/tree/main/docs. It's not documenting an OpenAPI file or anything like that, but it is generating some bespoke documentation from a custom source. That might be a good starting point.
In general the way I'd go about this if it were me is to write a custom module that reads the OpenAPI JSON file and outputs documents for each "symbol" (or maybe API endpoint?). Then you can write layouts, etc. that rely on the documents output from that module.
Sorry I don't have a more specific answer…