slint-ui / document-features

Extract documentation for the feature flags from comments in Cargo.toml
Apache License 2.0
173 stars 13 forks source link

Add document_enabled_features #27

Closed mdrssv closed 2 months ago

mdrssv commented 2 months ago

Having an function document_enabled_features would be an nice addition to display the set of enabled features to the user of an binary application when implementing an --version command.

ogoffart commented 2 months ago

But sure I really understand what you're asking. What will call this function and what would be the output for example?

mdrssv commented 2 months ago

Maybe this could be even realized by exposing an function returning an list of structs like this:

pub struct DocumentedFeature {
  pub feature: &'static str,
  pub description: &'static str,
  pub enabled: bool,
}
ogoffart commented 2 months ago

Note that document_feature is a proc_macro crate. And i'd like it to stay this way. So we can't have functions and types, only macro.

What is the use case you're looking at?