Comparing version 0.2.1 to 0.3.0
@@ -5,3 +5,3 @@ { | ||
"author": "Hugo Giraudel", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -15,2 +15,4 @@ # SassDoc | ||
// --- | ||
// @requires dependency-function | ||
// --- | ||
// @param {*} $parameter-name - description of the parameter | ||
@@ -20,3 +22,5 @@ // @param {String} $other-parameter (default) - parameter with a default value | ||
// --- | ||
// @return {String | null} description of the returned value | ||
// @throws `$other-parameter` must be a string. | ||
// --- | ||
// @return {String | Null} description of the returned value | ||
@@ -56,3 +60,3 @@ @function dummy-function($parameter-name, $other-parameter: 'default', $args...) { | ||
### [WIP] Node API | ||
### Node API | ||
@@ -67,2 +71,35 @@ ```js | ||
Yielding a result like this: | ||
```js | ||
[ | ||
{ | ||
'parameters': [ | ||
{ 'type': '*', 'name': 'parameter-name', 'default': undefined, 'description': 'description of the parameter' }, | ||
{ 'type': 'String', 'name': 'other-parameter', 'default': 'default', 'description': 'parameter with a default value' }, | ||
{ 'type': 'ArgList', 'name': 'args', 'default': undefined, 'description': 'extra parameters' } | ||
], | ||
'throws': ['`$other-parameter` must be a string.'], | ||
'todos': [], | ||
'alias': false, | ||
'aliased': 'other-function', | ||
'links': [], | ||
'requires': ['dependency-function'], | ||
'description': 'Function description\n... on several lines if you will', | ||
'access': 'private', | ||
'deprecated': false, | ||
'author': false, | ||
'returns': { | ||
'type': ['String', 'Null'], | ||
'description': 'description of the returned value' | ||
}, | ||
'type': 'function', | ||
'name': 'dummy-function' | ||
} | ||
/*, | ||
... other documented mixins/functions. | ||
*/ | ||
] | ||
``` | ||
## API Documentation | ||
@@ -169,2 +206,10 @@ | ||
### @since | ||
Describes the version at which the documented function/mixin has been implemented. | ||
```scss | ||
// @since 4.2 | ||
``` | ||
### @throws (synonym: @exception) | ||
@@ -171,0 +216,0 @@ |
@@ -117,3 +117,3 @@ var fs = require('fs'); | ||
}, function (err) { | ||
console.log(err); | ||
console.error(err); | ||
}); | ||
@@ -120,0 +120,0 @@ } |
var utils = require('./utils'); | ||
exports = module.exports = { | ||
enabled: false, | ||
enabled: false, | ||
@@ -6,0 +6,0 @@ /** |
@@ -50,2 +50,3 @@ var regex = require('./regex'); | ||
'description': '', | ||
'since': false, | ||
'access': 'public', | ||
@@ -124,3 +125,3 @@ 'deprecated': false, | ||
res = { array: false }, | ||
tokens = ['returns', 'parameters', 'deprecated', 'author', 'access', 'throws', 'todo', 'alias', 'link', 'requires']; | ||
tokens = ['returns', 'parameters', 'deprecated', 'author', 'access', 'throws', 'todo', 'alias', 'link', 'requires', 'since']; | ||
@@ -162,2 +163,3 @@ // Useless line, skip | ||
case 'alias': | ||
case 'since': | ||
res.value = value[1]; | ||
@@ -164,0 +166,0 @@ break; |
@@ -126,2 +126,11 @@ var types = "(?:null|\\*|number|color|string|list|map|bool|arglist)"; | ||
/** | ||
* Checks whether the line is a since | ||
* @param {string} line - line to check | ||
* @return {Boolean} | ||
*/ | ||
isSince: function (line) { | ||
return line.match(/^@since\s+(.+)/i); | ||
}, | ||
/** | ||
* Checks whether the line is a link | ||
@@ -128,0 +137,0 @@ * @param {string} line - line to check |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
161050
1083
228