{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\r\n", "
\r\n", " \r\n", " \r\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ "What is the path to your dotnet/interactive repo?: c:\\dev\\interactive\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", " Directory: C:\\dev\\interactive\\samples\\extensions\\ClockExtension\n", "\n", "Mode LastWriteTime Length Name\n", "---- ------------- ------ ----\n", "d---- 4/21/2020 9:51 AM bin\n", "d---- 4/21/2020 9:51 AM obj\n", "-a--- 2/27/2020 12:25 PM 902 ClockExtension.csproj\n", "-a--- 2/28/2020 4:53 PM 2191 ClockKernelExtension.cs\n", "-a--- 2/23/2020 12:59 PM 5172 SvgClock.cs\n", "\n" ] } ], "source": [ "#!pwsh\n", "\n", "$clockExtensionDir = Join-Path -Path (Read-Host -Prompt \"What is the path to your dotnet/interactive repo?\") -ChildPath \"\\samples\\extensions\\ClockExtension\"\n", "cd $clockExtensionDir\n", "Get-ChildItem #| ConvertTo-Json | Out-Display -MimeType \"application/json\"" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Microsoft (R) Build Engine version 16.6.0-preview-20216-03+8a8a26f9b for .NET Core\n", "Copyright (C) Microsoft Corporation. All rights reserved.\n", "\n", " Determining projects to restore...\n", " Restored C:\\dev\\interactive\\samples\\extensions\\ClockExtension\\ClockExtension.csproj (in 571 ms).\n", " You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview\n", " ClockExtension -> C:\\dev\\interactive\\samples\\extensions\\ClockExtension\\bin\\Debug\\netcoreapp3.1\\ClockExtension.dll\n", "\n", "Build succeeded.\n", " 0 Warning(s)\n", " 0 Error(s)\n", "\n", "Time Elapsed 00:00:03.04\n", "Microsoft (R) Build Engine version 16.6.0-preview-20216-03+8a8a26f9b for .NET Core\n", "Copyright (C) Microsoft Corporation. All rights reserved.\n", "\n", " Determining projects to restore...\n", " Restored C:\\dev\\interactive\\samples\\extensions\\ClockExtension\\ClockExtension.csproj (in 637 ms).\n", " You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview\n", " ClockExtension -> C:\\dev\\interactive\\samples\\extensions\\ClockExtension\\bin\\Debug\\netcoreapp3.1\\ClockExtension.dll\n", "\n", "\n", " Directory: C:\\dev\\interactive\\samples\\extensions\\ClockExtension\\bin\\Debug\n", "\n", "Mode LastWriteTime Length Name\n", "---- ------------- ------ ----\n", "-a--- 4/21/2020 9:51 AM 17200 ClockExtension.1.2.8.nupkg\n", "\n" ] }, { "data": { "text/plain": [ "Wall time: 8416.0177ms" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#!pwsh\n", "#!time\n", "dotnet build\n", "dotnet pack /p:PackageVersion=1.2.8\n", "Get-ChildItem -Recurse *.nupkg" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Restore sources
" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "clockextension version 1.3.0 cannot be added because version 1.2.8 was added previously." ] } ], "source": [ "#i nuget:C:\\dev\\interactive\\samples\\extensions\\ClockExtension\\bin\\Debug\\\n", "#r nuget:clockextension,1.3.0" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "2020-05-01 14:17:15Z" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "DateTime.Now" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "#!clock:\n", " Displays a clock showing the current or specified time.\n", "\n", "Usage:\n", " #!clock [options]\n", "\n", "Options:\n", " --hour, -o The position of the hour hand\n", " -m, --minute The position of the minute hand\n", " -s, --second The position of the second hand\n", " -?, -h, --help Show help and usage information\n", "\n" ] } ], "source": [ "#!clock -h" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "ename": "Unhandled exception", "evalue": "Required command was not provided.\r\nUnrecognized command or argument '#!clock'\r\nUnrecognized command or argument '--hour'\r\nUnrecognized command or argument '1'\r\nUnrecognized command or argument '-m'\r\nUnrecognized command or argument '2'\r\nUnrecognized command or argument '-s'\r\nUnrecognized command or argument '3'", "output_type": "error", "traceback": [ "Required command was not provided.\r\nUnrecognized command or argument '#!clock'\r\nUnrecognized command or argument '--hour'\r\nUnrecognized command or argument '1'\r\nUnrecognized command or argument '-m'\r\nUnrecognized command or argument '2'\r\nUnrecognized command or argument '-s'\r\nUnrecognized command or argument '3'" ] } ], "source": [ "#!clock --hour 1 -m 2 -s 3" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#r nuget:trexlib" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#!t-rex -h" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#!t-rex run c:\\dev\\t-rex" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/html": [ "2020-05-01 14:19:11Z" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "DateTime.Now" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "Formatter.Register((s,writer) => writer.Write(s.ToString() + \"!\"), \"text/html\");" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": ".NET (C#)", "language": "C#", "name": ".net-csharp" }, "language_info": { "file_extension": ".cs", "mimetype": "text/x-csharp", "name": "C#", "pygments_lexer": "csharp", "version": "8.0" } }, "nbformat": 4, "nbformat_minor": 2 }