Permalink
Browse files

Merge pull request #15 from darcyclarke/develop

Added Example
  • Loading branch information...
2 parents bdc874c + 83b9c6c commit f479e9452cd85939834c9a516b8ae5e378472a23 @darcyclarke darcyclarke committed Mar 12, 2013
Showing with 204 additions and 6 deletions.
  1. +0 −1 .gitignore
  2. +38 −5 README.md
  3. +65 −0 example/bar.css
  4. +97 −0 example/foo.css
  5. +4 −0 tasks/DSS.js
View
@@ -1,5 +1,4 @@
/node_modules/
.DS_STORE
.DS_Store?
-/example/
/docs/
View
@@ -49,10 +49,7 @@ grunt.initConfig({
DSS: {
options: {
// Task-specific options go here.
- },
- your_target: {
- // Target-specific file lists and/or options go here.
- },
+ }
},
})
```
@@ -61,6 +58,42 @@ grunt.initConfig({
#### options.template
Type: `String`
-Default value: `default`
+Default value: `/template/`
A relative path to a `mustache` template to be used instead of the default
+
+#### options.output
+Type: `String`
+Default value: `/docs/`
+
+A relative path to a the directory you'd like to generate the documentation
+
+#### options.parsers
+Type: `Object`
+Default value: `{}`
+
+An object filled with key value pairs of functions to be used when parsing comment blocks. See the **example** below for more context about how to use these.
+
+
+### Exmaple initConfig
+
+```javascript
+grunt.initConfig({
+ DSS: {
+ options: {
+ location: __dirname + '/css/',
+ output: __dirname + '/api/'
+ parsers: {
+ // Finds @link in comment blocks
+ link: function(i, line, block){
+
+ // Replace link with HTML wrapped version
+ var exp = /(b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/ig;
+ line.replace(exp, "<a href='$1'>$1</a>");
+ return line;
+ }
+ }
+ }
+ }
+});
+````
View
@@ -0,0 +1,65 @@
+
+/**
+ * @name Button
+ * @description Your standard form button.
+ *
+ * @state :hover - Highlights when hovering.
+ * @state :disabled - Dims the button when disabled.
+ * @state .primary - Indicates button is the primary action.
+ * @state .smaller - A smaller button
+ *
+ * @version 3.1.0
+ * @link http://shapechanger.mycafecommerce.com/images/fc474a0165/cache/images/fc474a0165/site/products/proportion/ridiculously%20amazing%20day_w370_h352/ridiculously%20amazing%20day_09130255.jpg
+ *
+ * @markup
+ * <button>This is a button</button>
+ */
+
+button {
+ padding: 5px 15px;
+ line-height: normal;
+ font-family: "Helvetica Neue", Helvetica;
+ font-size: 12px;
+ font-weight: bold;
+ color: #666;
+ text-shadow: 0 1px rgba(255, 255, 255, 0.9);
+ border-radius: 3px;
+ border: 1px solid #ddd;
+ border-bottom-color: #bbb;
+ background: #f5f5f5;
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='$start', endColorstr='$end');
+ background: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e5e5e5));
+ background: -moz-linear-gradient(top, #f5f5f5, #e5e5e5);
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
+ cursor: pointer;
+}
+
+/**
+ * @name Anchor Tag
+ * @description Your standard link tag.
+ *
+ * @state :hover - Background changes when hovering.
+ * @state .active - Highlights link when active.
+ *
+ * @markup
+ * <a href="#">This is a link</a>
+ */
+a {
+ text-decoration: none;
+ color: red;
+ padding: 10px;
+ display: inline-block;
+ background: #efefef;
+ bored-radius: 5px;
+}
+
+ /** Hover */
+ a:hover {
+ background: #cccccc;
+ }
+
+ /** Active */
+ a:active,
+ a.active {
+ background: green;
+ }
View
@@ -0,0 +1,97 @@
+
+/**
+ * @name Button
+ * @description Your standard form button.
+ *
+ * @state :hover - Highlights when hovering.
+ * @state :disabled - Dims the button when disabled.
+ * @state .primary - Indicates button is the primary action.
+ * @state .smaller - A smaller button
+ *
+ * @markup
+ * <button>This is a button</button>
+ */
+
+button {
+ padding: 5px 15px;
+ line-height: normal;
+ font-family: "Helvetica Neue", Helvetica;
+ font-size: 12px;
+ font-weight: bold;
+ color: #666;
+ text-shadow: 0 1px rgba(255, 255, 255, 0.9);
+ border-radius: 3px;
+ border: 1px solid #ddd;
+ border-bottom-color: #bbb;
+ background: #f5f5f5;
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='$start', endColorstr='$end');
+ background: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e5e5e5));
+ background: -moz-linear-gradient(top, #f5f5f5, #e5e5e5);
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
+ cursor: pointer;
+}
+
+ /** Primary */
+ button.primary, button.primary:hover {
+ color: #fff;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
+ border-color: #74bb5a;
+ border-bottom-color: #509338;
+ background: #8add6d;
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='$start', endColorstr='$end');
+ background: -webkit-gradient(linear, left top, left bottom, from(#8add6d), to(#60b044));
+ background: -moz-linear-gradient(top, #8add6d, #60b044);
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
+ }
+
+ /** Smaller */
+ button.smaller {
+ font-size: 11px;
+ padding: 4px 7px;
+ }
+
+ /** Hover */
+ button:hover {
+ color: #337797;
+ background: #f0f7fa;
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='$start', endColorstr='$end');
+ background: -webkit-gradient(linear, left top, left bottom, from(#f0f7fa), to(#d8eaf2));
+ background: -moz-linear-gradient(top, #f0f7fa, #d8eaf2);
+ border-color: #cbe3ee;
+ border-bottom-color: #97c7dd;
+ }
+
+ /** Disabled */
+ button:disabled {
+ opacity: 0.5;
+ }
+
+/**
+ * @name Anchor Tag
+ * @description Your standard link tag.
+ *
+ * @state :hover - Background changes when hovering.
+ * @state .active - Highlights link when active.
+ *
+ * @markup
+ * <a href="#">This is a link</a>
+ */
+a {
+ text-decoration: none;
+ color: red;
+ padding: 10px;
+ display: inline-block;
+ background: #efefef;
+ bored-radius: 5px;
+}
+
+ /** Hover */
+ a:hover {
+ background: #cccccc;
+ }
+
+ /** Active */
+ a:active,
+ a.active {
+ background: green;
+ }
View
@@ -420,6 +420,10 @@ module.exports = function(grunt) {
};
});
+ // Describe custom parsers
+ for(key in options.parsers){
+ dss.parser(key, options.parsers[key]);
+ }
// Build Documentation
dss.build(options.location, options.template, options.output);

0 comments on commit f479e94

Please sign in to comment.