[Proposal] Ensure consistency between code and documentation. #9173
Description
Is your feature request related to a problem or challenge?
There are currently two documentation hosting targets for DataFusion: docs.rs (several crates) and arrow.apache.org.
- docs.rs - All crates published to crates.io are automatically documented on docs.rs. Doc tests can also serve as working examples and ensure the correctness of documentation.
- User Guide - The document hosted on arrow.apache.org is generated by Sphinx with manually mantained document source. It's a great source for getting an overview of the project and understanding how DataFusion works and its general usage.
Parts of the documentation could be shared between each other. For example, built-in functions should also be listed in the Expression API of the user guide. However, each of them maintain its own document source separately, and they are not fully consistant with each other.
Describe the solution you'd like
Merge relevant parts of Sphinx source into Rust doc comments.
Then extract doc comments from JSON output (rfcs#2963 - nightly toolchain required) of the rustdoc
and generate markdown files. Finally, include these files in Sphinx by doctree
.
A utility to generate markdown files from doc comments is required. It should not take much effort by utilizing rustdoc-json and rustdoc-types.
Describe alternatives you've considered
Create a shared doc folder between Rust and Sphinx source, and merge relevant part into one. Then include external file by doc attribute in Rust, or by doctree
in Sphinx.
This is really annoying to find the right file when writing doc in development. And I don't want to do that.🤪
Additional context
No response