-
I think people may be missing the core point of this article.
Anton has built a new thing, https://codapi.org/ - which provides a web component that makes it easy to embed interactive code snippets for HTTP APIs, Python code and more directly in pages of documentation.
This article demonstrates this new technology in the context of the https://diataxis.fr/ documentation framework, which recommends going beyond just straight API reference documentation and ensuring you cover tutorials, how-to guides and explanations as well.
I think this is really cool.
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
hitchstory
Type-safe YAML integration tests. Tests that write your docs. Tests that rewrite themselves.
Thats the reason I wrote this:
https://github.com/hitchdev/hitchstory
There's a REST API example.
If your specification can be used as a test and to generate docs and the spec can be rewritten based upon program output then the maintenance cost plunges.
It would integrate with this quite easily - the script to generate the docs and the jinja2 would need tweaking - thats all.
-
What this misses is the curl response format.
Long time ago at Klarna we used this tool: https://github.com/for-GET/katt Here's an example: https://github.com/for-GET/katt/blob/master/doc/example-http...
-
It's all about the tooling. I wrote my own for iommi where the html output of some code gets saved in a defined place, and then the finished documentation page embeds that html in an iframe. It's not only WAY WAY easier to maintain than a bunch of screenshots, but I found a ton of issues with the documentation after I made it so it runs all the examples and I can look at the output.
example: https://docs.iommi.rocks/en/latest/cookbook_forms.html
corresponding documentation/tests: https://github.com/iommirocks/iommi/blob/master/docs/test_do...
my evil hack to get this working: https://github.com/iommirocks/iommi/blob/master/make_doc_rst... and https://github.com/iommirocks/iommi/blob/master/iommi/docs.p...
-
That's brilliant! https://github.com/scientific-python/pytest-doctestplus seems to be similar working in the opposite direction, using the documentation source as the single location for test code. I like your approach better and wish there was more support for that pattern more generally!
-
-
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
-
-
httpyac
Command Line Interface for *.http and *.rest files. Connect with http, gRPC, WebSocket and MQTT