Skip to content

Include file in the documentation #37901

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
Yamakaky opened this issue Nov 20, 2016 · 4 comments
Closed

Include file in the documentation #37901

Yamakaky opened this issue Nov 20, 2016 · 4 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Yamakaky
Copy link
Contributor

It would be useful to be able a file in the documentation. My use-case is to include examples/quickstart.rs in the documentation of lib.rs. I could copy it, but it would be duplicated in the two files.

@bluss bluss added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Nov 20, 2016
@Yamakaky Yamakaky changed the title [rustdoc] Include file Include file in the documentation Nov 20, 2016
@euclio
Copy link
Contributor

euclio commented Nov 21, 2016

This would also be useful for including markdown documents in the source. For example,

#![doc(include = "README.md")]

Could avoid duplication between the main library documentation and the project's README file.

@Yamakaky
Copy link
Contributor Author

yes!

@steveklabnik
Copy link
Member

Duplicate of #15470, thanks!

@gilescope
Copy link
Contributor

For anyone that gets here from google the answer after following the trail is now:

#![doc = include_str!("core_arch_docs.md")]

(see rust-lang/stdarch#1013 )

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants