Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nhirschey committed Nov 22, 2023
1 parent 8cc8199 commit d6b46db
Show file tree
Hide file tree
Showing 7 changed files with 135 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/apidocs.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
title: Generating API Docs
category: Documentation
categoryindex: 1
index: 5
index: 6
---
*)
(*** condition: prepare ***)
Expand Down
2 changes: 1 addition & 1 deletion docs/content.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
---
category: Documentation
categoryindex: 1
index: 3
index: 5
---
*)
(*** condition: prepare ***)
Expand Down
2 changes: 1 addition & 1 deletion docs/evaluation.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
---
category: Documentation
categoryindex: 1
index: 6
index: 7
---
*)
(*** condition: prepare ***)
Expand Down
129 changes: 129 additions & 0 deletions docs/literate-notebook.ipynb
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 = &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",
"</pre></div></td></tr><tr><td>Phone</td><td><div class=\"dni-plaintext\"><pre>&quot;(555) 555-5555&quot;\r\n",
"</pre></div></td></tr><tr><td>ZipCode</td><td><div class=\"dni-plaintext\"><pre>&quot;90210&quot;\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
}
2 changes: 1 addition & 1 deletion docs/styling.md
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
Expand Down
2 changes: 1 addition & 1 deletion docs/users.md
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

Expand Down
2 changes: 1 addition & 1 deletion docs/zero-to-hero.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
category: Documentation
categoryindex: 1
index: 9
index: 10
---
# From zero to hero: deploying to GitHub Pages

Expand Down

0 comments on commit d6b46db

Please sign in to comment.