thunder-client-support
thunder-client-support copied to clipboard
Generate markdown documentation from requests
Please describe feature/problem details and solution you'd like.
Would be great if thunder client could generate markdown documentation based on collections/requests. E.g. either add it to a README.md or to some /doc
folder. It would help a lot and simplify a process of creating API documentation without a need of external tools.
Scenario would be useful if a person who is working on API doesn't want to clone repository just to check requests. In this case he can just open a git repo and check requests from there.
Describe alternatives you've considered Tried using Postman and Insomnia but they don't provide such functionality. There are plugins that do something similar:
- For insomnia - https://github.com/insodoc/insomnia-documenter. But it generates documentation in html with js code and requires hosting.
- https://www.npmjs.com/package/postman-to-markdown - generates to markdown.
But both these tools require some external cloud syncing for collection itself so doesn't fit in a workflow. Thunderclient is great because it stores collections in a git repo itself.
Your Team Size Using TC: 2-5
Thanks @Salmondx for the feedback, Will add to roadmap.
@Salmondx can you please share sample markdown file to show how you want the documentation format to be displayed for a collection.
@rangav great to hear that it was added to a roadmap :)
I don't have any specific preferences, but for example the library I shared above (postman-to-markdown) generates docs in such format: https://github.com/bautistaj/postman-to-markdown/blob/master/resources/example.md
This is a good suggestion, thought it will be useful to others also, so added to roadmap.
Thanks for sharing the link.
related #774
@Salmondx, although something built-in would be nice, I have developed a rather simple system for this. See this gist:
- https://gist.github.com/vasansr/026ef767b63ee3b62e664fd2a5d10ad6
It has the following:
- A python script that collects some stuff (like URL, parameters, headers) and appends the Docs section from the TC request. Creates an index with links to each request at the top. One output file is created per collection.
- A makefile: this checks if the last generated time is lesser than the edit time of thunderclient.json, if so, regenerates the api-docs.
- A pre-commit file which calls the above makefile and stages the generated files to the commit, if the files have been regenerated.
So, with the above, I just edit the Thunder Client requests, add some documentation and commit. The markdown documentation is auto-generated and committed along with the thunder tests. I can share the link to the generated .md in my repository, which can be opened up in a browser.
Notes:
- The index links are in bitbucket format. For github format, you may need to tweak the python script.
- The script ignores collections with "test" in them -- for me these are testing collections, not documentation collections.
+1 I can also really use this