Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide Private Members? #5

Closed
jm4games opened this issue Oct 29, 2021 · 11 comments
Closed

Hide Private Members? #5

jm4games opened this issue Oct 29, 2021 · 11 comments

Comments

@jm4games
Copy link

Is there a way we could prevent including private members with documentation? They kind of clutter the docs generated with members that developers can't even use.

@hdoc
Copy link
Owner

hdoc commented Oct 29, 2021

Currently there is no way to hide private members in the generated docs. This is something we've considered adding but we also want to keep configuration options and complexity to a minimum.

Perhaps we could add a new option that shows private members by default and has the option to hide them. Something like show_private_members = false in .hdoc.toml. How does this sound?

@jm4games
Copy link
Author

That would actually be fine.

@hdoc
Copy link
Owner

hdoc commented Nov 2, 2021

We will look to add this in the next release, but we can't promise anything yet. If you work at a company that needs this feature, please reach out to us at contact@hdoc.io and we can prioritize this. Thank you.

@hdoc hdoc closed this as completed Nov 2, 2021
@jtbandes
Copy link

In case anyone else ends up here looking for a solution — I found it was pretty simple to do a basic implementation of "hide private members", just two places need to be modified:

https://github.com/foxglove/mcap/blob/626bb50f2a094d3eea0829dfb5308816304e6903/cpp/hdoc.patch#L66-L84

This doesn't exclude private members from the search index, which would probably be a more correct solution, but this quick hack worked out alright!

@hdoc
Copy link
Owner

hdoc commented Mar 25, 2022

Looks like it's time to upstream a solution to this issue, given that people are out there patching hdoc to solve it. Look for this in the next release.

@hdoc
Copy link
Owner

hdoc commented May 26, 2022

@jm4games @jtbandes there's now a fix for this in the mainline with the latest version 1.2.3. Check out the release notes for more details. I have also credited both of you in the release notes. Thank you!

@jm4games
Copy link
Author

Thanks a lot, much appreciated!!

@jtbandes
Copy link

jtbandes commented Jun 6, 2022

Thanks for the update. I just tried this out, but it is failing with:

terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at

https://github.com/foxglove/mcap/runs/6764834723?check_suite_focus=true

You can reproduce the error by running cd cpp && make ci-docs on this branch: foxglove/mcap#408

@hdoc hdoc reopened this Jun 7, 2022
@hdoc
Copy link
Owner

hdoc commented Jun 7, 2022

Thank you for reporting the issue and providing repro docs. Looks like something slipped by our internal CI. We’ll take a look and get a fix out ASAP.

@hdoc
Copy link
Owner

hdoc commented Jun 7, 2022

@jtbandes this issue should be fixed in version 1.2.4, which was just released. It was a logic bug, and there are now unit tests to cover this functionality. You are credited in the release notes. Thank you for your help!

@hdoc hdoc closed this as completed Jun 7, 2022
jtbandes added a commit to foxglove/mcap that referenced this issue Jun 7, 2022
**Public-Facing Changes**
None

**Description**
Use new `ignore_private_members` feature from hdoc/hdoc#5 (comment)
@jtbandes
Copy link

jtbandes commented Jun 7, 2022

Thanks, that's working now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants