Ways to globally define a string for rustdoc?

⚓ Rust    📅 2025-07-31    👤 surdeus    👁️ 13      

surdeus

Warning

This post was published 125 days ago. The information described in this article may have changed.

We have a crate that serves as an client API for working against a server. The functions in the crate are documented, but there’s a lot of stuff that is documented in a separate document. So we want to leave a comment in each function’s rustdoc documentation along the line of “See document Some Document Title under section Some Section for more information”.

The problem is that the exact title of the document has not yet been determined. We can simply search and replace the title once we have it, but it made me wonder: Is there some way to reference some kind of variable in rustdoc? Could we define the name somewhere globally and simply reference it in all the rustdoc comments? I suspect the answer is “no”, but one never knows what hidden features one might have missed.

1 post - 1 participant

Read full topic

🏷️ Rust_feed