[Example] Pure md
files with docify for rustdoc
and mdbook
compatible format
#2991
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Writing great docs in markdown in the context of a rust doc comment is not so great, mostly due to IDEs not having great LSPs, linters, formatters, etc. support for markdown in comments vs. true md files. It's also very cumbersome to use rustdoc to build HTML for docs (see #2937 for some ideas there).
To ease the development of writing great docs, pulling md files that are included in rustdocs with md comments for
docify
to include updated and tested rust codeNice thing with pure md is the protability as well: README that renders github (related to #2930) , includable in
mdbook
or other md tooling, that with docify includes updated, presumably CI tested, rust source code.Example
Targets #2937 but the key here is the diff on that to this branch: pure markdown files to write docs that are then
docify
-ed to include rust snippets and then those generated.md
files can (as proper and full markdown files) be used in rustdocs and pure md formats (like asked for in paritytech/polkadot-sdk-docs#38 )To see this in action with a hacky method (easy to improve if the general direction of this work is agreed on):
docify
thedocs/sdk/src/reference_docs/signed_extensions.docify.md
file (this will error out as we are trying to include a md file about to be generated)Next steps
If this seems like a desirable direction, happy to work on a better workflow and make a meta_contributing guide with some examples of such. Also could be an interesting thing to introduce as a workflow to PBA in the Book there, as slides are pure md that could be used in the same way with tested code snippets imported from the SDK here.