Skip to content

Support document-features? #231

Description

@virtualritz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions