Comparing version 0.6.1 to 0.7.0
@@ -19,5 +19,5 @@ /*! | ||
* @param {string} options.url The source URL. | ||
* @param {string} [options.hash='default'] The hash style for links ('default' or 'github'). | ||
* @param {string} [options.lang='js'] The language indicator for code blocks. | ||
* @param {boolean} [options.sort=true] Specify wether entries are sorted. | ||
* @param {boolean} [options.sort=true] Specify whether entries are sorted. | ||
* @param {string} [options.style='default'] The hash style for links ('default' or 'github'). | ||
* @param {string} [options.title='<%= basename(options.path) %> API documentation'] The documentation title. | ||
@@ -29,5 +29,5 @@ * @param {string} [options.toc='properties'] The table of contents organization style ('categories' or 'properties'). | ||
options = _.defaults(options, { | ||
'hash': 'default', | ||
'lang': 'js', | ||
'sort': true, | ||
'style': 'default', | ||
'title': path.basename(options.path) + ' API documentation', | ||
@@ -34,0 +34,0 @@ 'toc': 'properties' |
@@ -100,5 +100,5 @@ 'use strict'; | ||
entries = getEntries(source), | ||
hashStyle = options.hash, | ||
organized = {}, | ||
sortEntries = options.sort, | ||
style = options.style, | ||
url = options.url; | ||
@@ -161,4 +161,4 @@ | ||
'entryHref': '#${hash}', | ||
'entryLink': _.get(options, 'entryLink', '[#](${entryHref})'), | ||
'hash': entry.getHash(hashStyle), | ||
'entryLink': _.get(options, 'entryLink', style == 'github' ? '' : '<a href="${entryHref}">#</a> '), | ||
'hash': entry.getHash(style), | ||
'member': member, | ||
@@ -182,11 +182,15 @@ 'name': name, | ||
entryMarkdown.push(interpolate( | ||
'### <a id="${hash}"></a>`${member}${separator}${call}`\n' + | ||
_([ | ||
'${entryLink} ${sourceLink}', | ||
_.get(options, 'entryLinks', []), | ||
'${tocLink}' | ||
]) | ||
.flatten() | ||
.compact() | ||
.join(' '), | ||
'<h3 id="${hash}">${entryLink}<code>${member}${separator}${call}</code></h3>\n' + | ||
interpolate( | ||
_([ | ||
'${sourceLink}', | ||
_.get(options, 'sublinks', []), | ||
'${tocLink}' | ||
]) | ||
.flatten() | ||
.compact() | ||
.join(' '), | ||
entryData | ||
) | ||
.replace(/ {2,}/g, ' '), | ||
entryData | ||
@@ -317,3 +321,3 @@ )); | ||
tocMarkdown.push( | ||
'* <a href="#' + owner.getHash(hashStyle) + '" class="alias">`' + | ||
'* <a href="#' + owner.getHash(style) + '" class="alias">`' + | ||
title + '` -> `' + owner.getName() + '`' + | ||
@@ -327,3 +331,3 @@ '</a>' | ||
makeAnchor( | ||
'#' + entry.getHash(hashStyle), | ||
'#' + entry.getHash(style), | ||
'`' + title + '`' | ||
@@ -361,8 +365,6 @@ ) | ||
// Add link back to the top of the TOC. | ||
docMarkdown.push( | ||
' [1]: ' + | ||
_.get(options, 'tocHref', '#' + _.get(tocGroups, 0, '').toLowerCase()) + | ||
' "Jump back to the TOC."\n' | ||
); | ||
var tocHref = _.get(options, 'tocHref', '#' + _.get(tocGroups, 0, '').toLowerCase()); | ||
if (tocHref) { | ||
docMarkdown.push(' [1]: ' + tocHref + ' "Jump back to the TOC."\n'); | ||
} | ||
return docMarkdown.join('\n'); | ||
@@ -369,0 +371,0 @@ } |
{ | ||
"name": "docdown", | ||
"version": "0.6.1", | ||
"version": "0.7.0", | ||
"description": "A simple JSDoc to Markdown documentation generator.", | ||
@@ -18,6 +18,6 @@ "license": "MIT", | ||
"doctrine": "^1.2.2", | ||
"lodash": "^4.13.1" | ||
"lodash": "^4.14.1" | ||
}, | ||
"scripts": { | ||
"doc": "node bin/docdown index.js doc/README.md url=\"https://github.com/jdalton/docdown/blob/${npm_package_version}/index.js\" title=\"docdown <sup>v${npm_package_version}</sup>\" hash='github'", | ||
"doc": "node bin/docdown index.js doc/README.md url=\"https://github.com/jdalton/docdown/blob/${npm_package_version}/index.js\" style='github' title=\"docdown <sup>v${npm_package_version}</sup>\"", | ||
"test": "true" | ||
@@ -24,0 +24,0 @@ }, |
@@ -1,2 +0,2 @@ | ||
# docdown v0.6.1 | ||
# docdown v0.7.0 | ||
@@ -3,0 +3,0 @@ A simple JSDoc to Markdown documentation generator. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38738
1180
Updatedlodash@^4.14.1