Skip to content

Document a binary? #238

Open
Open
@e-matteson

Description

@e-matteson

edit(@jyn514): Mentoring instructions for this issue are here: #238 (comment)

My crate has a macro that defines structs, and I want the docs to include an example of one of those generated structs. My solution was to write a binary, src/bin/example.rs, that invokes the macro.

This works great when I run cargo doc. I see example listed in the crates sidebar, and it contains docs for the generated struct. However, it doesn't show up in docs.rs.

I tried adding this to Cargo.toml, but it didn't help:

[[bin]]
name = "example"
doc = true

Is there some magical argument I can pass using [package.metadata.docs.rs] that will make it document the binary? Any other suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-mediumEffort: This requires a fair amount of workP-mediumMedium priorityS-needs-designStatus: There's a problem here, but no obvious solution; or the solution raises other questionsmentorThis has instructions for getting started

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions