Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Filterbytag #91

Merged
merged 6 commits into from Nov 22, 2019
Merged

Filterbytag #91

merged 6 commits into from Nov 22, 2019

Conversation

omaretna
Copy link
Contributor

@omaretna omaretna commented Nov 4, 2019

add possibility to filter documentation by tag and custom tag.

exemple: apidoc --filter-by apigroup=MyGroup

@NicolasCARPi
Copy link
Collaborator

Hello,

Thank you for your contributions! I'll try and test that asap!

@omaretna
Copy link
Contributor Author

omaretna commented Nov 4, 2019

Hello @NicolasCARPi,
Supper thanks.
Related to apidoc/apidoc#810

Copy link
Collaborator

@NicolasCARPi NicolasCARPi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add simple comments to your code to tell why you are doing things? What is the purpose of variables for instance, and what a block of code is supposed to achieve.

Also, I see you use const and let instead of var`, which is inconsistent with the rest of the codebase. But it's alright, it's fine to use it in 2019 and slowly the codebase should evolve towards it. :)

lib/parser.js Outdated
@@ -426,10 +435,24 @@ Parser.prototype._findBlockWithApiGetIndex = function(blocks) {
found = false;
break;
}
// if (filterTag && blocks[i][j].name.substr(0, 10) === filterTag && blocks[i][j].content !== valueTofilter) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove commented out code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@omaretna
Copy link
Contributor Author

Can you also add simple comments to your code to tell why you are doing things? What is the purpose of variables for instance, and what a block of code is supposed to achieve.

Also, I see you use const and let instead of var`, which is inconsistent with the rest of the codebase. But it's alright, it's fine to use it in 2019 and slowly the codebase should evolve towards it. :)

I used const and let but i change it to var to be consistent with the rest.
I add some comment i hope is fine.

lib/parser.js Outdated
@@ -49,6 +50,12 @@ function Parser(_app) {
self.addParser(parser, require(filename));
}
});

// check app.options.filterBy and define the tag to filer by
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

lib/parser.js Outdated
if (blocks[i][j].name.substr(0, 3) === 'api')
found = true;
}

// add block if it's apidefine or the tag is equale to the value defined in options.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"equal" and no dot at the end please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

lib/parser.js Outdated
@@ -427,9 +438,26 @@ Parser.prototype._findBlockWithApiGetIndex = function(blocks) {
break;
}

// check if the user want to filter by some specifique tag
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"wants" and "specific" (are you french? :p)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hh yes :p

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@NicolasCARPi
Copy link
Collaborator

ok thanks I just need to test it and I'll merge!

@omaretna
Copy link
Contributor Author

omaretna commented Nov 21, 2019

ok thanks I just need to test it and I'll merge!

Super thanks :)

@NicolasCARPi NicolasCARPi merged commit 6fd0191 into apidoc:dev Nov 22, 2019
@NicolasCARPi
Copy link
Collaborator

Merged! Thanks again for your contribution. This repository is in need of contributors, so don't hesitate if you feel you can tackle other issues ;)

~Nico

NicolasCARPi pushed a commit to apidoc/apidoc that referenced this pull request Nov 22, 2019
@omaretna
Copy link
Contributor Author

i will try thanks :)

@omaretna omaretna deleted the filterbytag branch January 11, 2020 17:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants