docs: 添加文档

master
bicijinlian 2 years ago
parent 258648a71e
commit 56e901f0d1

@ -0,0 +1,118 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# 同一笔记中使用多语言"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 使用C#"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 使用 F#"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 使用Powershell"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 使用 html"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 使用 JavaScript"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 使用 SQL"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 使用 KQL"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 使用 mermaind"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 使用 Raw Value Storage"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"## 使用 Rarzor"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "value"
},
"polyglot_notebook": {
"kernelName": "value"
},
"vscode": {
"languageId": "polyglot-notebook"
}
},
"outputs": [],
"source": []
}
],
"metadata": {
"language_info": {
"name": "python"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}

@ -0,0 +1,182 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# 测试使用"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 全局引用"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"polyglot_notebook": {
"kernelName": "csharp"
}
},
"outputs": [],
"source": [
"// 默认包源\n",
"#i \"https://api.nuget.org/v3/index.json\"\n",
"\n",
"//添加 Nuget 包\n",
"#r \"nuget: microsoft.dotNet.interactive.aspnetcore,*-*\"\n",
"#r \"nuget: Microsoft.DotNet.Interactive.ExtensionLab,*-*\"\n",
"//全局引用\n",
"\n",
"//全局变量"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 测试"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"polyglot_notebook": {
"kernelName": "csharp"
}
},
"outputs": [],
"source": [
"var names=new string[]{\"小张\",\"王明\",\"李立三\"};"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"polyglot_notebook": {
"kernelName": "csharp"
}
},
"outputs": [],
"source": [
"#!share --help"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "javascript"
},
"polyglot_notebook": {
"kernelName": "javascript"
}
},
"outputs": [],
"source": [
"let value = \"hello from js\"\n",
"\n",
"console.log(value)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "javascript"
},
"polyglot_notebook": {
"kernelName": "javascript"
}
},
"outputs": [],
"source": [
"#!share names --from csharp --mime-type text/plain --as cc\n",
"\n",
"console.log(cc)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "javascript"
},
"polyglot_notebook": {
"kernelName": "javascript"
}
},
"outputs": [],
"source": [
"var d =interactive.csharp\n",
"console.log(d)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "javascript"
},
"polyglot_notebook": {
"kernelName": "javascript"
}
},
"outputs": [],
"source": [
"let va = await interactive.csharp.getVariable('names');\n",
"interactive.csharp"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".NET (C#)",
"language": "C#",
"name": ".net-csharp"
},
"language_info": {
"name": "polyglot-notebook"
},
"orig_nbformat": 4,
"polyglot_notebook": {
"kernelInfo": {
"defaultKernelName": "csharp",
"items": [
{
"aliases": [],
"name": "csharp"
},
{
"aliases": [],
"name": "razor"
}
]
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}

@ -27,7 +27,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
@ -36,7 +36,37 @@
"kernelName": "csharp"
}
},
"outputs": [],
"outputs": [
{
"data": {
"text/html": [
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.Dotnet.Interactive.SqlServer, 1.0.0-beta.23165.2</span></li></ul></div></div>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Loading extensions from `C:\\Users\\ruyu\\.nuget\\packages\\microsoft.dotnet.interactive.sqlserver\\1.0.0-beta.23165.2\\interactive-extensions\\dotnet\\Microsoft.DotNet.Interactive.SqlServer.dll`"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<details><summary>Query Microsoft SQL Server databases.</summary>\r\n",
"<p>This extension adds support for connecting to Microsoft SQL Server databases using the <code>#!connect mssql</code> magic command. For more information, run a cell using the <code>#!sql</code> magic command.</p>\r\n",
"</details>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#r \"nuget:Microsoft.Dotnet.Interactive.SqlServer,*-*\""
]
@ -116,7 +146,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
@ -125,7 +155,17 @@
"kernelName": "csharp"
}
},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"Kernel added: #!sql-Demo"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#!connect mssql \"server=.\\SQL2008;uid=sa;pwd=gly-bicijinlian;database=Study;Encrypt=True;TrustServerCertificate=True;\" --kernel-name Demo\n",
"//重复执行会抛出错误,目前没有找到解决方法"
@ -214,7 +254,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
@ -223,7 +263,42 @@
"kernelName": "csharp"
}
},
"outputs": [],
"outputs": [
{
"data": {
"text/markdown": [
"Scaffolding a `DbContext` and initializing an instance of it called `DemoEF` in the C# kernel."
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Humanizer, 2.14.1</span></li><li><span>humanizer.core, 2.14.1</span></li><li><span>Microsoft.EntityFrameworkCore.Design, 7.0.0</span></li><li><span>microsoft.entityframeworkcore.sqlserver, 7.0.0</span></li><li><span>microsoft.identity.client, 4.48.1</span></li></ul></div></div>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Security Warning: The negotiated TLS 1.0 is an insecure protocol and is supported for backward compatibility only. The recommended protocol version is TLS 1.2 and later.\r\n"
]
},
{
"data": {
"text/plain": [
"Kernel added: #!sql-DemoEF"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#!connect mssql \"server=.\\SQL2008;uid=sa;pwd=gly-bicijinlian;database=Study;Encrypt=True;TrustServerCertificate=True;\" --create-dbcontext --kernel-name DemoEF "
]
@ -302,6 +377,24 @@
"var c = context.Database.ExecuteSql(fs);\n",
"display(c);"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "sql-DemoEF"
},
"polyglot_notebook": {
"kernelName": "sql-DemoEF"
}
},
"outputs": [],
"source": [
"#!sql-DemoEF\n",
"\n",
"var data = from "
]
}
],
"metadata": {

@ -0,0 +1,70 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# 共享变量的使用"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 全局设置"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"polyglot_notebook": {
"kernelName": "csharp"
}
},
"outputs": [],
"source": [
"// 默认包源\n",
"#i \"https://api.nuget.org/v3/index.json\"\n",
"\n",
"//Nuget 包引用\n",
"#r \"nuget: Microsoft.DotNet.Interactive.ExtensionLab,*-*\"\n",
"\n",
"//全局变量"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".NET (C#)",
"language": "C#",
"name": ".net-csharp"
},
"language_info": {
"name": "polyglot-notebook"
},
"orig_nbformat": 4,
"polyglot_notebook": {
"kernelInfo": {
"defaultKernelName": "csharp",
"items": [
{
"aliases": [],
"name": "csharp"
},
{
"aliases": [],
"name": "razor"
}
]
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading…
Cancel
Save