Skip to content

Commit 8cc8199

Browse files
committed
evaluation
1 parent 1852125 commit 8cc8199

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

.config/dotnet-tools.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
"commands": [
1414
"fsharp-analyzers"
1515
]
16+
},
17+
"dotnet-repl": {
18+
"version": "0.1.208",
19+
"commands": [
20+
"dotnet-repl"
21+
]
1622
}
1723
}
1824
}

src/fsdocs-tool/BuildCommand.fs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,23 @@ type internal DocContent
348348
outputFileFullPath
349349
)))
350350
elif isPynb then
351-
printfn " preparing %s --> %s" inputFileFullPath outputFileRelativeToRoot
351+
printfn " preparing %s --> %s" inputFileFullPath outputFileRelativeToRoot
352+
353+
let evaluateNotebook ipynbFile =
354+
let psi =
355+
ProcessStartInfo(fileName = "dotnet",
356+
arguments = $"repl --run {ipynbFile} --default-kernel fsharp --exit-after-run --output-path {ipynbFile}",
357+
UseShellExecute = false,
358+
CreateNoWindow = true)
359+
360+
let p = Process.Start(psi)
361+
p.WaitForExit()
362+
363+
if evaluate then
364+
printfn $" evaluating {inputFileFullPath} with dotnet-repl"
365+
evaluateNotebook inputFileFullPath
366+
367+
352368
let model =
353369
Literate.ParseAndTransformPynbFile(
354370
inputFileFullPath,

0 commit comments

Comments
 (0)