Skip to content

stops parsing after first //! block #79

@wookietreiber

Description

@wookietreiber

I've noticed the following limitations, which I'd like to report:

  • the content after the first //! block is missing
  • #![doc = include_str(...)] is not included

It looks like the parser only considers the first block of lines starting with //! and stops at the first line that doesn't start with //!.

Minimal Reproducible Example

This is src/lib.rs:

//! start of document
//!
//! # Examples
//!
//! ```rust,no_run
#![doc = include_str!("../examples/hello.rs")]
//! ```
//!
//! end of document

pub fn hello() {
    println!("hello");
}

This is examples/hello.rs:

fn main() {
    hello::hello();
}

The stuff after the first //! block is missing, i.e. neither the hello.rs example code, nor the end of document bit:

$ cargo readme --version
cargo-readme v3.2.0

$ cargo readme --no-title
start of document

## Examples

```rust

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