Why do you need cosmicjs to build a documentation website?
Wouldn't static generated website better for that?
Even cosmicjs own documentation uses slate (github.com/lord/slate), a ruby based static website generator.
cosmicjs.github.io/rest-api-docs
This is a static generated site. Gatsby is a static site generator, Cosmic JS is simply storage for your documentation content Gatsby is used to automatically build static site files based on what is stored in your bucket on Cosmic JS.
That is my point. I love Gatsby.js, it already can generate static website from a variety of sources. Most developers like to write content in markdown (as you mentioned), and probably check into git, and Gatsbyjs already can generated pages directly from your repo. Why cosmicjs?
I can see advantages of headless API driven CMS (like CosmicJS or Contentful , after all I love APIs, lol. :)), where like an Ecommerce website, where there is a lot of content with frequent changes (made by non-technical people), and of course you wouldn't want to regenerate all the static pages when you change a description or something for a item for sale. But I just feel using it for documentation feels overkill and expensive.
Vijay Thirugnanam
Inference Service @ Cerebras
A bit of self-promotion :) Here is a Gatsby tutorial on how to generate a static website from markdown files.