audunhalland / entrait

Loosely coupled Rust application design made easy
86 stars 3 forks source link

cargo-rdme does not render code examples under feature flags #5

Closed audunhalland closed 2 years ago

audunhalland commented 2 years ago

i.e. #[cfg_attr(feature = "?", doc = "some code example")]

Possible solutions:

  1. Find a way to make doctests unconditional, exclude doctests from cargo hack runs, then only run doctests with specific features turned on. But there seems to be no way to exclude doctests from a test run.
  2. Fix cargo rdme so that it can interpret feature flags
  3. Write a new readme generator (a lot of work?)
  4. Don't autogenerate readme file (also a lot of manual sync work)
  5. Make README a much smaller, standalone document, with links to docs.rs for specific features