- Install Ruby 2.5.7
rvm install ruby-2.5.7
- Install gems
gem install bundler
- View the docs on a local server with
bundle exec middleman server
You should now be able to see the docs at http://localhost:4567. - Compile the docs to static HTML/CSS/JS in the build folder with
bundle exec middleman build --clean
Detailed instructions are here on the Slate Wiki
- Run
bundle exec middleman build --clean
to compile docs into thebuild
directory. - Copy the newly generated fonts, image, javascripts, and css folders from
build
togondor/public/docs/
- Copy the contents of build/index.htmll to
gondor/app/views/website/human_api_docs.html.erb
- Replace all instances of "{{YOUR_API_KEY}}" with <%= @api_key %>. so people can see their own API key on the docs if they are logged in.
- Edit the TOC foot section to check if the current user is logged in. The updated version looks like this:
<% unless current_user %>
<ul class="toc-footer">
<li><a href='https://www.app.surgehq.ai/poster_sign_up'>Sign up for an account</a></li>
</ul>
<% end %>