8000 Ability to exclude symbols/namespaces by regex match · Issue #16 · hdoc/hdoc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Ability to exclude symbols/namespaces by regex match #16

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

Open
jtbandes opened this issue Jul 22, 2022 · 5 comments
Open

Ability to exclude symbols/namespaces by regex match #16

jtbandes opened this issue Jul 22, 2022 · 5 comments

Comments

@jtbandes
Copy link

Feature request: I would like to be able to exclude certain symbols, or symbols under certain namespaces, from the documentation and search index.

This is one of the only remaining things I have to maintain in a patch: https://github.com/foxglove/mcap/blob/a85bd00295255b134f3083efbc5d2274294a83df/cpp/hdoc.patch

It would be great to specify an exclusion pattern in the config file, preferably using regular expressions for maximum flexibility. As an example:

[ignore]
ignore_records = "^(.*::)?internal::.*$"
ignore_functions = "^(.*::)?internal::.*$"
@hdoc
Copy link
Owner
hdoc commented Jul 23, 2022

We will look at adding this. One potential problem with this feature is that regexes are computationally expensive and checking if every symbol matches a regex is likely going to add a noticeable performance hit. Would just a simple substring match work well enough for your usecase? It's not as flexible, but it carries significantly lower computational costs.

Thank you for supplying the configuration file example, that is a concise way of adding that option to the file, and if we adopt this feature we will likely use the same/similar syntax. Naming things is hard and your example makes it way easier :)

@jtbandes
Copy link
Author

Substring matching would probably be fine, I just think that eventually it becomes a limitation for some edge case. My intuition would be that regular expressions would be plenty fast (unless someone tries to intentionally construct a slow one) even on a large project like LLVM — slow to compile, maybe, but fast to execute once compiled. Haven’t tried it though!

@hdoc
Copy link
Owner
hdoc commented Jul 23, 2022

We'll do some testing interally to determine the performance impact. Sadly the C++ regex library has a reputation for being very slow so I'm hoping it doesn't nuke performance.

@Viatorus
Copy link
Viatorus commented Sep 30, 2022

I think, like the example above, regex wouldn't be needed.

Mostly you want to exclude a specific namespaces (detail/internal) or maybe annotate the code section to be explicit excluded (@Private in doxygen).

But I am also looking forward this feature!

@danakj
Copy link
danakj commented Nov 2, 2022

I was going to request an annotation to omit a given thing from documentation, I'd be happy with doing this in the code itself, kinda like https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html but in a comment rather than an attribute.

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

4 participants
0