
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
grunt-processdocstrapdocs
Advanced tools
Post-process generated JSDoc documentation based on docstrap templates.
Post-process generated JSDoc documentation based on docstrap templates.
Some issues with the generated templates are:
There are may relative URLs in the generated documation CSS and HTML
files, such as all CSS files starting with an
@import url('//fonts.googleapis.com/...')
import statement, which
results in a relative path to the URL. That means when docs are loaded
locally, the resulting absolute path uses a file://
protocol, which
means the fonts fail to load -- which, depending on the system, can take
a really long time (to resolve an invalid URL) and be really annoying
when navigating the documentation.
This is specifically logged as https://github.com/terryweiss/docstrap/issues/26
This issue is fixed by converting all URLs to absolute paths, as configured.
The templates use the navbar-fixed-top
style to keep the top toolbar
visible while scrolling vertically, but when clicking on an inline link
(e.g. a method for the class being viewed), the page scrolls to the right
location but the method's name and signature end-up hidden behind the
fixed top navbar/toolbar.
In reality, this issue could/should be handled by customizing your template, but in my case, that seemed like a lot of work when this quick post-processing would do the trick. This option is disabled by default.
This issue is fixed by removing the navbar-fixed-top
style from the top
navbar.
Note: Later releases of built-in JSDoc templates have addressed this issue so setting this option is no longer necessary (at least as of JSDoc 3.3.2 or even earlier).
Note: For this task, each source is also a destination. Destinations are ignored (i.e. modifiations will be made to each source directory specified).
Big thanks to Terry Weiss (and contributors) for really nice JSDoc templates at https://github.com/terryweiss/docstrap!
npm install grunt-processdocstrapdocs --save-dev
//// gruntfile.js:
grunt.initConfig({
jsdoc: {
// your existing configuration
},
processdocstrapdocs: {
options: {
fixProtocol: true,
protocol: 'http',
fixTopNavbar: true
},
dist: {
src: 'docs'
}
}
});
grunt.registerTrask('docs', ['jsdoc', 'processdocstrapdocs']);
//// command line:
$ grunt docs
Note that the processdocstrapdocs
task must depend on the jsdoc
task, that
your jsdoc
task is expected to be configured to use one of the provided
ink-docstrap templates.
{(String|Array.<String>)} src
(required)
The directory (String
), or list of directories (Array.<String>
), that contain
generated JSDoc documentation based on an
ink-docstrap template.
{Boolean} [fixProtocol=true]
(optional, default: true
)
Fix the relative protocols, changing them all to use the value of the
protocol
option.
{String} [protocol='http']
(optional, default: 'http'
)
Protocol to use when fixing relative protocols with fixProtocol
enabled.
{Boolean} [fixTopNavbar=false]
(optional, default: false
)
Fix the top navbar issue by letting it scroll with content.
This option is false
by default since this really should be handled by
customizing your template and the latest version of JSDoc (3.3.2 at this time)
has fixed the issue in their built-in templates.
FAQs
Post-process generated JSDoc documentation based on docstrap templates.
The npm package grunt-processdocstrapdocs receives a total of 1 weekly downloads. As such, grunt-processdocstrapdocs popularity was classified as not popular.
We found that grunt-processdocstrapdocs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.