markvincze / sabledocs

Simple static documentation generator for Protobuf and gRPC contracts.
MIT License
54 stars 12 forks source link

Add config flags to exclude lines from comments #11

Closed hedtke closed 1 year ago

hedtke commented 1 year ago

We use @exclude to mark the point from which on the documentation should not be public.

We use the buf linter and do not want to show the linting commands in the public doc.

markvincze commented 1 year ago

Hi @hedtke,

Thanks for the submission, looks good! And thanks for the patience. Could you include the two new fields including their description also in the config example in README.md? And can you also bump the version number in pyproject.toml to 0.6, and add a new entry to CHANGELOG.md?

hedtke commented 1 year ago

Thank you for the feedback! I was thinking about a generalization: instead of focusing on a single helper (buf) or single magic exclude string, one could give a list:

ignore_all_lines_containing

And

ignore_everything_after

markvincze commented 1 year ago

@hedtke Yep, that sounds good to me as well. The only thing is that I'd somehow include the term "comment" in the name of the setting, to express that it only affects processing the comments, and no actual types will be ignored. Maybe something like ignore_comment_lines_containing, and ignore_comments_after?

And indeed, sounds good to make these lists of strings, so that multiple values can be specified if needed.

hedtke commented 1 year ago

version bumped, changelog updated, options aren't flags but lists now

hedtke commented 1 year ago

In my local version, I also added a new parameter

hide-packages = ['google.protobuf']

so that in navigation links and overviews, one can hide external includes that appear because protoc is used with --include_imports

Should I add that to his PR, or open another PR? I am also workin on other stuff: tree-like navigation bar etc

markvincze commented 1 year ago

@hedtke Thanks, I'll merge this one 👍 Please open a separate PR for the package hiding config.