Skip to content

Commit

Permalink
feat(undocument): split to plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
h13i32maru committed Feb 19, 2017
1 parent 5699525 commit cc0dd1b
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 47 deletions.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -47,7 +47,8 @@
"babel-plugin-istanbul": "2.0.1",
"mocha": "2.5.3",
"esdoc-accessor-plugin": "latest",
"esdoc-external-ecmascript-plugin": "latest"
"esdoc-external-ecmascript-plugin": "latest",
"esdoc-undocumented-identifier-plugin": "latest"
},
"keywords": [
"jsdoc",
Expand Down
3 changes: 1 addition & 2 deletions src/ESDoc.js
Expand Up @@ -89,6 +89,7 @@ export default class ESDoc {

for (const tag of results) {
if (tag.export === false) tag.ignore = true;
if (tag.undocument === true) tag.ignore = true;
}

results = Plugin.onHandleTag(results);
Expand Down Expand Up @@ -149,8 +150,6 @@ export default class ESDoc {

if (!config.excludes) config.excludes = ['\\.config\\.(js|es6)$'];

if (!('undocumentIdentifier' in config)) config.undocumentIdentifier = true;

if (!config.index) config.index = './README.md';

if (!config.package) config.package = './package.json';
Expand Down
18 changes: 0 additions & 18 deletions src/Publisher/Builder/DocResolver.js
Expand Up @@ -25,9 +25,6 @@ export default class DocResolver {
console.log('resolve: necessary');
this._resolveNecessary();

console.log('resolve: undocument identifier');
this._resolveUndocumentIdentifier();

console.log('resolve: duplication');
this._resolveDuplication();

Expand Down Expand Up @@ -65,21 +62,6 @@ export default class DocResolver {
this._data.__RESOLVED_IGNORE__ = true;
}

/**
* resolve undocument identifier doc.
* doc is added ignore property that does not have document tag.
* @private
*/
_resolveUndocumentIdentifier() {
if (this._data.__RESOLVED_UNDOCUMENT_IDENTIFIER__) return;

if (!this._builder._config.undocumentIdentifier) {
this._builder._data({undocument: true}).update({ignore: true});
}

this._data.__RESOLVED_UNDOCUMENT_IDENTIFIER__ = true;
}

/**
* resolve description as markdown.
* @private
Expand Down
8 changes: 0 additions & 8 deletions test/fixture/config/esdoc-undocumentIdentifier.json

This file was deleted.

3 changes: 2 additions & 1 deletion test/fixture/package/esdoc.json
Expand Up @@ -7,7 +7,8 @@
"title": "ESDoc Test Fixture",
"plugins": [
{"name": "esdoc-external-ecmascript-plugin", "option": {"enable": true}},
{"name": "esdoc-accessor-plugin", "option": {"access": ["public", "protected", "private"], "autoPrivate": true}}
{"name": "esdoc-accessor-plugin", "option": {"access": ["public", "protected", "private"], "autoPrivate": true}},
{"name": "esdoc-undocumented-identifier-plugin"}
],
"test": {
"type": "mocha",
Expand Down
2 changes: 1 addition & 1 deletion test/fixture/package/plugin/MyPlugin1.js
Expand Up @@ -18,7 +18,7 @@ exports.onHandleConfig = function(ev) {

exports.onHandleCode = function(ev) {
callInfo.handlerNames.onHandleCode = ['MyPlugin1'];
ev.data.code = 'export default class MyClass_ModifiedCode {}';
ev.data.code = '/** this is class */ export default class MyClass_ModifiedCode {}';
};

exports.onHandleCodeParser = function(ev) {
Expand Down
16 changes: 0 additions & 16 deletions test/src/ConfigTest/UndocumentIdentifierTest.js

This file was deleted.

0 comments on commit cc0dd1b

Please sign in to comment.