Skip to content

Commit b5c6872

Browse files
committed
Update fsdocs
1 parent ab1d7d9 commit b5c6872

File tree

5 files changed

+32
-70
lines changed

5 files changed

+32
-70
lines changed

.config/dotnet-tools.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"fsdocs-tool": {
6+
"version": "20.0.0-alpha-009",
7+
"commands": [
8+
"fsdocs"
9+
]
10+
}
11+
}
12+
}

.github/workflows/docs.yml

+3-15
Original file line numberDiff line numberDiff line change
@@ -11,48 +11,36 @@ on:
1111

1212
env:
1313
FSHARP_DIR: fsharp
14-
FSF_DIR: FSharp.Formatting
1514

1615
jobs:
1716
build:
1817
runs-on: windows-latest
1918
steps:
2019
- uses: actions/checkout@v3
20+
- name: Restore tools
21+
run: dotnet tool restore
2122
- name: Checkout fsharp main
2223
uses: actions/checkout@v3
2324
with:
2425
repository: dotnet/fsharp
2526
path: ${{ env.FSHARP_DIR }}
2627
ref: main
27-
- name: Checkout FSharp.Formatting main
28-
uses: actions/checkout@v3
29-
with:
30-
repository: fsprojects/FSharp.Formatting
31-
path: ${{ env.FSF_DIR }}
32-
ref: main
3328
- name: Setup .NET for FSharp
3429
uses: actions/setup-dotnet@v3
3530
with:
3631
global-json-file: ${{ env.FSHARP_DIR }}/global.json
37-
- name: Setup .NET for FSharp.Formatting
38-
uses: actions/setup-dotnet@v3
39-
with:
40-
global-json-file: ${{ env.FSF_DIR }}/global.json
4132
- name: Restore local FSharp.Core project in current repo
4233
run: dotnet restore FSharp.Core\FSharp.Core.fsproj
4334
- name: Build FSharp.Core in fsharp main
4435
run: dotnet build src\FSharp.Core\FSharp.Core.fsproj /p:BUILDING_USING_DOTNET=true
4536
working-directory: ${{ env.FSHARP_DIR }}
46-
- name: Build FSharp.Formatting main
47-
run: dotnet fsi ./build.fsx -t Build
48-
working-directory: ${{ env.FSF_DIR }}
4937
- name: Run fsdocs
5038
env:
5139
# allow roll forward to latest major version - this would happen for us if we invoked the fsdocs tool instead of invoking the binary directly
5240
DOTNET_ROLL_FORWARD: "LatestMajor"
5341
# need previews because .NET 8 is what's being used at runtime
5442
DOTNET_ROLL_FORWARD_TO_PRERELEASE: "1"
55-
run: dotnet FSharp.Formatting\src\fsdocs-tool\bin\Release\net6.0\fsdocs.dll build --sourcefolder ${{ env.FSHARP_DIR }}
43+
run: dotnet fsdocs build --sourcefolder ${{ env.FSHARP_DIR }}
5644
- name: Deploy
5745
uses: peaceiris/actions-gh-pages@v3
5846
with:

.github/workflows/pr.yml

