Skip to content

Documentation

Doc Ritezel edited this page Jan 5, 2013 · 3 revisions

Adding Documentation

This article assumes you are using OSX, that you've seen the command line before, that you have a Rails app with Style Guide installed and that you've written at least one partial.

If you're new to the command line, consult the Terminal.app guide.

If you need to make a new Rails application, consult the Rails app guide.

If you need to install Style Guide, consult the install guide.

If you have yet to make a partial, create one now.

Let's say your application lives in ~/workspace/client-app for simplicity. When you see this, just mentally replace it with your application's directory.

Adding to the Translation File

The main place for strings to get translated in a Rails application is its locale file. We're going to add an entry under the "style_guide" scope.

Let's open ~/workspace/client-app in Sublime Text, then open config/locales/en.yml and add an entry for the Branding Colors from the previous guide.

Now the Colors partial has some documentation.

Adding Documentation Markdown

If we want to add more advanced documentation, like usage comments or code samples, we can use Github-flavored Markdown.

Let's update our documentation to talk about the SCSS variables we used. To make a multi-line comment, we need to change the key to > or |.

Now the Colors partial shows some documentation about the color variables.

Clone this wiki locally