jsdoc-sourcecode-tag
What is this?
A JSDoc plugin that adds recognition to the @sourcecode tag for using his data in your publish theme.
It can be used for demonstration part of codes in <pre> element
More info about jsdoc and publish theme:
Installing
npm install --save jsdoc-sourcecode-tag# or using yarn cli yarn add jsdoc-sourcecode-tag ---
Usage
Add plugin to jsdoc conf.json http://usejsdoc.org/about-configuring-jsdoc.html
In your code
/** * description * @const * @param * @returns * @sourcecode */ const myFunction = { // some cool code here};
In your publish theme data you will get data.sourcecode
lineno
- where it's start in your codetype
- definition type, alias ofdata.meta.code.type
value
- string with your code, start fromconst myFun...
and to the end...};
.
tag value
+{number}
Add lines after ending of documented code
/** * Want to show const declaration * and same code part after that * @const * @sourcecode +4 */ const knockSeveralTimes = 10; // 1for let i = 1; i <= knockSeveralTimes; i++ // 2 console; // 3 // 4
|+{number}
It remove all lines of documented code and will start count from new line after
/** * @name nowYouSeeMyLoop * @sourcecode |+3 */for let i = 1; i <= knockSeveralTimes; i++ // 1 console; // 2 // 3
Tests
npm test
for testing js code style and test sorting methodnpm run fix
for automatically fix most of problems with js code style
Changelog
Please read CHANGELOG.md
To Do
write tests and more examples
Code of Conduct
Please read CODE_OF_CONDUCT.md
Contributing
Please read CONTRIBUTING.md