docks_app 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.editorconfig +8 -0
- data/.gitignore +22 -0
- data/.rubocop.yml +20 -0
- data/.travis.yml +10 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +35 -0
- data/Rakefile +3 -0
- data/bin/docks +5 -0
- data/config/json/docks_config.json +71 -0
- data/config/ruby/docks_config.rb +127 -0
- data/config/yaml/docks_config.yml +70 -0
- data/docks.gemspec +38 -0
- data/lib/docks/build.rb +300 -0
- data/lib/docks/cache.rb +143 -0
- data/lib/docks/command_line.rb +65 -0
- data/lib/docks/configuration.rb +217 -0
- data/lib/docks/containers/base_container.rb +103 -0
- data/lib/docks/containers/class_container.rb +39 -0
- data/lib/docks/containers/component_container.rb +92 -0
- data/lib/docks/containers/demo_container.rb +105 -0
- data/lib/docks/containers/factory_container.rb +12 -0
- data/lib/docks/containers/function_container.rb +46 -0
- data/lib/docks/containers/mixin_container.rb +19 -0
- data/lib/docks/containers/pattern_container.rb +168 -0
- data/lib/docks/containers/pattern_library_container.rb +77 -0
- data/lib/docks/containers/state_container.rb +9 -0
- data/lib/docks/containers/symbol_container.rb +77 -0
- data/lib/docks/containers/variable_container.rb +47 -0
- data/lib/docks/containers/variant_container.rb +9 -0
- data/lib/docks/containers/variation_container.rb +38 -0
- data/lib/docks/containers.rb +25 -0
- data/lib/docks/descriptor.rb +60 -0
- data/lib/docks/errors.rb +5 -0
- data/lib/docks/group.rb +66 -0
- data/lib/docks/helpers/github_helper.rb +29 -0
- data/lib/docks/helpers/path_helper.rb +94 -0
- data/lib/docks/helpers/render_helper.rb +87 -0
- data/lib/docks/helpers.rb +19 -0
- data/lib/docks/languages/base_language.rb +17 -0
- data/lib/docks/languages/coffeescript_language.rb +30 -0
- data/lib/docks/languages/common_types/markup_language.rb +71 -0
- data/lib/docks/languages/css_language.rb +13 -0
- data/lib/docks/languages/erb_language.rb +21 -0
- data/lib/docks/languages/haml_language.rb +21 -0
- data/lib/docks/languages/html_language.rb +10 -0
- data/lib/docks/languages/javascript_language.rb +42 -0
- data/lib/docks/languages/json_language.rb +18 -0
- data/lib/docks/languages/less_language.rb +33 -0
- data/lib/docks/languages/markdown_language.rb +10 -0
- data/lib/docks/languages/sass_language.rb +36 -0
- data/lib/docks/languages/slim_language.rb +21 -0
- data/lib/docks/languages/stylus_language.rb +26 -0
- data/lib/docks/languages/yaml_language.rb +18 -0
- data/lib/docks/languages.rb +103 -0
- data/lib/docks/markdown.rb +18 -0
- data/lib/docks/messenger.rb +69 -0
- data/lib/docks/naming_conventions/base_naming_convention.rb +9 -0
- data/lib/docks/naming_conventions/bem_naming_convention.rb +45 -0
- data/lib/docks/naming_conventions/suit_naming_convention.rb +45 -0
- data/lib/docks/naming_conventions.rb +21 -0
- data/lib/docks/ostruct.rb +17 -0
- data/lib/docks/parser.rb +86 -0
- data/lib/docks/parsers/base_parser.rb +128 -0
- data/lib/docks/parsers/coffeescript_parser.rb +30 -0
- data/lib/docks/parsers/css_parser.rb +27 -0
- data/lib/docks/parsers/javascript_parser.rb +30 -0
- data/lib/docks/parsers/less_parser.rb +22 -0
- data/lib/docks/parsers/sass_parser.rb +31 -0
- data/lib/docks/parsers/stylus_parser.rb +28 -0
- data/lib/docks/process.rb +60 -0
- data/lib/docks/processors.rb +416 -0
- data/lib/docks/renderers/base_renderer.rb +64 -0
- data/lib/docks/renderers/common_features/capturable.rb +69 -0
- data/lib/docks/renderers/common_features/helperable.rb +23 -0
- data/lib/docks/renderers/erb_renderer.rb +68 -0
- data/lib/docks/renderers/haml_renderer.rb +37 -0
- data/lib/docks/renderers/slim_renderer.rb +33 -0
- data/lib/docks/symbol_sources/base_symbol_source.rb +12 -0
- data/lib/docks/symbol_sources/jquery_symbol_source.rb +17 -0
- data/lib/docks/symbol_sources/mdn_symbol_source.rb +35 -0
- data/lib/docks/symbol_sources/sass_symbol_source.rb +27 -0
- data/lib/docks/symbol_sources.rb +28 -0
- data/lib/docks/tags/access_tag.rb +27 -0
- data/lib/docks/tags/activate_with_tag.rb +17 -0
- data/lib/docks/tags/active_tag.rb +14 -0
- data/lib/docks/tags/alias_tag.rb +17 -0
- data/lib/docks/tags/author_tag.rb +19 -0
- data/lib/docks/tags/base_tag.rb +52 -0
- data/lib/docks/tags/beta_tag.rb +26 -0
- data/lib/docks/tags/class_tag.rb +16 -0
- data/lib/docks/tags/compatibility_tag.rb +19 -0
- data/lib/docks/tags/demo_type_tag.rb +14 -0
- data/lib/docks/tags/deprecated_tag.rb +26 -0
- data/lib/docks/tags/description_tag.rb +99 -0
- data/lib/docks/tags/example_tag.rb +20 -0
- data/lib/docks/tags/factory_tag.rb +16 -0
- data/lib/docks/tags/for_tag.rb +23 -0
- data/lib/docks/tags/group_tag.rb +10 -0
- data/lib/docks/tags/helper_tag.rb +13 -0
- data/lib/docks/tags/include_with_tag.rb +57 -0
- data/lib/docks/tags/javascript_action_tag.rb +10 -0
- data/lib/docks/tags/link_tag.rb +18 -0
- data/lib/docks/tags/markup_tag.rb +106 -0
- data/lib/docks/tags/member_tag.rb +37 -0
- data/lib/docks/tags/method_tag.rb +18 -0
- data/lib/docks/tags/name_tag.rb +10 -0
- data/lib/docks/tags/object_tag.rb +15 -0
- data/lib/docks/tags/param_tag.rb +94 -0
- data/lib/docks/tags/pattern_tag.rb +21 -0
- data/lib/docks/tags/preclude_tag.rb +17 -0
- data/lib/docks/tags/private_tag.rb +15 -0
- data/lib/docks/tags/property_tag.rb +18 -0
- data/lib/docks/tags/public_tag.rb +15 -0
- data/lib/docks/tags/require_tag.rb +47 -0
- data/lib/docks/tags/returns_tag.rb +31 -0
- data/lib/docks/tags/set_by_tag.rb +18 -0
- data/lib/docks/tags/signature_tag.rb +35 -0
- data/lib/docks/tags/since_tag.rb +26 -0
- data/lib/docks/tags/source_tag.rb +12 -0
- data/lib/docks/tags/state_tag.rb +21 -0
- data/lib/docks/tags/static_tag.rb +14 -0
- data/lib/docks/tags/subcomponent_tag.rb +68 -0
- data/lib/docks/tags/subtitle_tag.rb +11 -0
- data/lib/docks/tags/symbol_type_tag.rb +10 -0
- data/lib/docks/tags/throws_tag.rb +30 -0
- data/lib/docks/tags/title_tag.rb +10 -0
- data/lib/docks/tags/type_tag.rb +10 -0
- data/lib/docks/tags/value_tag.rb +10 -0
- data/lib/docks/tags/variant_tag.rb +21 -0
- data/lib/docks/tags/variation_tag.rb +136 -0
- data/lib/docks/tags.rb +103 -0
- data/lib/docks/templates.rb +122 -0
- data/lib/docks/themes.rb +19 -0
- data/lib/docks/types.rb +26 -0
- data/lib/docks/version.rb +3 -0
- data/lib/docks.rb +37 -0
- data/spec/fixtures/build/scripts/bar/bar_2.js +1 -0
- data/spec/fixtures/build/scripts/bar.js +1 -0
- data/spec/fixtures/build/styles/foo/foo-2.css +1 -0
- data/spec/fixtures/build/styles/foo.css +1 -0
- data/spec/fixtures/build/templates/baz/baz_2.erb +1 -0
- data/spec/fixtures/build/templates/baz.erb +1 -0
- data/spec/fixtures/grouper/components/button/button.coffee +0 -0
- data/spec/fixtures/grouper/components/button/button.haml +0 -0
- data/spec/fixtures/grouper/components/button/button.scss +0 -0
- data/spec/fixtures/grouper/components/checkbox/_checkbox.haml +0 -0
- data/spec/fixtures/grouper/components/checkbox/_checkbox.scss +0 -0
- data/spec/fixtures/grouper/components/checkbox/checkbox.coffee +0 -0
- data/spec/fixtures/grouper/components/form/form.coffee +0 -0
- data/spec/fixtures/grouper/components/form/form.m +0 -0
- data/spec/fixtures/grouper/components/form/form.scss +0 -0
- data/spec/fixtures/grouper/components/next-expanding-textarea/_next-expanding-textarea.scss +0 -0
- data/spec/fixtures/grouper/components/next-expanding-textarea/_next_expanding_textarea.coffee +0 -0
- data/spec/fixtures/grouper/components/next-expanding-textarea/next-expanding-textarea.haml +0 -0
- data/spec/fixtures/grouper/components/next-tab/next-tab.coffee +0 -0
- data/spec/fixtures/grouper/components/next-tab/next-tab.haml +0 -0
- data/spec/fixtures/grouper/components/next-tab/next-tab.scss +0 -0
- data/spec/fixtures/grouper/components/segmented control/segmented control.coffee +0 -0
- data/spec/fixtures/grouper/components/segmented control/segmented control.haml +0 -0
- data/spec/fixtures/grouper/components/segmented control/segmented control.min.html +0 -0
- data/spec/fixtures/grouper/components/segmented control/segmented control.scss +0 -0
- data/spec/fixtures/grouper/markup/list-view.haml +0 -0
- data/spec/fixtures/grouper/markup/resizable/resizable.haml +0 -0
- data/spec/fixtures/grouper/markup/toggle.haml +0 -0
- data/spec/fixtures/grouper/scripts/resizable/resizable.coffee +0 -0
- data/spec/fixtures/grouper/scripts/toggle.coffee +0 -0
- data/spec/fixtures/grouper/style/_list-view.scss +0 -0
- data/spec/fixtures/grouper/style/_toggle.scss +0 -0
- data/spec/fixtures/languages/stub.json +3 -0
- data/spec/fixtures/languages/stub.yml +2 -0
- data/spec/fixtures/parsers/coffeescript_parser_fixture_basic.coffee +20 -0
- data/spec/fixtures/parsers/coffeescript_parser_fixture_complex.coffee +80 -0
- data/spec/fixtures/parsers/css_parser_fixture_basic.css +44 -0
- data/spec/fixtures/parsers/css_parser_fixture_complex.css +120 -0
- data/spec/fixtures/parsers/javascript_parser_fixture_basic.js +27 -0
- data/spec/fixtures/parsers/javascript_parser_fixture_complex.js +85 -0
- data/spec/fixtures/parsers/sass_parser_fixture_basic.scss +39 -0
- data/spec/fixtures/parsers/sass_parser_fixture_complex.scss +149 -0
- data/spec/fixtures/parsers/stylus_parser_fixture_basic.styl +34 -0
- data/spec/fixtures/parsers/stylus_parser_fixture_complex.styl +113 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/code_blocks.txt +10 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/headings.txt +15 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/lists.txt +21 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/lists_with_nesting.txt +13 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/multiple_paragraphs.txt +11 -0
- data/spec/fixtures/renderers/helpers.rb +37 -0
- data/spec/fixtures/renderers/html_output.html +7 -0
- data/spec/fixtures/renderers/templates/layouts/application.html.erb +0 -0
- data/spec/fixtures/renderers/templates/layouts/more/subdirectory.html.erb +0 -0
- data/spec/fixtures/renderers/templates/partials/_leading_underscore.html.erb +1 -0
- data/spec/fixtures/renderers/templates/partials/more/_subdirectory.html.erb +1 -0
- data/spec/fixtures/renderers/templates/partials/partial.html.erb +0 -0
- data/spec/fixtures/renderers/templates/partials/template.html.erb +1 -0
- data/spec/fixtures/renderers/templates/template.html.erb +1 -0
- data/spec/fixtures/tags/description/button.md +24 -0
- data/spec/fixtures/tags/description/class.md +27 -0
- data/spec/fixtures/tags/description/component.md +23 -0
- data/spec/fixtures/tags/description/function.md +30 -0
- data/spec/lib/build_spec.rb +467 -0
- data/spec/lib/cache_spec.rb +175 -0
- data/spec/lib/command_line_spec.rb +77 -0
- data/spec/lib/configuration_spec.rb +180 -0
- data/spec/lib/containers/base_container_spec.rb +214 -0
- data/spec/lib/containers/class_container_spec.rb +209 -0
- data/spec/lib/containers/component_container_spec.rb +158 -0
- data/spec/lib/containers/demo_container_spec.rb +113 -0
- data/spec/lib/containers/function_container_spec.rb +116 -0
- data/spec/lib/containers/mixin_container_spec.rb +4 -0
- data/spec/lib/containers/pattern_container_spec.rb +291 -0
- data/spec/lib/containers/pattern_library_container_spec.rb +130 -0
- data/spec/lib/containers/symbol_container_spec.rb +216 -0
- data/spec/lib/containers/variable_container_spec.rb +116 -0
- data/spec/lib/containers/variation_container_spec.rb +52 -0
- data/spec/lib/containers_spec.rb +22 -0
- data/spec/lib/descriptor_spec.rb +73 -0
- data/spec/lib/group_spec.rb +151 -0
- data/spec/lib/helpers/path_helper_spec.rb +202 -0
- data/spec/lib/helpers/render_helper_spec.rb +159 -0
- data/spec/lib/helpers_spec.rb +35 -0
- data/spec/lib/languages/base_language_spec.rb +32 -0
- data/spec/lib/languages/coffeescript_language_spec.rb +52 -0
- data/spec/lib/languages/css_language_spec.rb +13 -0
- data/spec/lib/languages/erb_language_spec.rb +33 -0
- data/spec/lib/languages/haml_language_spec.rb +32 -0
- data/spec/lib/languages/javascript_language_spec.rb +54 -0
- data/spec/lib/languages/json_language_spec.rb +24 -0
- data/spec/lib/languages/less_language_spec.rb +39 -0
- data/spec/lib/languages/markup_language_spec.rb +95 -0
- data/spec/lib/languages/sass_language_spec.rb +53 -0
- data/spec/lib/languages/slim_language_spec.rb +32 -0
- data/spec/lib/languages/stylus_language_spec.rb +34 -0
- data/spec/lib/languages/yaml_language_spec.rb +24 -0
- data/spec/lib/languages_spec.rb +127 -0
- data/spec/lib/markdown_spec.rb +63 -0
- data/spec/lib/messenger_spec.rb +1 -0
- data/spec/lib/naming_conventions/bem_naming_convention_spec.rb +112 -0
- data/spec/lib/naming_conventions/suit_naming_convention_spec.rb +107 -0
- data/spec/lib/naming_conventions_spec.rb +28 -0
- data/spec/lib/ostruct_spec.rb +15 -0
- data/spec/lib/parser_spec.rb +93 -0
- data/spec/lib/parsers/base_parser_spec.rb +128 -0
- data/spec/lib/parsers/coffeescript_parser_spec.rb +184 -0
- data/spec/lib/parsers/css_parser_spec.rb +136 -0
- data/spec/lib/parsers/javascript_parser_spec.rb +216 -0
- data/spec/lib/parsers/less_parser_spec.rb +111 -0
- data/spec/lib/parsers/sass_parser_spec.rb +233 -0
- data/spec/lib/parsers/stylus_parser_spec.rb +212 -0
- data/spec/lib/process_spec.rb +96 -0
- data/spec/lib/processors_spec.rb +555 -0
- data/spec/lib/renderers/base_renderer_spec.rb +122 -0
- data/spec/lib/renderers/common_features/helperable_spec.rb +30 -0
- data/spec/lib/renderers/erb_renderer_spec.rb +119 -0
- data/spec/lib/renderers/haml_renderer_spec.rb +103 -0
- data/spec/lib/renderers/slim_renderer_spec.rb +103 -0
- data/spec/lib/symbol_sources/jquery_symbol_source_spec.rb +25 -0
- data/spec/lib/symbol_sources/mdn_symbol_source_spec.rb +40 -0
- data/spec/lib/symbol_sources/sass_symbol_source_spec.rb +39 -0
- data/spec/lib/symbol_sources_spec.rb +19 -0
- data/spec/lib/tags/access_tag_spec.rb +32 -0
- data/spec/lib/tags/activate_with_tag_spec.rb +31 -0
- data/spec/lib/tags/active_tag_spec.rb +24 -0
- data/spec/lib/tags/alias_tag_spec.rb +31 -0
- data/spec/lib/tags/author_tag_spec.rb +172 -0
- data/spec/lib/tags/base_tag_spec.rb +21 -0
- data/spec/lib/tags/beta_tag_spec.rb +52 -0
- data/spec/lib/tags/class_tag_spec.rb +29 -0
- data/spec/lib/tags/compatibility_tag_spec.rb +159 -0
- data/spec/lib/tags/demo_type_tag_spec.rb +24 -0
- data/spec/lib/tags/deprecated_tag_spec.rb +50 -0
- data/spec/lib/tags/description_tag_spec.rb +242 -0
- data/spec/lib/tags/example_tag_spec.rb +37 -0
- data/spec/lib/tags/factory_tag_spec.rb +29 -0
- data/spec/lib/tags/for_tag_spec.rb +45 -0
- data/spec/lib/tags/group_tag_spec.rb +20 -0
- data/spec/lib/tags/helper_tag_spec.rb +22 -0
- data/spec/lib/tags/include_with_tag_spec.rb +74 -0
- data/spec/lib/tags/javascript_action_tag_spec.rb +20 -0
- data/spec/lib/tags/link_tag_spec.rb +49 -0
- data/spec/lib/tags/markup_tag_spec.rb +255 -0
- data/spec/lib/tags/member_tag_spec.rb +167 -0
- data/spec/lib/tags/method_tag_spec.rb +27 -0
- data/spec/lib/tags/name_tag_spec.rb +20 -0
- data/spec/lib/tags/object_tag_spec.rb +24 -0
- data/spec/lib/tags/param_tag_spec.rb +261 -0
- data/spec/lib/tags/pattern_tag_spec.rb +49 -0
- data/spec/lib/tags/preclude_tag_spec.rb +31 -0
- data/spec/lib/tags/private_tag_spec.rb +31 -0
- data/spec/lib/tags/property_tag_spec.rb +27 -0
- data/spec/lib/tags/public_tag_spec.rb +29 -0
- data/spec/lib/tags/require_tag_spec.rb +133 -0
- data/spec/lib/tags/returns_tag_spec.rb +85 -0
- data/spec/lib/tags/set_by_tag_spec.rb +92 -0
- data/spec/lib/tags/signature_tag_spec.rb +125 -0
- data/spec/lib/tags/since_tag_spec.rb +48 -0
- data/spec/lib/tags/state_tag_spec.rb +199 -0
- data/spec/lib/tags/static_tag_spec.rb +27 -0
- data/spec/lib/tags/subcomponent_tag_spec.rb +78 -0
- data/spec/lib/tags/subtitle_tag_spec.rb +13 -0
- data/spec/lib/tags/symbol_type_tag_spec.rb +20 -0
- data/spec/lib/tags/throws_tag_spec.rb +49 -0
- data/spec/lib/tags/title_tag_spec.rb +20 -0
- data/spec/lib/tags/type_tag_spec.rb +20 -0
- data/spec/lib/tags/value_tag_spec.rb +20 -0
- data/spec/lib/tags/variant_tag_spec.rb +13 -0
- data/spec/lib/tags/variation_tag_spec.rb +154 -0
- data/spec/lib/tags_spec.rb +264 -0
- data/spec/lib/templates_spec.rb +185 -0
- data/spec/lib/themes_spec.rb +32 -0
- data/spec/spec_helper.rb +34 -0
- data/tasks/rspec.rake +7 -0
- data/tasks/rubocop.rake +8 -0
- metadata +740 -0
data/.editorconfig
ADDED
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Documentation:
|
|
2
|
+
Enabled: false
|
|
3
|
+
|
|
4
|
+
Style/StringLiterals:
|
|
5
|
+
EnforcedStyle: double_quotes
|
|
6
|
+
|
|
7
|
+
Style/MultilineOperationIndentation:
|
|
8
|
+
Enabled: false
|
|
9
|
+
|
|
10
|
+
Metrics/MethodLength:
|
|
11
|
+
Max: 15
|
|
12
|
+
|
|
13
|
+
Metrics/ClassLength:
|
|
14
|
+
Max: 125
|
|
15
|
+
|
|
16
|
+
Metrics/LineLength:
|
|
17
|
+
Max: 100
|
|
18
|
+
|
|
19
|
+
Metrics/AbcSize:
|
|
20
|
+
Max: 20
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2014 Chris Sauve
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Docks
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/docks-app/docks)
|
|
4
|
+
|
|
5
|
+
Docks is for creating beautiful, live, styleguides.
|
|
6
|
+
|
|
7
|
+
A styleguide is a collection of your application’s visual and programmatic patterns.
|
|
8
|
+
|
|
9
|
+
Docks supports patterns for JavaScript, CoffeeScript, Sass, Less, Stylus, ERB, Slim, and Haml.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Add this line to your application's Gemfile:
|
|
14
|
+
|
|
15
|
+
gem 'docks'
|
|
16
|
+
|
|
17
|
+
And then execute:
|
|
18
|
+
|
|
19
|
+
$ bundle
|
|
20
|
+
|
|
21
|
+
Or install it yourself as:
|
|
22
|
+
|
|
23
|
+
$ gem install docks
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
TODO: Write usage instructions here
|
|
28
|
+
|
|
29
|
+
## Contributing
|
|
30
|
+
|
|
31
|
+
1. Fork it ( https://github.com/[my-github-username]/docks/fork )
|
|
32
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
33
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
34
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
35
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/docks
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
// An array of glob patterns specifying all source files. These will be the
|
|
3
|
+
// sources for all of your library's patterns. Include any style, script,
|
|
4
|
+
// markup, stub, and description files you have to document your patterns.
|
|
5
|
+
// These paths should be relative to the root of your project.
|
|
6
|
+
"sources": {{{sources}}},
|
|
7
|
+
|
|
8
|
+
// The destination folder in which you would like to generate the static
|
|
9
|
+
// pattern library. This path should be relative to the root of your project.
|
|
10
|
+
"destination": {{{destination}}},
|
|
11
|
+
|
|
12
|
+
// When generating your static styleguide, these assets will be included
|
|
13
|
+
// in the default layout file automatically (via a `link` tag when the asset
|
|
14
|
+
// is a stylesheet, and via a `script` tag when it is a JavaScript file).
|
|
15
|
+
//
|
|
16
|
+
// These assets must be compiled — Docks will not compile assets for you
|
|
17
|
+
// automatically. Feel free to omit this option if you are going to manually
|
|
18
|
+
// add the required asset tags to your layout file. These paths should be
|
|
19
|
+
// relative to the root of your project.
|
|
20
|
+
"compiled_assets": {{{compiled_assets}}},
|
|
21
|
+
|
|
22
|
+
"templates": {{{templates}}},
|
|
23
|
+
|
|
24
|
+
// The root path of your pattern library. When generating a static version,
|
|
25
|
+
// all pattern files will be nested inside this directory.
|
|
26
|
+
"mount_at": {{{mount_at}}},
|
|
27
|
+
|
|
28
|
+
"use_theme_assets": {{{use_theme_assets}}},
|
|
29
|
+
|
|
30
|
+
// The name of the Github repo for this project. This can either be the URL or
|
|
31
|
+
// in the form `<username>/<repo>`. The default theme uses this option, if
|
|
32
|
+
// passed, to provide links to create issue and view source for your pattern
|
|
33
|
+
// library's files.
|
|
34
|
+
"github_repo": {{{github_repo}}},
|
|
35
|
+
|
|
36
|
+
// This option allows you to specify the default template files to use and
|
|
37
|
+
// provide a list of patterns that will use custom templates for rendering.
|
|
38
|
+
// The special key `default` will set the default template to render for
|
|
39
|
+
// patterns that do not have a custom template. The special key `demo` will
|
|
40
|
+
// specify the template to use for rendering demos (the content that will
|
|
41
|
+
// appear in iframes in the default theme).
|
|
42
|
+
//
|
|
43
|
+
// To provide a custom template for any other pattern, simply use the pattern
|
|
44
|
+
// identifier as a key and the custom template (relative to the
|
|
45
|
+
// `asset_folders.templates` directory inside of the `library_assets` folder)
|
|
46
|
+
// as the value. For example, you could use `color: color.erb` to have the
|
|
47
|
+
// pattern with an ID of `color` use the template in (using the default
|
|
48
|
+
// folders): `<root>/pattern_library_assets/templates/color.erb`. To provide
|
|
49
|
+
// more complex matching or custom layouts in addition to custom templates,
|
|
50
|
+
// you must use the `.rb` version of this config file.
|
|
51
|
+
"custom_templates": {{{custom_templates}}},
|
|
52
|
+
|
|
53
|
+
// The naming convention to use for such things as identifying a state versus
|
|
54
|
+
// a variant and determining the base class of a given variation. There are
|
|
55
|
+
// a few bundled naming conventions, viewable under lib/docks/naming_conventions.
|
|
56
|
+
// You can either pass a string with the name of the desired naming convention
|
|
57
|
+
// (capitalization is important) or pass an instance of a naming convention
|
|
58
|
+
// class. If creating your own naming convention, make sure to inherit and
|
|
59
|
+
// override all methods in `Docks::NamingConventions::Base`.
|
|
60
|
+
"naming_convention": {{{ naming_convention }}},
|
|
61
|
+
|
|
62
|
+
// A list of file names that contain helper modules needed to render your
|
|
63
|
+
// components, or that you want available to be used inside your views. Every
|
|
64
|
+
// module in each of these files will be included in the renderer so that you
|
|
65
|
+
// have access to them in all of your templates. These files should be relative
|
|
66
|
+
// to the root of your project.
|
|
67
|
+
"helpers": {{{helpers}}},
|
|
68
|
+
|
|
69
|
+
"theme": {{{theme}}},
|
|
70
|
+
"paginate": {{{paginate}}}
|
|
71
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
Docks.configure do |config|
|
|
2
|
+
|
|
3
|
+
# An array of glob patterns specifying all source files. These will be the
|
|
4
|
+
# sources for all of your library's patterns. Include any style, script,
|
|
5
|
+
# markup, stub, and description files you have to document your patterns.
|
|
6
|
+
# These paths should be relative to the root of your project.
|
|
7
|
+
config.sources = {{{sources}}}
|
|
8
|
+
|
|
9
|
+
# The destination folder in which you would like to generate the static
|
|
10
|
+
# pattern library. This path should be relative to the root of your project.
|
|
11
|
+
config.destination = {{{destination}}}
|
|
12
|
+
|
|
13
|
+
# When generating your static styleguide, these assets will be included
|
|
14
|
+
# in the default layout file automatically (via a `link` tag when the asset
|
|
15
|
+
# is a stylesheet, and via a `script` tag when it is a JavaScript file).
|
|
16
|
+
#
|
|
17
|
+
# These assets must be compiled — Docks will not compile assets for you
|
|
18
|
+
# automatically. Feel free to omit this option if you are going to manually
|
|
19
|
+
# add the required asset tags to your layout file. These paths should be
|
|
20
|
+
# relative to the root of your project.
|
|
21
|
+
config.compiled_assets = {{{compiled_assets}}}
|
|
22
|
+
|
|
23
|
+
config.templates = {{{templates}}}
|
|
24
|
+
|
|
25
|
+
# The root path of your pattern library. When generating a static version,
|
|
26
|
+
# all pattern files will be nested inside this directory.
|
|
27
|
+
config.mount_at = {{{mount_at}}}
|
|
28
|
+
|
|
29
|
+
config.use_theme_assets = {{{use_theme_assets}}}
|
|
30
|
+
|
|
31
|
+
# The name of the Github repo for this project. This can either be the URL or
|
|
32
|
+
# in the form `<username>/<repo>`. The default theme uses this option, if
|
|
33
|
+
# passed, to provide links to create issue and view source for your pattern
|
|
34
|
+
# library's files.
|
|
35
|
+
config.github_repo = {{{github_repo}}}
|
|
36
|
+
|
|
37
|
+
# Yields an object that allows you to register custom templates for particular
|
|
38
|
+
# patterns. See `Docks::Templates` for all of the available template
|
|
39
|
+
# customizations. The basics are that you can set the fallback template,
|
|
40
|
+
# fallback layout file, and the template for demos with the `fallback=`,
|
|
41
|
+
# `default_layout=`, and `demo=` methods. You can also register a custom
|
|
42
|
+
# template for patterns matching a pattern ID by calling `Templates.register`
|
|
43
|
+
# like so:
|
|
44
|
+
#
|
|
45
|
+
# config.custom_templates do |templates|
|
|
46
|
+
# templates.register("color.html.erb", for: /color/)
|
|
47
|
+
# # or, equivalently, templates << Docks::Templates::Template.new("color.html.erb", for: /color/)
|
|
48
|
+
# end
|
|
49
|
+
#
|
|
50
|
+
# Which would register "color.html.erb" to be used for patterns whose name
|
|
51
|
+
# matches `/color/`. You can also call `Docks::Templates.register` with a
|
|
52
|
+
# hash of pattern: template pairs, in which the keys will be used as the
|
|
53
|
+
# "matcher" and the values will be the custom template to use for patterns
|
|
54
|
+
# with a matching name.
|
|
55
|
+
config.custom_templates = {{{custom_templates}}}
|
|
56
|
+
|
|
57
|
+
# The naming convention to use for such things as identifying a state versus
|
|
58
|
+
# a variant and determining the base class of a given variation. There are
|
|
59
|
+
# a few bundled naming conventions, viewable under lib/docks/naming_conventions.
|
|
60
|
+
# You can either pass a string with the name of the desired naming convention
|
|
61
|
+
# (capitalization is important) or pass an instance of a naming convention
|
|
62
|
+
# class. If creating your own naming convention, make sure to inherit and
|
|
63
|
+
# override all methods in `Docks::NamingConventions::Base`.
|
|
64
|
+
config.naming_convention = {{{naming_convention}}}
|
|
65
|
+
|
|
66
|
+
# A list of file names or Modules that contain helper modules needed to render
|
|
67
|
+
# your components, or that you want available to be used inside your views.
|
|
68
|
+
#
|
|
69
|
+
# If you pass a list of files, every module in each file will be included in
|
|
70
|
+
# the renderer so that you have access to them in all of your templates. These
|
|
71
|
+
# files should be relative to the root of your project.
|
|
72
|
+
#
|
|
73
|
+
# If you pass a list of modules, no additional work is required on your part.
|
|
74
|
+
# These will be included automatically in all template rendering.
|
|
75
|
+
config.helpers = {{{helpers}}}
|
|
76
|
+
|
|
77
|
+
# This option allows you to provide a custom lambda to determine what pattern
|
|
78
|
+
# a given string belongs to. The lambda should accept a single file name
|
|
79
|
+
# which may be either a filename (most commonly), or any other string (for
|
|
80
|
+
# example, this is used to try to match the name of a component to a markup
|
|
81
|
+
# file by first running both through this lambda). The default, if you do
|
|
82
|
+
# not provide anything for the option below (or provide an empty lambda)
|
|
83
|
+
# will strip leading underscores and normalize dashes and underscores of the
|
|
84
|
+
# extension-less base name of whatever string you pass to it. For details,
|
|
85
|
+
# see `lib/group.rb`.
|
|
86
|
+
config.pattern_id = lambda do |file|
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Yields an object that allows you to register custom tags. Your
|
|
90
|
+
# tag should extend `Docks::Tags::Base` (or a subclass). Once you have defined
|
|
91
|
+
# it, register the custom tag as follows:
|
|
92
|
+
#
|
|
93
|
+
# config.custom_tags { |tags| tags << MyCustomTagClass }
|
|
94
|
+
config.custom_tags do |tags|
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Yields an object that allows you to register custom languages. Your
|
|
98
|
+
# language should extend `Docks::Languages::Base`. (or a subclass) Once you
|
|
99
|
+
# have defined it, register the custom language as follows:
|
|
100
|
+
#
|
|
101
|
+
# config.custom_languages { |languages| languages << MyCustomLanguageClass }
|
|
102
|
+
config.custom_languages do |languages|
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Yields an object that allows you to register custom parsers. Your
|
|
106
|
+
# parser should extend `Docks::Parsers::Base` (or a subclass). The second
|
|
107
|
+
# argument should be a hash with a `:for` key that specifies a regular
|
|
108
|
+
# expression that will match files that should use this parser. Once you have
|
|
109
|
+
# defined it, register the custom parser as follows:
|
|
110
|
+
#
|
|
111
|
+
# config.custom_parsers { |parsers| parsers.register(MyCustomParserClass, for: /the_pattern_to_match/) }
|
|
112
|
+
config.custom_parsers do |parsers|
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Yields an object that allows you to register custom symbol sources (that is,
|
|
116
|
+
# objects that understand specific types that may be found in your
|
|
117
|
+
# documentation and that can provide links to the relevant documentation
|
|
118
|
+
# for those types). Your symbol source should extend `Docks::SymbolSources::Base`.
|
|
119
|
+
# Once you have defined it, register the custom source as follows:
|
|
120
|
+
#
|
|
121
|
+
# config.custom_symbol_sources { |symbol_sources| symbol_sources << MyCustomSourceClass }
|
|
122
|
+
config.custom_symbol_sources do |symbol_sources|
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
config.theme = {{{theme}}}
|
|
126
|
+
config.paginate = {{{paginate}}}
|
|
127
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
# An array of glob patterns specifying all source files. These will be the
|
|
3
|
+
# sources for all of your library's patterns. Include any style, script,
|
|
4
|
+
# markup, stub, and description files you have to document your patterns.
|
|
5
|
+
# These paths should be relative to the root of your project.
|
|
6
|
+
sources: {{{sources}}}
|
|
7
|
+
|
|
8
|
+
# The destination folder in which you would like to generate the static
|
|
9
|
+
# pattern library. This path should be relative to the root of your project.
|
|
10
|
+
destination: {{{destination}}}
|
|
11
|
+
|
|
12
|
+
# When generating your static styleguide, these assets will be included
|
|
13
|
+
# in the default layout file automatically (via a `link` tag when the asset
|
|
14
|
+
# is a stylesheet, and via a `script` tag when it is a JavaScript file).
|
|
15
|
+
#
|
|
16
|
+
# These assets must be compiled — Docks will not compile assets for you
|
|
17
|
+
# automatically. Feel free to omit this option if you are going to manually
|
|
18
|
+
# add the required asset tags to your layout file. These paths should be
|
|
19
|
+
# relative to the root of your project.
|
|
20
|
+
compiled_assets: {{{compiled_assets}}}
|
|
21
|
+
|
|
22
|
+
templates: {{{templates}}}
|
|
23
|
+
|
|
24
|
+
# The root path of your pattern library. When generating a static version,
|
|
25
|
+
# all pattern files will be nested inside this directory.
|
|
26
|
+
mount_at: {{{mount_at}}}
|
|
27
|
+
|
|
28
|
+
use_theme_assets: {{{use_theme_assets}}}
|
|
29
|
+
|
|
30
|
+
# The name of the Github repo for this project. This can either be the URL or
|
|
31
|
+
# in the form `<username>/<repo>`. The default theme uses this option, if
|
|
32
|
+
# passed, to provide links to create issue and view source for your pattern
|
|
33
|
+
# library's files.
|
|
34
|
+
github_repo: {{{github_repo}}}
|
|
35
|
+
|
|
36
|
+
# This option allows you to specify the default template files to use and
|
|
37
|
+
# provide a list of patterns that will use custom templates for rendering.
|
|
38
|
+
# The special key `default` will set the default template to render for
|
|
39
|
+
# patterns that do not have a custom template. The special key `demo` will
|
|
40
|
+
# specify the template to use for rendering demos (the content that will
|
|
41
|
+
# appear in iframes in the default theme).
|
|
42
|
+
#
|
|
43
|
+
# To provide a custom template for any other pattern, simply use the pattern
|
|
44
|
+
# identifier as a key and the custom template (relative to the
|
|
45
|
+
# `asset_folders.templates` directory inside of the `library_assets` folder)
|
|
46
|
+
# as the value. For example, you could use `color: color.erb` to have the
|
|
47
|
+
# pattern with an ID of `color` use the template in (using the default
|
|
48
|
+
# folders): `<root>/pattern_library_assets/templates/color.erb`. To provide
|
|
49
|
+
# more complex matching or custom layouts in addition to custom templates,
|
|
50
|
+
# you must use the `.rb` version of this config file.
|
|
51
|
+
custom_templates: {{{custom_templates}}}
|
|
52
|
+
|
|
53
|
+
# The naming convention to use for such things as identifying a state versus
|
|
54
|
+
# a variant and determining the base class of a given variation. There are
|
|
55
|
+
# a few bundled naming conventions, viewable under `lib/docks/naming_conventions`.
|
|
56
|
+
# You can either pass a string with the name of the desired naming convention
|
|
57
|
+
# (capitalization is important) or pass an instance of a naming convention
|
|
58
|
+
# class. If creating your own naming convention, make sure to inherit and
|
|
59
|
+
# override all methods in `Docks::NamingConventions::Base`.
|
|
60
|
+
naming_convention: {{{naming_convention}}}
|
|
61
|
+
|
|
62
|
+
# A list of file names that contain helper modules needed to render your
|
|
63
|
+
# components, or that you want available to be used inside your views. Every
|
|
64
|
+
# module in each of these files will be included in the renderer so that you
|
|
65
|
+
# have access to them in all of your templates. These files should be relative
|
|
66
|
+
# to the root of your project.
|
|
67
|
+
helpers: {{{helpers}}}
|
|
68
|
+
|
|
69
|
+
theme: {{{theme}}}
|
|
70
|
+
paginate: {{{paginate}}}
|
data/docks.gemspec
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require "rubygems"
|
|
2
|
+
|
|
3
|
+
# -*- encoding: utf-8 -*-
|
|
4
|
+
$:.push File.expand_path("../lib", __FILE__)
|
|
5
|
+
require "docks/version"
|
|
6
|
+
|
|
7
|
+
Gem::Specification.new do |s|
|
|
8
|
+
s.name = "docks_app"
|
|
9
|
+
s.version = Docks::VERSION
|
|
10
|
+
s.platform = Gem::Platform::RUBY
|
|
11
|
+
s.required_ruby_version = ">= 1.9.3"
|
|
12
|
+
s.authors = ["Chris Sauve"]
|
|
13
|
+
s.email = ["chrismsauve@gmail.com"]
|
|
14
|
+
s.license = "MIT"
|
|
15
|
+
s.homepage = ""
|
|
16
|
+
s.summary = "A pattern library generator for front-end projects."
|
|
17
|
+
s.description = s.summary
|
|
18
|
+
|
|
19
|
+
s.files = `git ls-files`.split("\n")
|
|
20
|
+
s.test_files = `git ls-files -- spec/*`.split("\n")
|
|
21
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
|
22
|
+
s.require_paths = ["lib"]
|
|
23
|
+
|
|
24
|
+
s.add_runtime_dependency "redcarpet", "~> 3.1"
|
|
25
|
+
s.add_runtime_dependency "activesupport"
|
|
26
|
+
s.add_runtime_dependency "mustache", "~> 0.99.5"
|
|
27
|
+
|
|
28
|
+
s.add_development_dependency "bundler", "~> 1.3"
|
|
29
|
+
s.add_development_dependency "rubocop", "< 1.0"
|
|
30
|
+
s.add_development_dependency "rake", "~> 10.4"
|
|
31
|
+
s.add_development_dependency "rspec", "~> 3.0"
|
|
32
|
+
s.add_development_dependency "haml", "~> 4.0"
|
|
33
|
+
s.add_development_dependency "slim", "~> 3.0"
|
|
34
|
+
s.add_development_dependency "awesome_print", "~> 1.6"
|
|
35
|
+
s.add_development_dependency "rspec-html-matchers", "~> 0.7"
|
|
36
|
+
s.add_development_dependency "html2haml", "~> 2.0"
|
|
37
|
+
s.add_development_dependency "html2slim", "~> 0.2"
|
|
38
|
+
end
|