Thoughts on making a Rustdoc with JSON again?

Hi all!

I was thinking about rustdoc, and I wanted to get some opinions on the idea of developing rustdoc to have multiple output formats, such as XML or JSON.

My personal use-case for such a feature would be integration with and GNU Info generation, so my text editor can have built-in documentation viewing, a la GNU Emacs.

What do you think? I'm not sure if I'm asking in the right place, but I wanted to get some thoughts.


(Mods: if this is the wrong place, let me know ASAP)


Your editor can get the docs using the Language Server protocol (and I think this already works partially, or at least I have seen doc tooltips in vscode).

The new dev tools team will talk about refactoring rustdoc to be able to use the Rust Language Server internally soon. Having rustdoc consume the compiler output through a well-defined interface (exposed by RLS/rust-analysis) also means that this interface can be serialized :slight_smile:


Hmm.. as I understand it then, my editor would have to have a RLS server running on the editor's source code to get the docs? My original intention was to export the documentation in a serialised format, to then be consumed by Sphinx / RTD and converted into a GNU Info file.

Not sure if my idea is possible. I guess I'll find out when the dev tools team refactor rustdoc.

Thanks for the response.


As the person doing this work, I wanted to second what @killercup said; it is unlikely we'll bring this back for the current Rustdoc, but it is extremely likely we'll have it in the new Rustdoc.