sassdoc-filter
Advanced tools
Comparing version 1.2.0-rc.1 to 1.2.0-rc.2
38
index.js
@@ -5,2 +5,3 @@ 'use strict'; | ||
var indexer = require('sassdoc-indexer'); | ||
var path = require('path'); | ||
@@ -135,2 +136,39 @@ module.exports = { | ||
}, | ||
/** | ||
* Figure out a shortcut icon, and whether it is external or a local | ||
* file to copy. | ||
* | ||
* You can specify a local or external URL in `ctx.view.shortcutIcon`. | ||
* | ||
* For a local file, it will be relative to `ctx.dir`. | ||
* | ||
* A `ctx.shortcutIcon` property is then created and will look like | ||
* this: | ||
* | ||
* { | ||
* "type": "external|internal", | ||
* "url": "external URL or file base name", | ||
* "path": "only for internal, file absolute path" | ||
* } | ||
*/ | ||
shortcutIcon: function (ctx) { | ||
var icon = ctx.view.shortcutIcon; | ||
if (!icon) { | ||
return; | ||
} | ||
if (/^([a-z]+:)?\/\//.test(icon)) { | ||
// External URL | ||
ctx.shortcutIcon = {type: 'external', url: icon}; | ||
return; | ||
} | ||
ctx.shortcutIcon = { | ||
type: 'internal', | ||
url: path.basename(icon), | ||
path: path.resolve(ctx.dir, icon), | ||
}; | ||
}, | ||
}; |
{ | ||
"name": "sassdoc-filter", | ||
"version": "1.2.0-rc.1", | ||
"version": "1.2.0-rc.2", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
6326
144