Slate is an awesome tool which creates beautiful API documentation from markdown.
However, as someone who doesn't code in Ruby everyday .. I often find the setup a little of a barrier to entry. For some reason .. Ruby doesn't just work for me :^).
Docker to the rescue
This is a perfect fit for our good friend Docker. Tatum (Docker-acquired - soon to be Docker Cloud I do believe) provide a base image we can use: tatum/slate
The instructions on there are for regular Docker. I <3 Docker Compose .. so I'll use that in this example:
Download the slate code:
source directory to where you want to store you documentation.
From the location where you copied the contents of the
source directory. Add the following:
docs: build: . ports: - "4567:4567" volumes: - ".:/app/source"
- We expose the app on port
- We mount the current directory in
/app/sourcein the container. This means that we don't have to rebuild the whole image every time we want to apply changes. We can just restart the service.
Run the service
To see it in action:
You docs are now available at:
When you make changes to your docs, you will need to restart the service in order for those changes to apply:
And that's all there is to it :).
For those in a hurry
Because: ain't nobody got time for that. There's a prepared repo available here. You can just download that:
and get going right away by simply running: