microsoft / regorus

Regorus - A fast, lightweight Rego (OPA policy language) interpreter written in Rust.
MIT License
130 stars 31 forks source link

Display feature information in documentation #241

Closed anakrish closed 4 months ago

anakrish commented 4 months ago

In the public API for regorus in docs.rs, display that certain API is available only if a specific feature is available. For example, https://docs.rs/regorus/latest/regorus/struct.Engine.html#method.get_coverage_report does not list that coverage feature is necessary for this API.

There has been an attempt to make this work: https://github.com/microsoft/regorus/blob/56bd8841d09120366f5aebd58a12ad84602210d7/Cargo.toml#L165

@mkulke What is the right way to do this?

mkulke commented 4 months ago

So, for the time being this relies on nightly and requires additional annotations, not sure if it will work reliably in all cases. stabilization for this doc feature is ongoing. However, it looks like in the current main the annotation is a bit off, when adjusting it, doc renders ok for that method:

image

image