-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generating Markdown docs #4
Comments
Hi Mariano, It's definitely possible, the generation is done in 2 steps:
I could probably split step 2 to have a choice between HTML & markdown. However it could become a pretty long Markdown file, especially with all requests/responses bodies expanded. Let me know if you have ideas what it could look like. Otherwise you might also be interested in the |
Hi Romain, It would be awesome if we could generate something like GitHub's API docs. Of course, I realize the limitations on doing such a thing with just collecting information from supertest and outputting Markdown. But trying to go that direction feels quite alright. I'll fork your repo and come back with what I've found if you're interested. Cheers, Mariano. |
That's actually really close to the current output, so it should be easy! 3 things that come to mind browsing their docs: 1. Look and feel The GitHub docs seem to be a normal website, so if that's the main concern you should be able to make it look like that easily. 2. Markdown support Regardless of look-and-feel though, actual Markdown output would definitely be nice. I just thought for example, you could also push the generated docs to the 3. Content Their content is also very close: URLs, custom headers, response payloads, a few error cases... The only extra thing is that they sometimes explain request parameters or fields in the responses. That's definitely handy, but I really want to keep the fact that Anyway it looks like 80% of Github's documentation could be covered without, for example feeds events or comments. So I'm not sure which of 1, 2 or 3 you care most about, but I'm happy for you to spike something if you're still keen. I'll be happy to help as well so let me know what you have in mind. |
That's great. I will take it step by step and see where this goes. |
Hi Romain, I've pushed a first attempt of a Markdown reporter to my fork. Take a look at what's being generated at https://github.com/mefernandez/supersamples/blob/master/test/markdown-result.md It looks quite nice. It keeps the tests' hierarchy as titles, and wraps The code is not in a final state, since I took some shortcuts. I'm writing directly to console and I've hardwired the markdown reporter by commenting out the HTML one. I'll read supersamples.opts file to choose which reporter to use in the next commit. You can run my fork with this line: So, what do you think? Cheers, Mariano. |
Hey Mariano, Sorry for the (very) slow reply. The Markdown output looks great! I have a branch in progress to support multiple "rendering engines". If you're still interested I can ping you later this week when it's merged, and you should be able to put all your code into:
exports.render = function(model, options) {
// model is an array of all samples and their metadata
// options is whatever the user specified for that renderer in `supersamples.opts`
}; |
Hi Romain, Sorry for this equally slow response. I've been up to so many things... |
No problem, let me know how it goes! |
this is really great. awesome work on this -- thank you. looking forward to the markdown support. currently in my CICD i generate supersamples (and slip in the README.md as an 'intro' doc) and push that to my project's gh-pages. Being able to do similarly with the wiki in markdown format will be fantastic too |
I guess there is no progress on this anymore. Is there any branch where we can test this feature? |
Sorry you're right the work hasn't been fully ported. |
Hi Romain,
I find this API documentation approach quite interesting. How about an option for generating Markdown besides/instead of HTML?
It would be nice to generate a quick README.md to read the generated API doc directly on GitHub. What do you think? Would it be easy to implement?
The text was updated successfully, but these errors were encountered: