Document a binary?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.2k
- Forks
- 232
- Avg merge
- 11h 35m
- Merged PRs (30d)
- 60
Description
edit(@jyn514): Mentoring instructions for this issue are here: https://github.com/rust-lang/docs.rs/issues/238#issuecomment-724579558
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?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior with src/bin/example.rs and the shown Cargo.toml settings, then inspect how docs.rs handles crate targets and [package.metadata.docs.rs]. Confirm whether binary documentation can be supported or whether the issue needs a documented limitation; done means the expected behavior and configuration are clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100