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!
This is awesome! Thanks Yan!
Would be great to get line numbers in the side bar so that developers can locate the origin of their errors.
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?
nifty feature
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.
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.
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.