Creating live documents with code
Let us know how you feel about this.
last updated: 2016-11
Use workbooks to create live documents with C# code for experimenting, teaching, training or exploring.
You can use Workbooks as a standalone application, separate from your IDE.
To start creating a new workbook, run the Workbooks app. If you haven't installed this already, visit the Installation page. You will be prompted to create a workbook in your platform of choice, which will automatically connect to an agent app allowing you to visualise your document in real time.
If the Workbooks app is already running, you can create a new document by browsing to File > New .
Workbooks can be saved and opened again later within the application. You can then share them with others to demonstrate ideas, explore new APIs, or teach new concepts.
The code editing window provides code completion, syntax coloring, inline live-diagnostics, and multi-line statement support.
Xamarin Workbooks are saved in a
.workbook file, which is a CommonMark
file with some metadata at the top.
Rich Text Editing
You can edit the text around your code using the rich text editor included, like this:
A discrete unit of content, representing either executable code or markdown. A code cell is comprised of up to four sub-components:
- Compiler Diagnostics
- Console Output
- Execution Results
The interactive text component of a cell. For code cells, this is the actual code editor with syntax highlighting, etc. For markdown cells this is a rich-text content editor with a context sensitive formatting and authoring toolbar.
The actual text content of an editor.
Any diagnostics produced when compiling code, rendered only when explicit execution is requested. Displayed immediately below the cell editor.
Any output written to standard out or standard error during the execution of the cell. Standard out will be rendered in black text and standard error will be rendered in red text.
Rich and potentially interactive representations of results for a cell will be rendered upon successful compilation, provided a result is actually produced by execution. Exceptions are considered results in this context, since they are produced as a result of actually executing the compilation.