Motoko documentation with live edits

The Motoko documentation has been updated to support live edits of code examples: You can edit the code in the language guide and see the result in the browser. Check it out!

18 Likes

This is awesome! Thanks Yan!

1 Like

Would be great to get line numbers in the side bar so that developers can locate the origin of their errors.

2 Likes

Right, some of the examples are only one line, which doesn’t need line numbers. Maybe we can add line numbers when it’s more than 3 lines?

3 Likes

nifty feature :clap:

As in my case the interpreter yells at me all the time with line numbers, I think line numbers could be helpful in some examples.

2 Likes

Great stuff! A small UX point I would add is a green run completed or something when the code runs without errors. Now when you make an error and fix it the old error stays visible and you’re not sure if you’ve actually fixed it.

3 Likes

Thanks for all the feedback!

Line numbers are now added for code with more than 3 lines. The base library examples are also executable, although we don’t have many examples at the moment.

2 Likes