mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Cleanup npm link creation.
This commit is contained in:
@@ -23,28 +23,40 @@ var config = {
|
|||||||
},
|
},
|
||||||
'github': {
|
'github': {
|
||||||
'style': 'github',
|
'style': 'github',
|
||||||
'sublinks': [
|
'sublinks': [npmLink('Ⓝ', 'See the npm package')]
|
||||||
'<% if (name == "templateSettings" || !/^(?:methods|properties|seq)$/i.test(category)) {' +
|
|
||||||
'print("[Ⓝ](https://www.npmjs.com/package/lodash." + name.toLowerCase() + " \\"See the npm package\\")")' +
|
|
||||||
'} %>'
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
'site': {
|
'site': {
|
||||||
'entryLink': '<a href="${entryHref}" class="fa fa-link"></a>',
|
'entryLink': '<a href="${entryHref}" class="fa fa-link"></a>',
|
||||||
'sourceLink': '[source](${sourceHref})',
|
'sourceLink': '[source](${sourceHref})',
|
||||||
'tocHref': '',
|
'tocHref': '',
|
||||||
'tocLink': '',
|
'tocLink': '',
|
||||||
'sublinks': [
|
'sublinks': [npmLink('npm package')]
|
||||||
'<% if (name == "templateSettings" || !/^(?:methods|properties|seq)$/i.test(category)) {' +
|
|
||||||
'print("[npm package](https://www.npmjs.com/package/lodash." + name.toLowerCase() + ")")' +
|
|
||||||
'} %>'
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Composes a npm link from `text` and optional `title`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} text The link text.
|
||||||
|
* @param {string} [title] The link title.
|
||||||
|
* @returns {string} Returns the composed npm link.
|
||||||
|
*/
|
||||||
|
function npmLink(text, title) {
|
||||||
|
return (
|
||||||
|
'<% if (name == "templateSettings" || !/^(?:methods|properties|seq)$/i.test(category)) {' +
|
||||||
|
'print(' +
|
||||||
|
'"[' + text + '](https://www.npmjs.com/package/lodash." + name.toLowerCase() + ' +
|
||||||
|
'"' + (title == null ? '' : ' \\"' + title + '\\"') + ')"' +
|
||||||
|
');' +
|
||||||
|
'} %>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post-process `markdown` to make adjustments.
|
* Post-process `markdown` to make adjustments.
|
||||||
*
|
*
|
||||||
|
* @private
|
||||||
* @param {string} markdown The markdown to process.
|
* @param {string} markdown The markdown to process.
|
||||||
* @returns {string} Returns the processed markdown.
|
* @returns {string} Returns the processed markdown.
|
||||||
*/
|
*/
|
||||||
@@ -58,6 +70,7 @@ function postprocess(markdown) {
|
|||||||
/**
|
/**
|
||||||
* Creates the documentation markdown formatted for 'github' or 'site'.
|
* Creates the documentation markdown formatted for 'github' or 'site'.
|
||||||
*
|
*
|
||||||
|
* @private
|
||||||
* @param {string} type The format type.
|
* @param {string} type The format type.
|
||||||
*/
|
*/
|
||||||
function build(type) {
|
function build(type) {
|
||||||
|
|||||||
Reference in New Issue
Block a user