Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Don Syme committed Jul 29, 2021
1 parent 14e78e6 commit 0d81d37
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 84 deletions.
24 changes: 0 additions & 24 deletions docs/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,6 @@

The `Dockerfile` and `NuGet.config` allow us to run generated notebooks in [MyBinder](https://mybinder.org)

* `gh-pages` branch of dsyme/DiffSharp: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dsyme/DiffSharp/gh-pages)

* `index.ipynb` for `dev` branch of dsyme/DiffSharp: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dsyme/DiffSharp/gh-pages?filepath=index.ipynb)

# Generating docs

This published version of the docs can be refreshed by these commands:

1. Prepare one off

dotnet tool restore
git clone https://github.com/dsyme/DiffSharp ../DiffSharp-docs -b gh-pages --depth 1

2. Build

dotnet build
dotnet fsdocs build --clean --output ../DiffSharp-docs
bash -c "(cd ../DiffSharp-docs && git add . && git commit -a -m doc-update && git push -f https://github.com/dsyme/DiffSharp gh-pages)"

To use a local builg of FSharp.Formatting:

git clone https://github.com/fsprojects/FSharp.Formatting ../FSharp.Formatting
cd ..\FSharp.Formatting
.\build

# How it works

Expand Down
1 change: 0 additions & 1 deletion docs/_template.fsx
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

2 changes: 1 addition & 1 deletion docs/apidocs.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ index: 5
let root = "C:\\"

(**
[![Binder](img/badge-binder.svg)](https://mybinder.org/v2/gh/diffsharp/diffsharp.github.io/master?filepath={{fsdocs-source-basename}}.ipynb) 
[![Binder](img/badge-binder.svg)](https://mybinder.org/v2/gh/fsprojects/fsharp.formatting/master?filepath={{fsdocs-source-basename}}.ipynb) 
[![Script](img/badge-script.svg)]({{root}}/{{fsdocs-source-basename}}.fsx) 
[![Notebook](img/badge-notebook.svg)]({{root}}/{{fsdocs-source-basename}}.ipynb)
Expand Down
2 changes: 1 addition & 1 deletion docs/codeformat.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ index: 1
#endif // IPYNB

(**
[![Binder](img/badge-binder.svg)](https://mybinder.org/v2/gh/diffsharp/diffsharp.github.io/master?filepath={{fsdocs-source-basename}}.ipynb) 
[![Binder](img/badge-binder.svg)](https://mybinder.org/v2/gh/fsprojects/fsharp.formatting/master?filepath={{fsdocs-source-basename}}.ipynb) 
[![Script](img/badge-script.svg)]({{root}}/{{fsdocs-source-basename}}.fsx) 
[![Notebook](img/badge-notebook.svg)]({{root}}/{{fsdocs-source-basename}}.ipynb)
Expand Down
2 changes: 1 addition & 1 deletion docs/content.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ index: 3


(**
[![Binder](img/badge-binder.svg)](https://mybinder.org/v2/gh/diffsharp/diffsharp.github.io/master?filepath={{fsdocs-source-basename}}.ipynb) 
[![Binder](img/badge-binder.svg)](https://mybinder.org/v2/gh/fsprojects/fsharp.formatting/master?filepath={{fsdocs-source-basename}}.ipynb) 
[![Script](img/badge-script.svg)]({{root}}/{{fsdocs-source-basename}}.fsx) 
[![Notebook](img/badge-notebook.svg)]({{root}}/{{fsdocs-source-basename}}.ipynb)
Expand Down
2 changes: 1 addition & 1 deletion docs/evaluation.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ index: 6
#endif // IPYNB

(**
[![Binder](img/badge-binder.svg)](https://mybinder.org/v2/gh/diffsharp/diffsharp.github.io/master?filepath={{fsdocs-source-basename}}.ipynb) 
[![Binder](img/badge-binder.svg)](https://mybinder.org/v2/gh/fsprojects/fsharp.formatting/master?filepath={{fsdocs-source-basename}}.ipynb) 
[![Script](img/badge-script.svg)]({{root}}/{{fsdocs-source-basename}}.fsx) 
[![Notebook](img/badge-notebook.svg)]({{root}}/{{fsdocs-source-basename}}.ipynb)
Expand Down
2 changes: 1 addition & 1 deletion docs/literate.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ index: 3


(**
[![Binder](img/badge-binder.svg)](https://mybinder.org/v2/gh/diffsharp/diffsharp.github.io/master?filepath={{fsdocs-source-basename}}.ipynb) 
[![Binder](img/badge-binder.svg)](https://mybinder.org/v2/gh/fsprojects/fsharp.formatting/master?filepath={{fsdocs-source-basename}}.ipynb) 
[![Script](img/badge-script.svg)]({{root}}/{{fsdocs-source-basename}}.fsx) 
[![Notebook](img/badge-notebook.svg)]({{root}}/{{fsdocs-source-basename}}.ipynb)
Expand Down
2 changes: 1 addition & 1 deletion docs/markdown.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ index: 2


(**
[![Binder](img/badge-binder.svg)](https://mybinder.org/v2/gh/diffsharp/diffsharp.github.io/master?filepath={{fsdocs-source-basename}}.ipynb) 
[![Binder](img/badge-binder.svg)](https://mybinder.org/v2/gh/fsprojects/fsharp.formatting/master?filepath={{fsdocs-source-basename}}.ipynb) 
[![Script](img/badge-script.svg)]({{root}}/{{fsdocs-source-basename}}.fsx) 
[![Notebook](img/badge-notebook.svg)]({{root}}/{{fsdocs-source-basename}}.ipynb)
Expand Down
5 changes: 3 additions & 2 deletions docs/sidebyside/sidemarkdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ code and get correct tool tips:

let answer = Hidden.answer


## Including other snippets

When writing literate programs as Markdown documents,
Expand All @@ -68,4 +67,6 @@ code samples:
Console.WriteLine("Hello world!");

This snippet is turned into a `pre` element with the
`lang` attribute set to `csharp`.
`lang` attribute set to `csharp`.

<br />
4 changes: 2 additions & 2 deletions src/FSharp.Formatting.Common/Templating.fs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ module internal SimpleTemplating =
sb.ToString()

// Replace '{{xyz}}' in text
let ApplySubstitutions (substitutions: seq<ParamKey * string>) templateTextOpt =
match templateTextOpt with
let ApplySubstitutions (substitutions: seq<ParamKey * string>) (templateTextOpt: string option) =
match templateTextOpt |> Option.map (fun s -> s.Trim()) with
| None | Some "" ->
// If there is no template or the template is an empty file, return just document + tooltips (tooltips empty if not HTML)
let lookup = readOnlyDict substitutions
Expand Down
Loading

0 comments on commit 0d81d37

Please sign in to comment.