-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
135 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
--- | ||
category: Documentation | ||
categoryindex: 1 | ||
index: 3 | ||
index: 5 | ||
--- | ||
*) | ||
(*** condition: prepare ***) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
--- | ||
category: Documentation | ||
categoryindex: 1 | ||
index: 6 | ||
index: 7 | ||
--- | ||
*) | ||
(*** condition: prepare ***) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"dotnet_repl_cellExecutionStartTime": "2023-11-17T21:04:27.922626+00:00", | ||
"dotnet_repl_cellExecutionEndTime": "2023-11-17T21:04:27.9559602+00:00" | ||
}, | ||
"source": [ | ||
"---\n", | ||
"category: Documentation\n", | ||
"\n", | ||
"categoryindex: 1\n", | ||
"\n", | ||
"index: 4\n", | ||
"\n", | ||
"---\n", | ||
"\n", | ||
"# Literate Notebooks\n", | ||
"\n", | ||
"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", | ||
"\n", | ||
"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", | ||
"\n", | ||
"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" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"dotnet_repl_cellExecutionStartTime": "2023-11-17T21:04:27.9577608+00:00", | ||
"dotnet_repl_cellExecutionEndTime": "2023-11-17T21:04:30.3608545+00:00", | ||
"dotnet_interactive": { | ||
"language": "fsharp" | ||
}, | ||
"polyglot_notebook": { | ||
"kernelName": "fsharp" | ||
} | ||
}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>{ Name = "Alf"\\n Phone = "(555) 555-5555"\\n ZipCode = "90210" }</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Name</td><td><div class=\"dni-plaintext\"><pre>"Alf"\r\n", | ||
"</pre></div></td></tr><tr><td>Phone</td><td><div class=\"dni-plaintext\"><pre>"(555) 555-5555"\r\n", | ||
"</pre></div></td></tr><tr><td>ZipCode</td><td><div class=\"dni-plaintext\"><pre>"90210"\r\n", | ||
"</pre></div></td></tr></tbody></table></div></details><style>\r\n", | ||
".dni-code-hint {\r\n", | ||
" font-style: italic;\r\n", | ||
" overflow: hidden;\r\n", | ||
" white-space: nowrap;\r\n", | ||
"}\r\n", | ||
".dni-treeview {\r\n", | ||
" white-space: nowrap;\r\n", | ||
"}\r\n", | ||
".dni-treeview td {\r\n", | ||
" vertical-align: top;\r\n", | ||
" text-align: start;\r\n", | ||
"}\r\n", | ||
"details.dni-treeview {\r\n", | ||
" padding-left: 1em;\r\n", | ||
"}\r\n", | ||
"table td {\r\n", | ||
" text-align: start;\r\n", | ||
"}\r\n", | ||
"table tr { \r\n", | ||
" vertical-align: top; \r\n", | ||
" margin: 0em 0px;\r\n", | ||
"}\r\n", | ||
"table tr td pre \r\n", | ||
"{ \r\n", | ||
" vertical-align: top !important; \r\n", | ||
" margin: 0em 0px !important;\r\n", | ||
"} \r\n", | ||
"table th {\r\n", | ||
" text-align: start;\r\n", | ||
"}\r\n", | ||
"</style>" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"type ContactCard =\n", | ||
" { Name: string\n", | ||
" Phone: string\n", | ||
" ZipCode: string }\n", | ||
"\n", | ||
"// Create a new record\n", | ||
"{ Name = \"Alf\"; Phone = \"(555) 555-5555\"; ZipCode = \"90210\" }" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": ".NET (F#)", | ||
"language": "F#", | ||
"name": ".net-fsharp" | ||
}, | ||
"language_info": { | ||
"file_extension": ".fs", | ||
"mimetype": "text/x-fsharp", | ||
"name": "F#", | ||
"pygments_lexer": "fsharp", | ||
"version": "6.0" | ||
}, | ||
"polyglot_notebook": { | ||
"defaultKernelName": "fsharp", | ||
"items": [ | ||
{ | ||
"name": "fsharp" | ||
} | ||
] | ||
}, | ||
"dotnet_interactive": { | ||
"defaultKernelName": "fsharp", | ||
"items": [ | ||
{ | ||
"name": "fsharp" | ||
} | ||
] | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
category: Documentation | ||
categoryindex: 1 | ||
index: 7 | ||
index: 8 | ||
--- | ||
|
||
# Customization and Styling | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
category: Documentation | ||
categoryindex: 1 | ||
index: 8 | ||
index: 9 | ||
--- | ||
# Users of FSharp.Formatting | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters