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

Feature/Enhancement: cargo doc --examples to render example documentation #4508

Closed
edmccard opened this issue Sep 18, 2017 · 3 comments
Closed
Labels
A-examples Area: example targets Command-doc

Comments

@edmccard
Copy link

cargo doc has --bin NAME and --bins flags for documenting regular binaries; it would be nice to be able to write documentation (and have it rendered) for example binaries (that is, the ones in a project's examples directory).

@ehuss ehuss added the A-examples Area: example targets label Mar 26, 2021
vdagonneau added a commit to vdagonneau/rust-landlock that referenced this issue Apr 29, 2021
This first version is really basic. It just loads a profile based on the
command name located in ~/.config/file_<cmd>.ll.

The file format is also very basic, it is essentially just like dotenv
files: a succession of environment variable declaration. The only thing
"smart" about it for now is that it merges them before passing them to
the sandboxer.

Note: I included code in the comments much like for a normal crate.
However, it seems like code in the comments of examples are not
currently being executed anywhere: rust-lang/cargo#4508
vdagonneau added a commit to vdagonneau/rust-landlock that referenced this issue Apr 29, 2021
This first version is really basic. It just loads a profile based on the
command name located in ~/.config/file_<cmd>.ll.

The file format is also very basic, it is essentially just like dotenv
files: a succession of environment variable declaration. The only thing
"smart" about it for now is that it merges them before passing them to
the sandboxer.

Note: I included code in the comments much like for a normal crate.
However, it seems like code in the comments of examples are not
currently being executed anywhere: rust-lang/cargo#4508
vdagonneau added a commit to vdagonneau/rust-landlock that referenced this issue Apr 29, 2021
This first version is really basic. It just loads a profile based on the
command name located in ~/.config/file_<cmd>.ll.

The file format is also very basic, it is essentially just like dotenv
files: a succession of environment variable declaration. The only thing
"smart" about it for now is that it merges them before passing them to
the sandboxer.

Note: I included code in the comments much like for a normal crate.
However, it seems like code in the comments of examples are not
currently being executed anywhere: rust-lang/cargo#4508
@heisen-li
Copy link
Contributor

This enhancement hasn't been done yet? This sounds interesting, and for me to understand the current crate feature is an example. My understanding is that cargo doc --example will display existing examples in the generated document. I'm interested in finishing it, so please tell me what else I need to finish.

bors added a commit that referenced this issue Sep 1, 2021
Adding the cargo doc --examples subcommand

Adding the cargo doc --examples subcommand

#4508
@heisen-li
Copy link
Contributor

Can this issue be closed?

@ehuss
Copy link
Contributor

ehuss commented Sep 3, 2021

Yep, thanks!

@ehuss ehuss closed this as completed Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-examples Area: example targets Command-doc
Projects
None yet
Development

No branches or pull requests

4 participants