styledown2-rails 2.0.0.pre5 → 2.0.0.pre6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df323d809dbb7a979351c5ea908c05dac8b75009
4
- data.tar.gz: 1eabf0f30e4ce5c5d524434a30073978abe58e7d
3
+ metadata.gz: f3910a659cbe6a26ddc9b6162e97d8c569cd4f23
4
+ data.tar.gz: ce725230aa8215a8e091e1609baac3bea5942b8e
5
5
  SHA512:
6
- metadata.gz: d952a6143a4ef4ed5fe0825b3fd9b73e73499580536d538134de57a0508e720de86e41895e2ad039a4d967b5046c7ca3b1c547211e151ce0a2f8f00168af0b09
7
- data.tar.gz: f8290b9856ffcc9a5629f368677bcf8e5b5fbbe43f054feed5691e5bdb631254352be648be4653403c78d1f6e88f5ebd0fafb0d068d5135ac243855ca43e2e7c
6
+ metadata.gz: 4c81702c080b69ea7fee4985feab39fd4bbaa9f419a9bd565705278e5135e5886cff78cae84414b4500c6602cc338e2ffbfddf6f88b7025ddad3265d335c2c76
7
+ data.tar.gz: 9bcb1e8a0d4c1b160885acbcdb7b3e902b1172deca6b412dc082a0c9cb4ad6d6ab0480a3bb2c036c16f62ada126af7390174546efdd1fdaa006e7e9f4e0a4bad
@@ -0,0 +1,35 @@
1
+ require 'rails/generators/base'
2
+
3
+ class Styledown
4
+ module Generators
5
+ class InstallGenerator < ::Rails::Generators::Base
6
+ desc 'Adds Styledown configuration via styledown2-rails'
7
+ source_root File.expand_path('../sources', __FILE__)
8
+
9
+ class_option :template_engine
10
+
11
+ SUPPORTED_ENGINES = [:erb, :haml, :slim]
12
+
13
+ def install
14
+ engine = options[:template_engine]
15
+ engine = :erb unless SUPPORTED_ENGINES.include?(engine)
16
+
17
+ # Controllers
18
+ template 'controller.rb', 'app/controllers/styleguides_controller.rb'
19
+
20
+ # Routes
21
+ route "resource 'styleguides', only: [:show] do\n" +
22
+ " get '*page', action: :show, as: :page\n" +
23
+ ' end'
24
+
25
+ # Views
26
+ template "_head.#{engine}", "app/views/styleguides/_head.#{engine}"
27
+
28
+ # Styleguides
29
+ template 'index.md', 'docs/styleguides/index.md'
30
+ template 'buttons.md', 'docs/styleguides/buttons.md'
31
+ template 'README.md', 'docs/styleguides/README.md'
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,5 @@
1
+ # Table of Contents
2
+
3
+ * [Styleguides](index.md)
4
+ * [Buttons](buttons.md)
5
+ * [Forms](forms.md)
@@ -0,0 +1,2 @@
1
+ <%= stylesheet_link_tag 'application' %>
2
+ <%= javascript_include_tag 'application' %>
@@ -0,0 +1,2 @@
1
+ = stylesheet_link_tag 'application'
2
+ = javascript_include_tag 'application'
@@ -0,0 +1,2 @@
1
+ = stylesheet_link_tag 'application'
2
+ = javascript_include_tag 'application'
@@ -0,0 +1,11 @@
1
+ # Buttons
2
+
3
+ These are example styleguides.
4
+
5
+ ### buttons
6
+ These are buttons. And since we defined :haml in `use_template_engine`,
7
+ these haml examples will be rendered within Rails.
8
+
9
+ ```example.haml
10
+ %a.btn.btn-default Click me
11
+ ```
@@ -0,0 +1,12 @@
1
+ class StyleguidesController < ApplicationController
2
+ include Styledown::Rails::Controller
3
+
4
+ # Where your styleguides are stored
5
+ styledown.root = 'docs/styleguides'
6
+
7
+ # Partial to be added before </head>
8
+ styledown.append_template :head, 'styleguides/head'
9
+
10
+ # Languages in examples to be using Rails template engines
11
+ styledown.use_template_engine :<%= options[:template_engine] %>
12
+ end
@@ -0,0 +1,10 @@
1
+ # Forms
2
+
3
+ Forms go here
4
+
5
+ ### text fields
6
+ They're very nice.
7
+
8
+ ```example.html
9
+ <input type='text'>
10
+ ```
@@ -0,0 +1,3 @@
1
+ # Styleguides
2
+
3
+ Welcome to our styleguides!
@@ -1,5 +1,5 @@
1
1
  class Styledown
2
2
  module Rails
3
- VERSION = '2.0.0.pre5'
3
+ VERSION = '2.0.0.pre6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: styledown2-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre5
4
+ version: 2.0.0.pre6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rico Sta. Cruz
@@ -79,6 +79,15 @@ files:
79
79
  - Rakefile
80
80
  - docs/api.md
81
81
  - docs/manual_install.md
82
+ - lib/generators/styledown/install_generator.rb
83
+ - lib/generators/styledown/sources/README.md
84
+ - lib/generators/styledown/sources/_head.erb
85
+ - lib/generators/styledown/sources/_head.haml
86
+ - lib/generators/styledown/sources/_head.slim
87
+ - lib/generators/styledown/sources/buttons.md
88
+ - lib/generators/styledown/sources/controller.rb
89
+ - lib/generators/styledown/sources/forms.md
90
+ - lib/generators/styledown/sources/index.md
82
91
  - lib/styledown/rails.rb
83
92
  - lib/styledown/rails/controller.rb
84
93
  - lib/styledown/rails/controller_integration.rb