Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
ink-docstrap
Advanced tools
[![NPM](https://nodei.co/npm/ink-docstrap.png?downloads=true)](https://nodei.co/npm/ink-docstrap/)
DocStrap is Bootstrap based template for JSDoc3. In addition, it includes all of the themes from Bootswatch giving you a great deal of look and feel options for your documentation, along with a simple search. Additionally, it adds some options to the conf.json file that gives you even more flexibility to tweak the template to your needs. It will also make your teeth whiter.
Here are examples of this template with the different Bootswatch themes:
To change your theme, just change it in the conf.json
file. See below for details.
If you manage your own version of jsdoc:
npm install ink-docstrap
When using grunt, please look at grunt-jsdoc which you can use with docstrap.
jsdoc -c path/to/conf.json -t ./node_modules/ink-docstrap/template -R README.md -r .
The -c
sets the config, and the docstrap README does talk about the options you can put in templates that docstrap is supposed to look for.
The -t
sets the template. This is the option you need to set to get the docstrap template to be used.
The -R
sets a markdown file to be the front page of the documentation.
The -r
tells jsdoc to run recursively.
The .
says from current directory.
DocStrap ships with a conf.json
file in the template/ directory. It is just a regular old
JSDoc configuration file, but with the following new options:
"templates": {
"systemName" : "{string}",
"footer" : "{string}",
"copyright" : "{string}",
"includeDate" : "{boolean}",
"navType" : "{vertical|inline}",
"theme" : "{theme}",
"linenums" : "{boolean}",
"collapseSymbols" : "{boolean}",
"inverseNav" : "{boolean}",
"outputSourceFiles" : "{boolean}" ,
"outputSourcePath" : "{boolean}",
"dateFormat" : "{string}",
"syntaxTheme" : "{string}",
"sort" : "{boolean|string}",
"search" : "{boolean}"
}
false
"inline"
. Otherwise set it to "vertical"
to make them regular stacked dropdowns.cerulean
cosmo
cyborg
flatly
journal
lumen
paper
readable
sandstone
simplex
slate
spacelab
superhero
united
yeti
true
all of the symbols in the page will roll their contents up so that you just get a list of symbols that can be expanded
and collapsed."analytics":{"ua":"UA-XXXXX-XXX", "domain":"XXXX"}
true
to
use the inverse header.outputSourceFiles
is false
, you may still want to name the file even without a link to the pretty printed output.
Set this to true
when outputSourceFiles
is false
. outputSourceFiles
when true
takes precedence over this setting."default"
. It can be any value supported
at sunlight themes which right now consists of...uh..."default"
and "dark"
,
but at least you have it if you need it."longname, version, since"
.The default language will be JavaScript, but there are a couple of ways to secify the language.
DocStrap support the language specified in the standard way e.g.
```html
<html></html>
DocStrap also introduces a new documentation tag which can appear inside any example block in source code,
or in any fenced code block in markdown: {@lang languageName}
, where
language
can be any of the languages supported by Sunlight
When in a doclet, add the tag just after the @example
tag like this:
@example {@lang xml}
<div>This is the most interesting web site ever</div>
These are the supported languages.
If you want a caption to your example, add it in a HTML caption before your example e.g.
@example <caption>my caption</caption>
{@lang xml}
<mycode></mycode>
No template can meet every need and customizing templates is a favorite pastime of....well, no-one, but you may need to anyway.
First make sure you have bower and grunt-cli installed.
Fetch the source using git
or grab the zip file from github. and unzip
it somewhere. Everything that follows happens in the unzip directory.
Next, prepare the environment:
bower install
and
npm install
When that is done, you have all of the tools to start modifying the template. The template, like Bootstrap, uses less.
The way it works is that ./styles/main.less
pulls in the bootstrap files uncompiled so that you have access to all of bootstraps mixins, colors,
etc, that you would want. There are two more files in that directory, variables.less
, bootswatch.less
. These are the
theme files and you can modify them, but keep in mind that if you apply a new theme (see below) those files will be overwritten. It is best
to keep your changes to the main.less
file.
To compile your changes to main.less
and any other files it loads up,
grunt less
The output is will be put in ./template/static/styles/site.<theme-name>.css
. The next time you create your documentation, it
will have the new css file included.
To apply a different template to the styles
directory to modify, open up the conf.json
in the template directory and
change the theme
option to the theme you want. Then
grunt apply
And the new theme will be in variables.less
, bootswatch.less
. Don't forget to compile your changes using grunt apply
to
get that change into the template.
NOTE that these steps are not necessary to just change the theme, this is only to modify the theme. If all you want to do is change the theme, just update conf.json with the new theme and build your docs!
Yes! Contribute! Test! Share your ideas! Report Bugs!
Huge thanks to all contributors. If your name should be here, but isn't, please let us know
includeTags
section.Major update__. Amazing help from tswaters to solve a bunch of little problems and a to bring the codebase up to Bootstrap3. Make sure you are running the latest version of JSDoc before using this build.
Again huge, huge thanks to tswaters. Make sure you send him thanks or a tip!!!!!
Initial release
If you like DocStrap, be sure and check out these excellent projects and support them!
JSDoc3 is licensed under the Apache License
DocStrap is licensed under the MIT license.
DocStrap Copyright (c) 2012-2015 Terry Weiss & Contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
[![NPM](https://nodei.co/npm/ink-docstrap.png?downloads=true)](https://nodei.co/npm/ink-docstrap/)
The npm package ink-docstrap receives a total of 18,533 weekly downloads. As such, ink-docstrap popularity was classified as popular.
We found that ink-docstrap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.