Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Prototype an md-book version of the crate #38

Open
Tracked by #36
juangirini opened this issue Nov 8, 2023 · 7 comments
Open
Tracked by #36

Prototype an md-book version of the crate #38

juangirini opened this issue Nov 8, 2023 · 7 comments

Comments

@juangirini
Copy link

juangirini commented Nov 8, 2023

Prototype a md-book version of the same crate. It should use docify-cli.

@juangirini
Copy link
Author

@sam0x17 is this something you can help us with?

@sam0x17
Copy link

sam0x17 commented Nov 10, 2023

Yeah the idea here would be giving docify the ability to output an mdbook similar to how it can already compile markdown files. Once I am done with the other features that I am finishing up, this could be a good next target

I have never worked with generating mdbooks directly so if they are all defined in markdown then this honestly will already just work with docify's markdown directory compiling feature, so it could be quite easy

@juangirini
Copy link
Author

Adding some context sam0x17/docify#23

@nuke-web3
Copy link

nuke-web3 commented Jan 8, 2024

I am interested in the motivation for this issue: what does mdBook provide that RustDocs does not exactly? As I read it, in the context mentioned in docify#23 , perhaps exposing (almost) the same information as Rustdocs is desired... Why?

Perhaps the motivation is to have a higher level book that exposes https://github.com/paritytech/polkadot-sdk/tree/master/docs in a more typical end user docs site than pure rust docs is?

If there is a more full writeup somewhere of the motivation/goals, please LMK 🙏

For ref, I have some experience with mdBook in crafting https://github.com/Polkadot-Blockchain-Academy/pba-book so hope the learning from that work could help, and perhaps even be combined into some main Book for the SDK that included or exposed/linked PBA materials as I think they are quite useful for end users WRT concepts mostly.

@nuke-web3 nuke-web3 self-assigned this Jan 8, 2024
@sam0x17
Copy link

sam0x17 commented Jan 10, 2024

Yeah my understanding is it is mostly embedding/CSS motivated

@nuke-web3
Copy link

I have been considering sam0x17/docify#23 and researching what feels best in DevEx for those writing docs & source. To me, use of mdBook's plugins with pure markdown and example code (that supports testing against source vs. a rust file with heavy doc comments would be cleaner and easier to use tooling/IDES for. (see also paritytech/polkadot-sdk#2991 that is a bit of a hybrid for split files, with the nice feature that rs files can use LSPs, where md example blocks afaik cannot).

It might to me to be possible to use docify to tightly couple rust docs build, so you can develop and test examples with a "pure" mdBook (with option to do hybrid, as mentioned). The missing link 😉 is called out in the issue mentioned though... Handling [`Trait`] links in mdBook... I think this could be handled by some mdbook plugin and cargo hooks / a build.rs file. I have been experimenting towards that end but nothing to show just yet. I am not sure, but it may be possible to inject the book in full into rustdocs so it lives on docs.rs for SEO, if not, using docify to build them in rustdocs direct should work as it does in that hybrid example.

WDYT about a push towards a "real" mdBook that is tightly coupled with cargo to get the testing, building, and linking working?

@sam0x17
Copy link

sam0x17 commented Jan 31, 2024

Handling [`Trait`] links in mdBook... I think this could be handled by some mdbook plugin and cargo hooks / a build.rs file.

Yeah you hit the nail on the head here, my whole reason for advocating a rustdocs-based approach is the built in handling for these things which are actually quite non-trivial when you have re-exports of re-exports of re-exports coming into play in module resolution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

3 participants