+3-14
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,21 @@ jobs:
2121
repository: dotnet/fsharp
2222
path: ${{ env.FSHARP_DIR }}
2323
ref: main
24-
- name: Checkout FSharp.Formatting main
25-
uses: actions/checkout@v3
26-
with:
27-
repository: fsprojects/FSharp.Formatting
28-
path: ${{ env.FSF_DIR }}
29-
ref: main
3024
- name: Setup .NET for FSharp
3125
uses: actions/setup-dotnet@v3
3226
with:
3327
global-json-file: ${{ env.FSHARP_DIR }}/global.json
34-
- name: Setup .NET for FSharp.Formatting
35-
uses: actions/setup-dotnet@v3
36-
with:
37-
global-json-file: ${{ env.FSF_DIR }}/global.json
28+
- name: Restore tools
29+
run: dotnet tool restore
3830
- name: Restore local FSharp.Core project in current repo
3931
run: dotnet restore FSharp.Core\FSharp.Core.fsproj
4032
- name: Build FSharp.Core in fsharp main
4133
run: dotnet build src\FSharp.Core\FSharp.Core.fsproj /p:BUILDING_USING_DOTNET=true
4234
working-directory: ${{ env.FSHARP_DIR }}
43-
- name: Build FSharp.Formatting main
44-
run: dotnet fsi ./build.fsx -t Build
45-
working-directory: ${{ env.FSF_DIR }}
4635
- name: Run fsdocs
4736
env:
4837
# allow roll forward to latest major version - this would happen for us if we invoked the fsdocs tool instead of invoking the binary directly
4938
DOTNET_ROLL_FORWARD: "LatestMajor"
5039
# need previews because .NET 8 is what's being used at runtime
5140
DOTNET_ROLL_FORWARD_TO_PRERELEASE: "1"
52-
run: dotnet FSharp.Formatting/src/fsdocs-tool/bin/Release/net6.0/fsdocs.dll build --sourcefolder ${{ env.FSHARP_DIR }}
41+
run: dotnet fsdocs build --sourcefolder ${{ env.FSHARP_DIR }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ FSharp.Formatting/
1010
FSharp.Core/obj/
1111
tmp/
1212
.idea/
13+
output/

README.md

+13-41
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,24 @@ signature files (`*.fsi`) in the FSharp.Core implementation.
99

1010
* Fork and clone <https://github.com/dotnet/fsharp> locally, see below, as a subdirectory of your copy of `fsharp-core-docs`
1111

12-
* Contribute to [the FSharp.Core directory](https://github.com/dotnet/fsharp/tree/master/src/fsharp/FSharp.Core)
13-
14-
* Use a local build, see below
12+
* Contribute to [the FSharp.Core directory](https://github.com/dotnet/fsharp/tree/main/src/fsharp/FSharp.Core)
1513

1614
* Submit work to `main` branch of <https://github.com/dotnet/fsharp>
1715

18-
* Once accepted your work will be published through a rebuild here. Site rebuilds daily at 17:30 UTC, or submit a dummy pull request here to trigger.
16+
* Update the `dotnet tool` if new versions are released.
1917

2018
## Contributing to Generation of API Docs
2119

2220
The docs are generated by using `fsdocs` tool from FSharp.Formatting. If you want to improve the generation process:
2321

24-
* Contribute to the API Docs mode and/or HTML generator in [FSharp.Formatting.ApiDocs](https://github.com/fsprojects/FSharp.Formatting/tree/master/src/FSharp.Formatting.ApiDocs) and [the `fsdocs` tool](https://github.com/fsprojects/FSharp.Formatting/tree/master/src/FSharp.Formatting.CommandTool)
25-
26-
* Use a local copy of these, see below, as a subdirectory of fsharp-core-docs
27-
28-
* Submit work to the `master` branch of <https://github.com/fsprojects/FSharp.Formatting>
29-
30-
* Once accepted the new tooling will be published through a rebuild here, so submit a dummy pull request here that increments dummyVersion.txt
31-
32-
## Contributing to Layout and Design
33-
34-
These pages are currently using [the default template of the FSharp.Formatting tools](https://github.com/fsprojects/FSharp.Formatting/blob/master/docs/_template.html)
35-
with its small amount of corresponding [CSS and JavaScript](https://github.com/fsprojects/FSharp.Formatting/tree/master/docs/content)
36-
37-
See [FSharp.Formatting styling](https://fsprojects.github.io/FSharp.Formatting/styling.html) for information on styling for output generated by `fsdocs`.
22+
* Contribute to the API Docs mode and/or HTML generator in [FSharp.Formatting.ApiDocs](https://github.com/fsprojects/FSharp.Formatting/tree/main/src/FSharp.Formatting.ApiDocs) and [the `fsdocs` tool](https://github.com/fsprojects/FSharp.Formatting/tree/main/src/FSharp.Formatting.CommandTool)
3823

39-
This template is *not* the long term plan (unless it is improved enough). We can improve the design - please help with this.
24+
* Submit work to the `main` branch of <https://github.com/fsprojects/FSharp.Formatting>
4025

41-
1. Copy the default template and CSS to `docs`. Rebuild as before. This template will be used instead of the default template.
42-
43-
2. After you have identified fixes and improvements, contribute back to the default template of FSharp.Formatting, or submit your work here and we can assess that. This will help improve many F# libraries.
44-
45-
Whatever improvements you make should eventually get copied across back into FSharp.Formatting (and the duplicated template and styling will then likely be removed from this repo once it's no longer needed). If the design diverges to be a completely different look and feel then we can make several templates available in FSharp.Formatting with this as one of them.
26+
* Update the `dotnet tool` if new versions are released.
4627

4728
## Build steps
4829

49-
Eventually the build will just be
50-
5130
dotnet tool restore
5231
dotnet restore FSharp.Core
5332
dotnet fsdocs build
@@ -56,34 +35,27 @@ For now, we want to pick up the latest copies of FSharp.Formatting and FSharp.Co
5635

5736
(start in 'fsharp-core-docs')
5837
dotnet restore FSharp.Core
38+
dotnet tool restore
5939

60-
(make 'fsharp-core-docs/fsharp' and 'fsharp-core-docs/FSharp.Formatting' )
40+
(make fsharp-compiler-docs/fsharp)
6141
git clone https://github.com/dotnet/fsharp --depth 1 -b main
62-
git clone https://github.com/fsprojects/FSharp.Formatting --depth 1
6342

6443
(build 'fsharp-core-docs/fsharp')
6544
pushd fsharp
66-
.\build -noVisualStudio
67-
popd
68-
69-
(build 'fsharp-core-docs/FSharp.Formatting')
70-
pushd FSharp.Formatting
71-
.\build -t Build
45+
dotnet build src\FSharp.Core\FSharp.Core.fsproj /p:BUILDING_USING_DOTNET=true
7246
popd
7347

7448
Then do iterative development using:
7549

7650
(from 'fsharp-core-docs')
77-
FSharp.Formatting\src\FSharp.Formatting.CommandTool\bin\Release\netcoreapp3.1\fsdocs.exe watch --sourcefolder fsharp
51+
dotnet fsdocs watch --sourcefolder fsharp
7852

7953
## CI Pipeline
8054

81-
This repo is published via GitHub Actions. On each push to master, the docs are built, and the outputs (which are written to the `output` directory by fsdocs) are pushed to the `gh-pages` branch. This repo is configured to host using GitHub Pages from this branch, so once the generated files are pushed the update is nearly-instant.
82-
83-
To build the very latest and freshest docs using the latest `fsdocs` tooling the CI does this:
55+
This repo is published via GitHub Actions. On each push to main, the docs are built, and the outputs (which are written to the `output` directory by fsdocs) are pushed to the `gh-pages` branch. This repo is configured to host using GitHub Pages from this branch, so once the generated files are pushed the update is nearly-instant.
8456

85-
1. build dotnet/fsharp `main` branch (where we assume latest doc updates have been pushed)
57+
To build the very latest and freshest docs the CI does this:
8658

87-
2. builds `FSharp.Formatting` master branch
59+
1. build dotnet/fsharp `main` branch (where we assume latest doc updates have been pushed).
8860

89-
3. Uses that `FSharp.Formatting` tool to build the docs for the FSharp.Core built in step 1
61+
2. generate the documentation using the local dotnet fsdocs tool.

0 commit comments

Comments
 (0)