Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 168 lines (165 sloc) 6.502 kb
35d7355 @joshuaclayton Removed scripts and docs folder for more conventional folder structur…
joshuaclayton authored
1 #!/usr/bin/env ruby
7a6d163 Fixed double paren at end of require
Joshua Clayton authored
2 require File.join(File.dirname(__FILE__), "blueprint", "blueprint")
35d7355 @joshuaclayton Removed scripts and docs folder for more conventional folder structur…
joshuaclayton authored
3
4 # **Basic
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
5 #
6 # Calling this file by itself will pull files from blueprint/src and
7 # concatenate them into three files; ie.css, print.css, and screen.css.
8 #
35d7355 @joshuaclayton Removed scripts and docs folder for more conventional folder structur…
joshuaclayton authored
9 # ruby compress.rb
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
10 #
f618ad7 @joshuaclayton Fixed a couple simple problems with Windows handling file generation,…
joshuaclayton authored
11 # However, argument variables can be set to change how this works.
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
12 #
f618ad7 @joshuaclayton Fixed a couple simple problems with Windows handling file generation,…
joshuaclayton authored
13 # Calling
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
14 #
9fb4e04 @joshuaclayton Moved compress.rb to standard options using OptionParse, added code t…
joshuaclayton authored
15 # ruby compress.rb -h
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
16 #
f618ad7 @joshuaclayton Fixed a couple simple problems with Windows handling file generation,…
joshuaclayton authored
17 # will reveal basic arguments you can pass to the compress.rb file.
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
18 #
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
19 # **Custom Settings
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
20 #
21 # To use custom settings, the file need to be stored in settings.yml within
22 # this directory. An example YAML file has been included.
23 #
24 # Another ability is to use YAML (spec is at http://www.yaml.org/spec/1.1/)
25 # for project settings in a predefined structure and store all pertinent
26 # information there. The YAML file has multiple keys (usually a named
27 # project) with a set of data that defines that project. A sample structure
28 # can be found in settings.example.yml.
29 #
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
30 # The basic structure is this:
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
31 #
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
32 # Root nodes are project names. You use these when calling compress.rb as such:
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
33 #
9fb4e04 @joshuaclayton Moved compress.rb to standard options using OptionParse, added code t…
joshuaclayton authored
34 # ruby compress.rb -p PROJECTNAME
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
35 #
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
36 # A sample YAML with only roots and output paths would look like this:
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
37 #
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
38 # project1:
39 # path: /path/to/my/project/stylesheets
40 # project2:
41 # path: /path/to/different/stylesheets
42 # project3:
43 # path: /path/to/another/projects/styles
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
44 #
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
45 # You can then call
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
46 #
9fb4e04 @joshuaclayton Moved compress.rb to standard options using OptionParse, added code t…
joshuaclayton authored
47 # ruby compress.rb -p project1
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
48 #
49 # or
50 #
9fb4e04 @joshuaclayton Moved compress.rb to standard options using OptionParse, added code t…
joshuaclayton authored
51 # ruby compress.rb -p project3
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
52 #
53 # This would compress and export Blueprints CSS to the respective directory,
54 # checking for my-(ie|print|screen).css and appending it if present
55 #
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
56 # A more advanced structure would look like this:
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
57 #
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
58 # project1:
59 # path: /path/to/my/project/stylesheets
60 # namespace: custom-namespace-1-
61 # custom_css:
62 # ie.css:
63 # - custom-ie.css
64 # print.css:
65 # - docs.css
66 # - my-print-styles.css
67 # screen.css:
68 # - subfolder-of-stylesheets/sub_css.css
5036719 @joshuaclayton Added custom layout functionality; users can define column count, col…
joshuaclayton authored
69 # custom_layout:
70 # column_count: 12
71 # column_width: 70
72 # gutter_width: 10
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
73 # project2:
74 # path: /path/to/different/stylesheets
75 # namespace: different-namespace-
76 # custom_css:
311a2c7 @joshuaclayton Fixed output of compressed file to have different spacing/line breaks…
joshuaclayton authored
77 # screen.css:
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
78 # - custom_screen.css
1a0c110 @joshuaclayton Added ability to define semantic classes within the settings yml file…
joshuaclayton authored
79 # semantic_classes:
709c173 @joshuaclayton Modified semantic classes to use full strings instead of prepending a…
joshuaclayton authored
80 # "#footer, #header": column span-24 last
81 # "#content": column span-18 border
82 # "#extra-content": last span-6 column
83 # "div#navigation": last span-24 column
84 # "div.section, div.entry, .feeds": span-6 column
312d01f @joshuaclayton Added ability to include plugins in output CSS
joshuaclayton authored
85 # plugins:
86 # - fancy-type
87 # - buttons
88 # - validations
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
89 # project3:
90 # path: /path/to/another/projects/styles
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
91 #
92 # In a structure like this, a lot more assignment is occurring. Custom
93 # namespaces are being set for two projects, while the third (project3)
94 # is just a simple path setting.
95 #
96 # Also, custom CSS is being used that is appended at the end of its respective
97 # file. So, in project1, print.css will have docs.css and my-print-styles.css
98 # instead of the default my-print.css. Note that these files are relative
99 # to the path that you defined above; you can use subdirectories from the
100 # default path if you would like.
101 #
102 # Another thing to note here is the custom_layout; if not defined, your
103 # generated CSS will default to the 24 column, 950px wide grid that has been
104 # standard with Blueprint for quite some time. However, you can specify a
105 # custom grid setup if you would like. The three options are column_count
106 # (the number of columns you want your grid to have), column width (the
107 # width in pixels that you want your columns to be), and gutter_width (the
108 # width in pixels you want your gutters - space between columns - to be).
109 # To use the Blueprint default, do not define this in your settings file.
110 #
111 # Semantic classes are still in the works within Blueprint, but a simple
112 # implementation has been created.
113 #
114 # Defining semantic_classes, with nodes underneath, will generate a class
115 # for each node which has rules of each class assigned to it. For example,
116 # in project2 above, for '#footer, #header', elements with id's of footer
117 # and header will be assigned all the rules from the classes 'span-24,
118 # column, and last', while divs with classes either entry or section, as
119 # well as any element with class of feed, is assigned all the rules from
120 # 'span-6 and column'. Although it is a crude way do accomplish this, it
121 # keeps the generated CSS separate from the core BP CSS.
122 #
123 # Also supported is plugins. The compressor looks withinBLUEPRINT_DIR/blueprint/plugins
124 # to match against what's passed. If the plugin name matches, it will append
125 # PLUGIN/(screen|print|ie).css to the corresponding CSS file. It will append
126 # the plugin CSS to all three CSS files if there is a CSS file present named
127 # as the plugin (e.g. the fancy-type plugin with a fancy-type.css file found
128 # within the plugin directory)
129 #
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
130 # In Ruby, the structure would look like this:
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
131 #
709c173 @joshuaclayton Modified semantic classes to use full strings instead of prepending a…
joshuaclayton authored
132 # {
133 # 'project1' => {
134 # 'path' => '/path/to/my/project/stylesheets',
135 # 'namespace' => 'custom-namespace-1-',
136 # 'custom_css' => {
137 # 'ie.css' => ['custom-ie.css'],
138 # 'print.css' => ['docs.css', 'my-print-styles.css'],
139 # 'screen.css' => ['subfolder-of-stylesheets/sub_css.css']
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
140 # },
709c173 @joshuaclayton Modified semantic classes to use full strings instead of prepending a…
joshuaclayton authored
141 # 'custom_layout' => {
142 # 'column_count' => 12,
143 # 'column_width' => 70,
144 # 'gutter_width' => 10
145 # }
146 # },
147 # 'project2' => {
148 # 'path' => '/path/to/different/stylesheets',
149 # 'namespace' => 'different-namespace-',
150 # 'custom_css' => {
151 # 'screen.css' => ['custom_screen.css']
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
152 # },
709c173 @joshuaclayton Modified semantic classes to use full strings instead of prepending a…
joshuaclayton authored
153 # 'semantic_classes' => {
154 # '#footer, #header' => 'column span-24 last',
155 # '#content' => 'column span-18 border',
156 # '#extra-content' => 'last span-6 column',
157 # 'div#navigation' => 'last span-24 column',
158 # 'div.section, div.entry, .feeds' => 'span-6 column'
312d01f @joshuaclayton Added ability to include plugins in output CSS
joshuaclayton authored
159 # },
160 # 'plugins' => ['fancy-type', 'buttons', 'validations']
709c173 @joshuaclayton Modified semantic classes to use full strings instead of prepending a…
joshuaclayton authored
161 # },
162 # 'project3' => {
163 # 'path' => '/path/to/another/projects/styles'
896c66f @joshuaclayton Added ability to store project settings in settings.yml and pass PROJ…
joshuaclayton authored
164 # }
709c173 @joshuaclayton Modified semantic classes to use full strings instead of prepending a…
joshuaclayton authored
165 # }
35d7355 @joshuaclayton Removed scripts and docs folder for more conventional folder structur…
joshuaclayton authored
166
6a5a2e2 @joshuaclayton Whitespace and formatting clean up
joshuaclayton authored
167 Blueprint::Compressor.new.generate!
Something went wrong with that request. Please try again.