-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: everything in rust docs #991
Comments
I really like the idea of having a single source of truth, I think it simplifies maintenance a lot. |
I'm all for this for the described reasons.
I believe there're linters we can run as part of CI to prevent broken links. |
There's definitively tools to find broken backlinks, but we won't be able to fix them as controlling URLs will become very difficult. The consequences of this will be confused visitors that will land in a 404. SEO wise won't be a big problem as such broken links would only negatively impact docs.rs as a domain |
This is also a feature though -- CI will fail and you'll have to fix them As long as all the links are rust doc links like [`Something`] And not URL links Plus we could have some sort of convention around deprecating instead of removing old doc modules so we can link to the new location there |
There're tools to help catch broken URL links too https://github.com/deadlinks/cargo-deadlinks#usage |
When I said backlinks I meant a organic linking from website xyz.com pointing to docs.rs/whatever, not internal linking. When we update |
So the nice thing is with docs.rs you get versioned links so we do have some options there. For anything we link to externally we can choose to link to a specific version, in which case it will never break and when new versions are released they will see the red "a newer version is available" at the top left of the page, or we can link to latest in which case we run the risk of broken links, like you said. But it's just about the most flexibility we could have, and again if we have a careful deprecation policy on naming of items in the docs/tutorials crate we could basically ensure this never becomes an issue by leaving the old name with a link to the new one, as a policy. |
When we go to our new doc portal, (wherever the new version of https://paritytech.github.io/cumulus/ goes to) I'd like it if private documentation is turned on - that's not available in docs.rs and is helpful. E.g. documentation around nft pallet features is all non-public at the moment. |
The one thing that I don't quite completely like about this approach is the purported "docs situated right next to code" aspect -- this is not quite true. Sure, we can have references and links to actual types, but the reality is that the docs are hosted in a completely different That does change a couple of things about the advantages listed out here:
|
I'm writing new Migration and Try State tutorial/docs (which could find their way into the frame master tutorial when that is ready), and was initially planning to experiment writing this tutorial/guide format in Rustdocs. However, after working on it I feel like mdbook is better suited for stepped-tutorials.
Everything is still just markdown, so it won't be difficult to migrate to rustdocs in the future if we decide. I'm still in support of experimenting with all standalone pieces of docs that don't belong in a stepped tutorial being in rustdocs. |
Yeah, doubling-down on doing this everywhere would be key |
Yeah, this makes me wonder if there might be some way to export this > mdbook or mdbook > this in some automated way where we can get the best of both worlds |
All rustdocWhile I like the idea, I am not convinced using exclusively rustdoc would work for all authors (especially non dev ones). There will always be markdown written and not always embedded in some rustdoc. As far as code is concerned and direct documentation of the code, afaic there is no doubt this should be rustdoc in the code or linked markdown. The topic rustdoc vs markdown book will depend of the reader. mdbook / static site generatorAs for the more generic documentation, I would leave it to the doc team to pick the the solution they can be maintained best. I see a big benefit in bring all the doc we have together in one browsable/searchable site. That will also contribute keeping a good quality of content.
I agree as long as links are valid and it may be problematic in "flying" markdown that may not always be in sync with some pieces of code it refers to. no dupIt is obvious and critical to have no duplication in the doc source, we should not have content in both code (.rs) and markdown and no markdown duplicated for the sake of generating rustdoc and some markdown book. That being said, I don't think it would be an issue to have part of the doc used in both some rustdoc and some markdownbook/statuic doc site. URL validityThere are related issues: The later is the first to be taken care of, then we can enable a fix for #993 to ensure URLs remain valid. That will work for external urls. Documentation decayOne reality is that some part of the doc become stale over time. This can be due to maintainers of a piece of code to move of to other topics, not being around anymore, or the lack of updates due to oversights.
Our I was also tinkering with the idea of adding a "freshness/anti-decay check" to the markdown at least. So for instance, a If is still valid, a simple noop change could reset the counter and mark the validation that the doc was checked and is "fresh" enough. It is never fun to take over doc written by others but this will/is become necessary to ensure the overall quality. |
The nice thing about using |
This is a great idea, I will adopt it as such: In the new doc-vision manifesto, there are 3 classes of documents that we produce:
(See here for a more detailed description). The intention of the docs effort should be to do as much of the above as possible in rust-docs. As noted, these rust-docs could use But the main point is, the source of truth is always Some open challenges, questions:
|
* Add command to update registerTokenFee and sendTokenFee * Add smoke test for update fees * Rename to setTokenTransferFees * Improve for the comments * Update sdk * Update parachain/pallets/control/src/lib.rs Co-authored-by: Clara van Staden <[email protected]> * Update parachain/pallets/control/src/lib.rs Co-authored-by: Clara van Staden <[email protected]> * Rename as InvalidTokenTransferFees --------- Co-authored-by: Clara van Staden <[email protected]>
paritytech#991) Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/kornelski/http-cache-semantics/releases) - [Commits](kornelski/http-cache-semantics@v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: http-cache-semantics dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This came up in our FRAME weekly meeting, some internal docs discussions, and some conversations with community members on discord and elsewhere, and across the board there has been wide support for it so re-posting here for a more public discussion.
Everything in Rust Docs
Tutorials, documentation explaining what various blockchain and FRAME concepts are...everything... can and should live in rust-docs in our (soon-to-be-a-thing) monorepo because this is the lowest friction way for people to learn about these things (inline, at the exact moment when their confusion occurs while coding).
The way this could work is with a
substrate-concepts
/frame-concepts
or something like that sub-crate (probably dev dependency offrame
crate or rootsubstrate
crate) that is docs-only and has a bunch of empty modules (or ZSTs) that correspond with various concepts, tutorials, etc. The rust docs for these modules would be the content of tutorials or explanations of concepts, etc., and can use adocify
-like approach to embed markdown files for the longer ones especially tutorials that are easier to maintain as a .md file. Images we can easily embed, videos would become links which I think is fine.Then for example anywhere you mention something related to "staking", you could directly doc-link to
Staking
, and since these are dev-only dependencies, we can link to them from anywhere in substrate without causing dependency-related strain.The exact setup I'm happy to iterate on with a working example that maximizes what we can docify-embed, but this is the general idea.
Advantages
docify
to directly embed code examples from elsewhere in substrate within the tutorials that reference them such that they will automatically be updated when they are changed in the code.Would love some thoughts on this and further discussion. General reception so far has been highly positive so would love to hear some dissenting views.
cc @kianenigma @nukemandan @liamaharon @gupnik @franciscoaguirre @KiChjang @ggwpez @juangirini @aaronbassett
The text was updated successfully, but these errors were encountered: