But it has still some bugs to work on. I tried opening Travis CI documentation to see it in action. When reaching [0], I wanted to scroll back up. Using Firefox 79, I wasn't able to go up no matter what. When using Chromium 84, I managed to go up when scrolling fast, but when holding up key, I still stayed in place.
1. The ability to generate/sync documentation from a Postman collection meant we could write our test suite and documentation in one step.
2. Since we were already paying for a team account, adding Postman documentation was practically free.
3. Environment variables. We could write our test suite with one set internally and then publish our API docs with another set.
As someone else pointed out, it's possible to generate Slate documentation from an OpenAPI spec, but to me Slate on its own leaves a lot to be desired.
The goal is to have everything browser-searchable (i.e. ctrl-f), and I think it's a good goal. I wonder if there's a better way than having everything on a single page with very little compartmentalization, though.
I don't know how I feel about the way they're managing the URL fragment. The way they're calling pushState, it adds history entries while scrolling, and that makes the back button behave nonintuitively; I think I'd rather see history entries created only when I click a header, or otherwise take some specific action to demonstrate the intent. That makes the back behavior easier to reason about, and also preserves the easy deep linkability that they are, imo rightly, going for.
It could even be faster because all the HTML markup can be left out for the search index.
We are currently reviewing several API doc creators including commercial once. And none of them seems to have the feature that I can perma link to a certain request (or response) parameter. E.g. /api1#some/nested/parameter. This seems to me very useful as we don't have to copy the description and type of the parameter again.
You see what I mean when you go to the slate example page https://slatedocs.github.io/slate and search e.g. "available" then you click on the result and you will be directed to the "Get All Kittens" instead of the parameter directly which is confusing if you have more than a few parameters and you have to scroll down. I.e. Ctrl+F is better than this Search feature.
The same problem exists for ReDoc. We tried to contribute a change that supports this perma link feature, but it was not even reviewed.
Any recommendations?
See, for instance, Spreedly's documentation - an incredible service btw for future-proofing your payments stack and allowing PCI-compliant routing to practically any payment processor. (Not affiliated, just a happy customer!) The only time I'm not a happy customer, though, is when I'm time-constrained and have to load the docs, because this is their Lighthouse report:
https://lighthouse-dot-webdotdevsite.appspot.com//lh/html?ur...
> Performance score 8/100, first contentful paint 9.5s, TTI 16.1s, 5s for style & layout, 3.5s for rendering, 43k DOM elements
All that said, Slate is really great. I'm certainly not asking for Spreedly or anyone else to switch tech for their docs. The benefits outweigh the costs.
And I get that you can't have gradually-laid-out content and also preserve scroll position on refresh in a responsive environment. Theoretically, you could, but you'd need to exactly measure your text size at dozens of responsive breakpoints and pre-set each section's height, which would require a headless browser as part of the compile pipeline. And the last thing we want, especially this week, is advocating for documentation sites to take longer to compile. So perhaps this is the local optimum. But hopefully there are other more creative solutions!
https://github.com/Redocly/redoc
I've managed to get both the companies I work at use redoc instead of slate :)
In the end I containerized the whole thing with defaults, logos, etc so we’d have standard docs with little effort.
ideally a SSG like Gatsbyjs or Nextjs