markvincze / sabledocs

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

hidden-packages not doing what I expected #65

Closed ctuffli closed 2 months ago

ctuffli commented 3 months ago

Running sabledocs generates a list of the Packages on the index.html page including packages (i.e., buf.validate) in the hidden-packages list.

(.venv) $ cat sabledocs.toml
module-title = "Service Documentation"
output-dir = "docs"

footer-content = "© 2024 Big Corp. All rights reserved."

hidden-packages = ["buf.validate","buf.validate.priv"]

From the description in the comment, I was expecting packages listed in "hidden" to not appear on the index page. Did I misunderstand what this option does? Is the syntax for the hidden-packages incorrect?

markvincze commented 3 months ago

Hi @ctuffli,

Thanks for reporting this issue! You're right, when this feature was introduced, only the logic was implemented to have the non_hidden_packages field being available and correctly populated in the data model, but the default HTML template was not changed to start using it. (It could've been used from a custom template though.) I changed the template now in #66, and it was released in version 0.13.770, can you give it a try?

ctuffli commented 3 months ago

Thanks for the fix! This does remove the packages from index.html, but curiously, sabledocs still generates the html documents for hidden packages and adds those to search.html

markvincze commented 2 months ago

@ctuffli thanks for testing! Indeed the change I implemented was a bit naïve, the file generation and the search index was not taken into account. Plus there was one more issue: the type name links were generated for types in hidden packages as well, so you could end up on the page of a hidden package by clicking on the type name too. I fixed these issues in #67, and it's released in version 0.13.784, hopefully now it works correctly. If you can give it a try, that'd be appreciated!

ctuffli commented 2 months ago

Yup, the latest works great in our testing. Thank you for fixing this!