Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Include images in rustdoc output #32104
As written by Luthaf over here
Images in documentation can be really useful to provide some insight on algorithms or modules organisation.
It is already possible to insert a link to an image in documentation comment
But using this method, we only get to include images already available in some place of Internet.
Is it a way to make rustdoc copy some files to the target/doc folder, so that it is easy to include specific images in the documentation? The same could go for other static files, like specific CSS or JS.
Is it possible yet? If not, do you think it is worth it?"
I this this would be awesome to include as sometimes using images is much easier when explain something than showing text.
referenced this issue
Jan 12, 2017
Or you host the image somewhere, like on GitHub pages (that's what ndarray is doing here https://github.com/rust-ndarray/ndarray/blob/master/src/impl_views.rs )
I think what would be most optimal is if there could be a folder where images for the doc could be stored in the crate folder structure.
There is one huge painpoint here though, and that is a lot of people just love to generate extremely large pictures to include in the crates. For no reason: ClickBait article with example
So if this should be in the code, the file size should be limited.