Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support document-features? #231

Open
virtualritz opened this issue Mar 30, 2024 · 1 comment
Open

Support document-features? #231

virtualritz opened this issue Mar 30, 2024 · 1 comment

Comments

@virtualritz
Copy link

virtualritz commented Mar 30, 2024

The document-features crate achieves a similar result as cargo-rdme.

A typical lib.rs doc block using this looks like:

//! Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
//! eiusmod tempor incididunt ut labore et dolore magna aliqua.  
//!
//! # Cargo Features
//!
#![doc = document_features::document_features!()]

The last part creates Markdown from ##-prefixed comments in the [features] section of Cargo.toml. I.e. it makes it easy to keep comments in Cargo.toml and docs in sync.

However, it can be mixed with additional (feature) docs and so the header, # Cargo Features, is not coming from document-features) but must be added manually. It then ends up at the bottom of the cargo-rdme-generated README.md, w/o anything under it.

It would be great if this feature-generation stuff could somehow be included/supported in cargo-rdme.

Alternatively a cargo-rdme option that removes the last header if it doesn't have text under it could be a workaround.
E.g. --strip-terminal-empty-header.

@orium
Copy link
Owner

orium commented Apr 9, 2024

#177 might allow this to be possible in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants