About adding extra source code snippets of others crates in generated markdown files from rustdoc JSON

⚓ Rust    📅 2025-12-13    👤 surdeus    👁️ 1      

surdeus

I was working on a cli tool that I can use to generate structured markdown docs (for my own project + the docs of its dependencies) with extensive reference links for various types (like html docs) that I can use to jump directly to where that type is documented in. For example, I already have added the "Defined in ..." part using the source span provided in rustdoc JSON, this is not provided in docs (as far as I know). The tool automatically copies the source code of my projects dependencies, to my project root and renames all of their Cargo.toml to Crate.toml so that rust-analyzer doesn't pick them up. This allows me to have local docs + source code of the dependencies I can look through in various ways. The link in image takes you directly to the exact location that function is defined in the source code of that crate (in this case syn). You can check this in the repo if you want to.

Would it be okay if I added the source code snippet directly into the markdown files, that are basically from someone else's project and they are probably not expecting their code to be used in such a way? I am thinking about providing the full docs in the repo of my projects, so I guess I should clear up whether I can keep this project public, or should I make it private and keep it only for my personal use?

image

1 post - 1 participant

Read full topic

🏷️ Rust_feed