Skip to content

Commit

Permalink
Merge pull request #6 from daniellmb/pr/5
Browse files Browse the repository at this point in the history
added doc task to gulp
  • Loading branch information
daniellmb committed Apr 28, 2015
2 parents 3661861 + f2aed90 commit 6c14475
Show file tree
Hide file tree
Showing 5 changed files with 5,217 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ bower_components/
# generated files #
######################
coverage/
docs/
.idea/
.DS_Store
.DS_Store?
Expand All @@ -15,4 +16,4 @@ coverage/
Icon?
ehthumbs.db
Thumbs.db
.tmp
.tmp
32 changes: 24 additions & 8 deletions console.style.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
* @author Daniel Lamb <dlamb.open.source@gmail.com>
*/
(function(console) {
/**
* @namespace console
*/

/**
* @namespace consoleStyle
*/

/* istanbul ignore if */
if (!console || !console.log) {
Expand All @@ -20,9 +27,11 @@
var wrap;

/**
* Regex mojo to parse the text to log in the console
* @param text - the text with styles to parse
* @returns an array of console.log arguments
* Regex mojo to parse the text to log in the console.
* @function parse
* @memberOf consoleStyle
* @param {string} text - the text with styles to parse
* @returns {Array} args - an array of console.log arguments
*/
var parse = function(text) {
var args = [text];
Expand Down Expand Up @@ -79,7 +88,10 @@
};

/**
* Define color shortcut methods on the console
* Define color shortcut methods on the console.
* @function colors
* @memberOf console
* @param {string} color - the CSS color rule to apply
* @example console.style('Wow, this is ' + console.colors.green('so much') + ' better!');
*/
console.colors = {};
Expand All @@ -94,6 +106,8 @@

/**
* Intuitively Style Browser Console Text with CSS.
* @function style
* @memberOf console
* @param text - the text to style
* @example console.style('Wow, this is <css="color:green;font-weight:bold;">so much</css> better!');
*/
Expand All @@ -103,10 +117,12 @@
};

/**
* Wraps the given text in a <css> tag with the provided style rules
* @param text - the text to wrap
* @param rule - CSS rules to apply
* @returns {string} the wrapped text
* Wraps the given text in a <css> tag with the provided style rules.
* @function wrap
* @memberOf console
* @param {string} text - the text to wrap
* @param {string} rule - CSS rules to apply
* @returns {string} - the wrapped text
* @example console.style('I just ' + console.style.wrap('love', 'color:#c00;font-weight:bold;') + ' console.style');
*/
console.style.wrap = wrap = function(text, rules) {
Expand Down
9 changes: 7 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var gulp = require('gulp'),
rename = require('gulp-rename'),
replace = require('gulp-replace'),
karma = require('gulp-karma'),
jsdoc = require('gulp-jsdoc'),
fs = require('fs'),
source = 'console.style.js',
sourceMin = 'console.style.min.js',
Expand Down Expand Up @@ -57,7 +58,6 @@ gulp.task('min', function () {
.pipe(gulp.dest('.'));
});


gulp.task('test-min', ['min'], function () {
return gulp.src([sourceMin, specs])
.pipe(karma({
Expand All @@ -66,4 +66,9 @@ gulp.task('test-min', ['min'], function () {
}));
});

gulp.task('default', ['lint', 'gpa', 'test', 'test-min']);
gulp.task('docs', function () {
return gulp.src(source)
.pipe(jsdoc('./docs'));
});

gulp.task('default', ['lint', 'gpa', 'test', 'test-min', 'docs']);

0 comments on commit 6c14475

Please sign in to comment.