Skip to content

Commit bd68856

Browse files
Merge pull request #740 from nielsonm/issue/481-jsdoc-annotations-exporter
Issue/481 jsdoc annotations exporter
2 parents 9b8bf2e + 762b03c commit bd68856

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

core/lib/annotation_exporter.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ const annotations_exporter = function (pl) {
1111
const paths = pl.config.paths;
1212
let oldAnnotations;
1313

14-
/*
15-
Returns the array of comments that used to be wrapped in raw JS.
14+
/**
15+
* Parses JS annotations.
16+
* @returns array of comments that used to be wrapped in raw JS
1617
*/
1718
function parseAnnotationsJS() {
1819
//attempt to read the file
@@ -36,6 +37,12 @@ const annotations_exporter = function (pl) {
3637
return oldAnnotationsJSON.comments;
3738
}
3839

40+
/**
41+
* Build the annotation markdown.
42+
* @param annotationsYAML
43+
* @param markdown_parser
44+
* @returns annotation
45+
*/
3946
function buildAnnotationMD(annotationsYAML, markdown_parser) {
4047
const annotation = {};
4148
const markdownObj = markdown_parser.parse(annotationsYAML);
@@ -46,6 +53,11 @@ const annotations_exporter = function (pl) {
4653
return annotation;
4754
}
4855

56+
/**
57+
* Parse markdown file annotations.
58+
* @param annotations
59+
* @param parser
60+
*/
4961
function parseMDFile(annotations, parser) {
5062
//let annotations = annotations;
5163
const markdown_parser = parser;
@@ -63,8 +75,10 @@ const annotations_exporter = function (pl) {
6375
};
6476
}
6577

66-
/*
67-
Converts the *.md file yaml list into an array of annotations
78+
/**
79+
* Converts the *.md file yaml list into an array of annotations
80+
*
81+
* @returns annotations
6882
*/
6983
function parseAnnotationsMD() {
7084
const markdown_parser = new mp();
@@ -75,6 +89,11 @@ const annotations_exporter = function (pl) {
7589
return annotations;
7690
}
7791

92+
/**
93+
* Gathers JS & MD annotations.
94+
*
95+
* @returns array of annotations
96+
*/
7897
function gatherAnnotations() {
7998
const annotationsJS = parseAnnotationsJS();
8099
const annotationsMD = parseAnnotationsMD();

0 commit comments

Comments
 (0)