Browse Source

Grunt: Adds docco generation of spec files to grunt build

Former-commit-id: 3318bfe9d6
Former-commit-id: 9fccf484b1
pull/258/head
jlukic 11 years ago
parent
commit
bc0386c63f
3 changed files with 28 additions and 39 deletions
  1. 38
      node/Gruntfile.js
  2. 26
      spec/assets/docco.css
  3. 3
      spec/module.commented.js

38
node/Gruntfile.js

@ -57,6 +57,9 @@ module.exports = function(grunt) {
// creates custom license in header
'cssmin:addBanner',
// generate code docs
'docco:generate',
// creates release zip
'compress:everything',
@ -110,6 +113,24 @@ module.exports = function(grunt) {
}
},
docco: {
generate: {
options: {
css : '../spec/assets/docco.css',
output : '../spec/docs/'
},
files: [
{
expand : true,
cwd : '../spec/',
src : [
'**.commented.js'
]
}
]
}
},
less: {
options: {
compress : false,
@ -226,21 +247,6 @@ module.exports = function(grunt) {
},
// generate documented source code
docco: {
generate: {
expand : true,
cwd : '../spec',
src : [
'**/*.commented.js'
],
options: {
css: '',
output: 'src/files/generated/'
}
}
},
compress: {
options: {
@ -371,7 +377,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-docco');
grunt.loadNpmTasks('grunt-docco-multi');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.initConfig(config);

26
spec/assets/docco.css

@ -1,29 +1,9 @@
/*--------------------- Typography ----------------------------*/
@font-face {
font-family: 'Neutraface';
src:
url("../fonts/neutraface-book.otf") format('opentype')
;
font-weight: normal;
font-style: normal;
font-size-adjust: 0.448;
}
@font-face {
font-family: 'Neutraface';
src:
url("../fonts/neutraface-bold.otf") format('opentype')
;
font-weight: bold;
font-style: normal;
font-size-adjust: 0.448;
}
@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Open+Sans:300italic,400,300,700);
/*--------------------- Layout ----------------------------*/
html { height: 100%; }
body {
font-family: "Neutraface", "Helvetica Neue", "Arial", sans-serif;
font-family: "Open Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
font-size: 14px;
line-height: 18px;
color: #30404f;
@ -46,7 +26,7 @@ p, ul, ol {
h1, h2, h3, h4, h5, h6 {
color: #112233;
font-family: "Neutraface", "Helvetica Neue", "Arial", sans-serif;
font-family: "Source Sans Pro", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
line-height: 1em;
text-transform: none;
margin: 30px 0 15px 0;

3
spec/module.commented.js

@ -340,6 +340,9 @@ $.fn.example = function(parameters) {
else if(found !== undefined) {
response = found;
}
// ### Invocation response
// If a user passes in multiple elements invoke will be called for each element and the value will be returned in an array
// For example ``$('.things').example('has text')`` with two elements might return ``[true, false]`` and for one element ``true``
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}

Loading…
Cancel
Save