The first public demonstration of Xamarin's new Workbooks idea was Miguel de Icaza's //build 2016 talk "Mobile First" (although he first wrote about it back in February). In his talk, Miguel demonstrates a new take on interactive documentation in which a Markdown-formatted file can live-execute C# code-fenced blocks; not just in-line but also in an iOS or Android simulator.
This opens up a great opportunity to write and share interactive documentation that not only describes an API or feature, but shows it in action. Further, it's easy to write, being based on the well-known Markdown format.
I've thrown together a few very simple ideas on github:
This opens up a great opportunity to write and share interactive documentation that not only describes an API or feature, but shows it in action. Further, it's easy to write, being based on the well-known Markdown format.
Give it a try!
You can now try Workbooks for yourself! The editor can be downloaded here, and there is some Workbook documentation on the Xamarin developer portal.I've thrown together a few very simple ideas on github:
- C# 6 - an interactive workbook version of Xamarin's C# 6 Overview.
- Mastermind - an attempt to build a simple game.
- Magic Eight Ball - since I've built that for a number of different platforms previously:
See Miguel's talk (if you didn't already) for a really cool demo.
Some Notes
- They're written in Markdown, but with a .workbook file extension.
- Each file begins with a small JSON-formatted metadata section. The editor will add this for you.
- C# code inside triple-backtick code fences will be executed when the file is viewed in the Workbooks editor.
How about integrating this work with Jupyter to get a Xamarin-based kernel for that working? That would provide a more powerful combination of Markdown and C# code interactive code development.
ReplyDeleteI should probably qualify what I mean as more powerful, since there's some nice code-completion here. Having a web-based interface provides potential for collaboration and running, for example, spark code against a cluster, which doesn't appear as readily possible here. There's good integration with particular charting libraries in the Python and R back-ends, too, so you can easily produce charts to visualise the data. I use both sometimes to explore data, but my primary language is C# so I've been looking for options that provide the capabilities I have there with the familiarity of C#.
DeleteI agree a web-based version would be nice - ditto for rendering options like chating. otoh Xamarin is all about mobile and the ability to drive local iOS and Android devices from the workbook is great for our customers. This is still a pre-release product, so please give it a try and continue to provide feedback - as you said below, "hopefully all languages will have these kinds of workbook/notebook/worksheet some day"!
DeleteBased on the look of the interface I assumed this WAS Jupyter until I headed to the documentation and found no mention of it.
DeleteLooks really good. =)
ReplyDeleteIs it limited to C#? To .NET languages? Or is it in any way extendable to other languages? I'm a C# fan but I find myself writing a lot of TypeScript these days.
Looks like C# only at the moment. If you want something similar for Python, Scala or R (or a number of other languages) then check out Jupyter. Haven't seen any TypeScript support there either, though, yet. F# isn't a surprise, because you've had a good interactive prompt there for some time so there's been less of a need for something better, but hopefully all languages will have these kinds of workbook/notebook/worksheet some day...
DeleteThanks for the link to my video, Craig. Today I posted another video on how you can add Nuget packages to your Workbook and do things like document how to consume a Web API:
ReplyDeletehttps://brax.tv/lesson/doc-apis-xamarin-workbook-nuget/
I saw that! Nuget interaction was the next thing on my list - if I get around to it I'll be sure to share your video too. Great stuff.
Delete