paritytech / xcm-docs

Documentation for XCM
12 stars 4 forks source link

Integrate xcm-examples into this repo for easier reference #20

Open franciscoaguirre opened 1 year ago

franciscoaguirre commented 1 year ago

Instead of holding all the examples in another repo, we could hold them here so they're all in one place (we did want to have one centralized place with all the XCM documentation but ended up with two :joy:).

One thing we could do when we have them in the same repo, is use the docify tool Sam made for the FRAME docs here.

It lets us copy snippets directly from the working examples by using <!-- docify::embed!("some/rust/file.rs", some_ident) --> in our markdown files. This will let us have always the latest version of the code. I know in some places we don't want to show the complete example, but in some others we do. It would also be good for the cookbook annex, so all examples appear in the mdbook.

franciscoaguirre commented 1 year ago

Learnt you can already include files into mdbook using {{#include file.rs}} (https://rust-lang.github.io/mdBook/format/mdbook.html#including-files)