Skip to content

Instantly share code, notes, and snippets.

@jedfoster
Last active December 17, 2015 11:09
Show Gist options
  • Save jedfoster/5600447 to your computer and use it in GitHub Desktop.
Save jedfoster/5600447 to your computer and use it in GitHub Desktop.
Step-by-step process for adding Toadstool to a project

Javascripts

  1. mv ../toadstool-rails/app/assets/javascripts/toadstool-nav.js app/assets/javascripts/
  2. mv ../toadstool-rails/app/assets/javascripts/toadstool.js.coffee app/assets/javascripts/

Sass style guide

  1. mv ../toadstool-rails/app/assets/stylesheets/ app/assets/

Admin controller

  1. mv ../toadstool-rails/app/controllers/admin/ app/controllers/

Toadstool helpers

  1. mv ../toadstool-rails/app/helpers/styleguide_helper.rb app/helpers/

Toadstool views

  1. mv ../toadstool-rails/app/views/admin/ app/views/
  2. mv ../toadstool-rails/app/views/layouts/styleguide.html.haml app/views/layouts/

Toadstool config

  1. mv ../toadstool-rails/config/initializers/styleguide.rb config/initializers/

Routes - add the following lines to config/routes.rb

  namespace :admin do
    ['color_palettes', 'forms', 'grids', 'typography', 'modules', 'patterns'].each do |action|
      get "/styleguide/#{action}" => "styleguide##{action}"
    end
    get '/styleguide' => 'styleguide#typography'

    get '/styleguide/examples/*example' => 'styleguide/examples#show', as: :styleguide_example
  end

lib

  1. mv ../toadstool-rails/lib/styleguide/ lib/

Spec

  1. mv ../toadstool-rails/spec/controllers/ spec/
  2. mv ../toadstool-rails/spec/lib/ spec/
  3. mv ../toadstool-rails/spec/support/ spec/

Vendor JS

  1. mv ../toadstool-rails/vendor/assets/javascripts/modernizr-2.6.2-custom.js vendor/assets/javascripts/
  2. mv ../toadstool-rails/vendor/assets/javascripts/prettify.js vendor/assets/javascripts/

Manual steps

  1. Had to install gem 'red carpet' -- thought that came with HAML?
  2. Added the following to app/assets/javascripts/application.js
//= require_directory .
//= stub styleguide_only

Need to fix

  1. In rails, all files need to be .css.sass or .css.scss
  2. app/helpers/styleguide_helper.rb update reference to be .css.sass or .css.scss
  3. need to get all the icon automated Sass building into the Stipe gem
  4. updated the ico-font support to be more generic for install on the tournament-app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment