Skip to content

Commit d4fe9fd

Browse files
committed
document ipynb -> fsx conversion
1 parent c740c3b commit d4fe9fd

File tree

1 file changed

+21
-60
lines changed

1 file changed

+21
-60
lines changed

docs/literate-notebook.ipynb

Lines changed: 21 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5+
"id": "9e399156",
56
"metadata": {
6-
"dotnet_repl_cellExecutionStartTime": "2023-11-17T21:04:27.922626+00:00",
7-
"dotnet_repl_cellExecutionEndTime": "2023-11-17T21:04:27.9559602+00:00"
7+
"dotnet_repl_cellExecutionEndTime": "2023-11-22T12:20:24.6149643+00:00",
8+
"dotnet_repl_cellExecutionStartTime": "2023-11-22T12:20:24.5700648+00:00"
89
},
910
"source": [
1011
"---\n",
@@ -18,71 +19,31 @@
1819
"\n",
1920
"# Literate Notebooks\n",
2021
"\n",
21-
"It is possible create content using [.NET interactive](https://github.com/dotnet/interactive/tree/main) polyglot notebooks as the input file. The notebooks are processed by converting the notebook to markdown and then passing the markdown through the markdown processing pipeline.\n",
22+
"Content may be created using [.NET interactive](https://github.com/dotnet/interactive/tree/main) polyglot notebooks as the input file. Notebooks are processed by converting the notebook to a literate `.fsx` script and then passing the script through the script processing pipeline. Markdown notebook cells are passed through as comments surrounded by `(**` and `*)`, F# code cells are passed through as code, and non-F# code is passed through as markdown fenced code blocks between `(**` and `*)` comment markers. \n",
2223
"\n",
2324
"The `fsdocs` tool uses [dotnet-repl](https://github.com/jonsequitur/dotnet-repl) to evaluate polyglot notebooks. You need this tool to evaluate notebooks using `dotnet fsdocs --eval`. It can be installed into your local tool manifest using the command `dotnet tool install dotnet-repl`.\n",
2425
"\n",
25-
"F# Formatting tries to faithfully reproduce a notebook's native appearance when generating documents. Notebook cell outputs are passed through unchanged to preserve the notebook's html output. The below snippet demonstrates a notebook's html output for F# records, which differs from the output you would get with literate scripts.\n"
26+
"F# Formatting tries to faithfully reproduce a notebook's native appearance when generating documents. Notebook cell outputs are passed through unchanged to preserve the notebook's html output. The below snippet demonstrates a notebook's html output for F# records, which differs from the output you would get with the same code inside a literate scripts.\n"
2627
]
2728
},
2829
{
2930
"cell_type": "code",
3031
"execution_count": null,
32+
"id": "4381f259",
3133
"metadata": {
32-
"dotnet_repl_cellExecutionStartTime": "2023-11-17T21:04:27.9577608+00:00",
33-
"dotnet_repl_cellExecutionEndTime": "2023-11-17T21:04:30.3608545+00:00",
3434
"dotnet_interactive": {
3535
"language": "fsharp"
3636
},
37+
"dotnet_repl_cellExecutionEndTime": "2023-11-22T12:20:27.5439764+00:00",
38+
"dotnet_repl_cellExecutionStartTime": "2023-11-22T12:20:24.6182652+00:00",
3739
"polyglot_notebook": {
3840
"kernelName": "fsharp"
41+
},
42+
"vscode": {
43+
"languageId": "polyglot-notebook"
3944
}
4045
},
41-
"outputs": [
42-
{
43-
"data": {
44-
"text/html": [
45-
"<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>{ Name = &quot;Alf&quot;\\n Phone = &quot;(555) 555-5555&quot;\\n ZipCode = &quot;90210&quot; }</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Name</td><td><div class=\"dni-plaintext\"><pre>&quot;Alf&quot;\r\n",
46-
"</pre></div></td></tr><tr><td>Phone</td><td><div class=\"dni-plaintext\"><pre>&quot;(555) 555-5555&quot;\r\n",
47-
"</pre></div></td></tr><tr><td>ZipCode</td><td><div class=\"dni-plaintext\"><pre>&quot;90210&quot;\r\n",
48-
"</pre></div></td></tr></tbody></table></div></details><style>\r\n",
49-
".dni-code-hint {\r\n",
50-
" font-style: italic;\r\n",
51-
" overflow: hidden;\r\n",
52-
" white-space: nowrap;\r\n",
53-
"}\r\n",
54-
".dni-treeview {\r\n",
55-
" white-space: nowrap;\r\n",
56-
"}\r\n",
57-
".dni-treeview td {\r\n",
58-
" vertical-align: top;\r\n",
59-
" text-align: start;\r\n",
60-
"}\r\n",
61-
"details.dni-treeview {\r\n",
62-
" padding-left: 1em;\r\n",
63-
"}\r\n",
64-
"table td {\r\n",
65-
" text-align: start;\r\n",
66-
"}\r\n",
67-
"table tr { \r\n",
68-
" vertical-align: top; \r\n",
69-
" margin: 0em 0px;\r\n",
70-
"}\r\n",
71-
"table tr td pre \r\n",
72-
"{ \r\n",
73-
" vertical-align: top !important; \r\n",
74-
" margin: 0em 0px !important;\r\n",
75-
"} \r\n",
76-
"table th {\r\n",
77-
" text-align: start;\r\n",
78-
"}\r\n",
79-
"</style>"
80-
]
81-
},
82-
"metadata": {},
83-
"output_type": "display_data"
84-
}
85-
],
46+
"outputs": [],
8647
"source": [
8748
"type ContactCard =\n",
8849
" { Name: string\n",
@@ -95,6 +56,14 @@
9556
}
9657
],
9758
"metadata": {
59+
"dotnet_interactive": {
60+
"defaultKernelName": "fsharp",
61+
"items": [
62+
{
63+
"name": "fsharp"
64+
}
65+
]
66+
},
9867
"kernelspec": {
9968
"display_name": ".NET (F#)",
10069
"language": "F#",
@@ -114,16 +83,8 @@
11483
"name": "fsharp"
11584
}
11685
]
117-
},
118-
"dotnet_interactive": {
119-
"defaultKernelName": "fsharp",
120-
"items": [
121-
{
122-
"name": "fsharp"
123-
}
124-
]
12586
}
12687
},
12788
"nbformat": 4,
12889
"nbformat_minor": 5
129-
}
90+
}

0 commit comments

Comments
 (0)