Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

62 docs generation fsharp formatting #110

Merged
merged 100 commits into from
Dec 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
493e204
Documentation Scaffolding
Dec 15, 2018
5f45401
Generate docs from docsSrc
Dec 15, 2018
55445c2
Rendering to files
Dec 16, 2018
1502ccf
assign file path so that namespace can be generated correctly in dyna…
baronfel Dec 16, 2018
827d037
Adding navbar layouts
Jan 5, 2019
e204179
huh
Jan 5, 2019
cb01f3c
checkpoint
Jan 9, 2019
6b6496f
Generate API Documentation
Feb 1, 2019
e4fbba3
move to templates
Feb 1, 2019
cf3f1e7
move nav to template file
Feb 1, 2019
211737f
Watching docsSrc files
Feb 1, 2019
c913590
Update Bootstrap to 4.2.1
Feb 1, 2019
18b032d
Hot reload with docsSrc files changed
Feb 1, 2019
3fff9f5
remove comment
Feb 1, 2019
5fbeae6
Add hotloading for api generation
Feb 4, 2019
b0185bd
Clean up namespaces styling
Feb 4, 2019
9e7b669
Clean up modules styling
Feb 4, 2019
894e0eb
improve comment formatting by working on sections
baronfel Feb 6, 2019
3360e2b
comment sections use a smaller header
baronfel Feb 7, 2019
f68670f
Fixup rebase
Sep 20, 2019
860727b
get documentation generation working again
Sep 20, 2019
7ebddfb
better hot reloading of template changes to docs
Sep 24, 2019
8e46401
Add Build/Watch args for doc generation tool
Oct 5, 2019
703d628
Delete old template files, rename docsTool
Oct 5, 2019
b0b118d
Have build.fsx call docsTool
Oct 5, 2019
d6bdaed
Proof of concept generating api docs with external libraries
Oct 10, 2019
ba20e48
Seperate out docsTool deps
Oct 10, 2019
8e4bc2e
Cleanup open browser process creation
Oct 10, 2019
f454730
Use Dotnet.ProjInfo to get references for project
Oct 11, 2019
ec2dadc
refactorings
Oct 14, 2019
311fbc6
Docs landing page changes
Oct 15, 2019
0ed1689
rebase fixes
Oct 24, 2019
057973b
remove old docs code from root repo
Oct 24, 2019
ff9ea6e
Start using Divio documentation structure
Oct 31, 2019
40acc36
Update Home page to reflect divio doc ideas
Oct 31, 2019
cd14968
add fcswatch and nav submenu support
Nov 1, 2019
22f6451
Generate NavTree from filepaths
Nov 1, 2019
39a8e07
Pulling NavBar dynamically
Nov 1, 2019
3554ddf
Rename API reference and sort nav items
Nov 1, 2019
5218ef9
Using a glob for project files to generate API docs
Nov 1, 2019
971d026
Postpose writing html files to disk to generate nav properly
Nov 2, 2019
20f67ec
More logging and cleanups
Nov 2, 2019
2ade796
fixing font awesome, rename root namespace file
Nov 2, 2019
9ba55e7
Thread through configuration
Nov 2, 2019
2677b4b
Move ProjectFilesGlob to config
Nov 2, 2019
469cddb
Strongly type docstool cli args in build script
Nov 2, 2019
c16a5ae
Pass through config values from build script to docstool
Nov 2, 2019
aa1d0b2
Remove top level docs
Nov 2, 2019
e0f2905
rebase fixes
Nov 29, 2019
28e9495
initial Public site base url support
Nov 29, 2019
3fcc316
Nav items should respect baseUrl now
Nov 29, 2019
930b88b
Lets markdown files use siteBaseUrl in links
Nov 29, 2019
d776822
paket lock fixes
Nov 29, 2019
172ae7f
Moving magic strings to literals
Nov 29, 2019
5d8f173
Put github url in navbar
Nov 29, 2019
981a71a
Update to latest Bootstrap
andrewpucci Nov 30, 2019
549399c
Add footer to bottom of page or after content, whichever is lower
andrewpucci Nov 30, 2019
4141724
Rename to Project Name
Nov 30, 2019
157b4a6
Improve spacing around cards
andrewpucci Nov 30, 2019
6b4e7a9
API docs have link to github code
Nov 30, 2019
a600e7d
Better support for XML Docs
Nov 30, 2019
019df06
remove debug statements
Nov 30, 2019
889c208
A filled in footer with release version and date
Nov 30, 2019
d09bf24
Use FSharp logo for FSSF link
Nov 30, 2019
c9ca68a
Add alt tag to f# logo
Nov 30, 2019
2bcb078
Make external links open new tabs
Nov 30, 2019
8c5de12
add naive cache busting for css/javascript
Nov 30, 2019
9f64feb
Adds ReleaseDocs target and integrate into Release pipeline
Nov 30, 2019
d49eaa6
Make footer more responsive and readable
andrewpucci Nov 30, 2019
e11c480
Give github icon an arialabel
andrewpucci Nov 30, 2019
67d659d
Adds Docs build targets to README
Dec 1, 2019
f1aceae
remove target blank for external urls
Dec 1, 2019
b755f22
Show edit link for each page
Dec 1, 2019
f5e9bee
Fixes styling of arrow in submenu dropdown
Dec 3, 2019
190fcbf
Dont let docstool be packable
Dec 3, 2019
cb4675c
Adding some Docs to the docsTool README
Dec 6, 2019
899f651
Cleanup library but leave some basics
Dec 7, 2019
77aa686
Fixing time template tests in library
Dec 10, 2019
52988bf
Fixed page anchors
Dec 12, 2019
b9f682e
Hides first br from FSharp.Literate xml-doc rendering
Dec 12, 2019
1430e6c
Remove unneeded tooltip from API references
Dec 12, 2019
ee111b7
Hides first br from FSharp.Literate xml-doc rendering
Dec 12, 2019
349bad8
Merge branch 'master' into 62-docs-generation-fsharp-formatting
TheAngryByrd Dec 13, 2019
d4319c5
A little better content starters
Dec 13, 2019
aa5038d
Merge branch 'master' into 62-docs-generation-fsharp-formatting
TheAngryByrd Dec 13, 2019
6f5e78c
Merge branch 'master' into 62-docs-generation-fsharp-formatting
TheAngryByrd Dec 13, 2019
227b200
Fix landing page link to how tos
Dec 13, 2019
c0e05bb
Edit this page, takes you to github edit screen
Dec 13, 2019
b9d9764
add a union case to test case name generation
baronfel Dec 13, 2019
f2e0453
put landing page buttons in footers so they can easily be right-aligned
baronfel Dec 13, 2019
acddfc2
make landing page cards have consistent button placement
baronfel Dec 13, 2019
6d3287d
Add date to copyright
Dec 13, 2019
2942d49
Slack link points to FSSF slack docs
Dec 13, 2019
f2a1527
Fix aria label for github link in nav
Dec 13, 2019
5707997
Add aria-label to github link for api references
Dec 13, 2019
b8a3322
refactor footer link generation
baronfel Dec 13, 2019
8f0bab3
render repo-root-file links only if the file exists
baronfel Dec 13, 2019
e7cb3b5
render namespaces uniformly
baronfel Dec 13, 2019
5cbb631
fix fontawesome 'style' kinds
baronfel Dec 13, 2019
ac64c72
unify rendering of obsolete text
baronfel Dec 13, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
529 changes: 186 additions & 343 deletions Content/Console/paket.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions Content/Library/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
"commands": [
"paket"
]
},
"fcswatch-cli": {
"version": "0.7.14",
"commands": [
"fcswatch"
]
}
}
}
5 changes: 5 additions & 0 deletions Content/Library/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"workbench.colorCustomizations": {
"tab.unfocusedActiveBorder": "#fff0"
}
}
16 changes: 15 additions & 1 deletion Content/Library/MyLib.1.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
Expand All @@ -11,6 +11,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{ACBEE43C
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "MyLib.1.Tests", "tests\MyLib.1.Tests\MyLib.1.Tests.fsproj", "{1CA2E092-2320-451D-A4F0-9ED7C7C528CA}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "docsTool", "docsTool\docsTool.fsproj", "{8855EC73-F6A1-43D3-AFBC-04A3E09F9BD9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -48,6 +50,18 @@ Global
{1CA2E092-2320-451D-A4F0-9ED7C7C528CA}.Release|x64.Build.0 = Release|x64
{1CA2E092-2320-451D-A4F0-9ED7C7C528CA}.Release|x86.ActiveCfg = Release|x86
{1CA2E092-2320-451D-A4F0-9ED7C7C528CA}.Release|x86.Build.0 = Release|x86
{8855EC73-F6A1-43D3-AFBC-04A3E09F9BD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8855EC73-F6A1-43D3-AFBC-04A3E09F9BD9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8855EC73-F6A1-43D3-AFBC-04A3E09F9BD9}.Debug|x64.ActiveCfg = Debug|Any CPU
{8855EC73-F6A1-43D3-AFBC-04A3E09F9BD9}.Debug|x64.Build.0 = Debug|Any CPU
{8855EC73-F6A1-43D3-AFBC-04A3E09F9BD9}.Debug|x86.ActiveCfg = Debug|Any CPU
{8855EC73-F6A1-43D3-AFBC-04A3E09F9BD9}.Debug|x86.Build.0 = Debug|Any CPU
{8855EC73-F6A1-43D3-AFBC-04A3E09F9BD9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8855EC73-F6A1-43D3-AFBC-04A3E09F9BD9}.Release|Any CPU.Build.0 = Release|Any CPU
{8855EC73-F6A1-43D3-AFBC-04A3E09F9BD9}.Release|x64.ActiveCfg = Release|Any CPU
{8855EC73-F6A1-43D3-AFBC-04A3E09F9BD9}.Release|x64.Build.0 = Release|Any CPU
{8855EC73-F6A1-43D3-AFBC-04A3E09F9BD9}.Release|x86.ActiveCfg = Release|Any CPU
{8855EC73-F6A1-43D3-AFBC-04A3E09F9BD9}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5D30E174-2538-47AC-8443-318C8C5DC2C9} = {C397A34C-84F1-49E7-AEBC-2F9F2B196216}
Expand Down
7 changes: 4 additions & 3 deletions Content/Library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ src/MyCoolNewLib/bin/
- `GitRelease` - Creates a commit message with the [Release Notes](https://fake.build/apidocs/v5/fake-core-releasenotes.html) and a git tag via the version in the `Release Notes`.
- `GitHubRelease` - Publishes a [GitHub Release](https://help.github.com/en/articles/creating-releases) with the Release Notes and any NuGet packages.
- `FormatCode` - Runs [Fantomas](https://github.com/fsprojects/fantomas) on the solution file.
- [`Release`](#Releasing) - Task that runs all release type tasks such as `PublishToNuGet` `GitRelease` and `GitHubRelease`. Make sure to read [Releasing](#Releasing) to setup your environment correctly for releases.


- `BuildDocs` - Generates Documentation from `docsSrc` and the [XML Documentation Comments](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/) from your libraries in `src`.
- `WatchDocs` - Generates documentation and starts a webserver locally. It will rebuild and hot reload if it detects any changes made to `docsSrc` files, libraries in `src`, or the `docsTool` itself.
- `ReleaseDocs` - Will stage, commit, and push docs generated in the `BuildDocs` target.
- [`Release`](#Releasing) - Task that runs all release type tasks such as `PublishToNuGet`, `GitRelease`, `ReleaseDocs`, and `GitHubRelease`. Make sure to read [Releasing](#Releasing) to setup your environment correctly for releases.
---


Expand Down
101 changes: 100 additions & 1 deletion Content/Library/build.fsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#load ".fake/build.fsx/intellisense.fsx"
#load "docsTool/CLI.fs"
#if !FAKE
#r "Facades/netstandard"
#r "netstandard"
Expand All @@ -17,6 +18,8 @@ open Fake.BuildServer
open Fantomas
open Fantomas.FakeHelpers



BuildServer.install [
AppVeyor.Installer
Travis.Installer
Expand Down Expand Up @@ -65,14 +68,23 @@ let distGlob = distDir @@ "*.nupkg"
let coverageThresholdPercent = 80
let coverageReportDir = __SOURCE_DIRECTORY__ @@ "docs" @@ "coverage"


let docsDir = __SOURCE_DIRECTORY__ @@ "docs"
let docsSrcDir = __SOURCE_DIRECTORY__ @@ "docsSrc"
let docsToolDir = __SOURCE_DIRECTORY__ @@ "docsTool"

let gitOwner = "MyGithubUsername"
let gitRepoName = "MyLib.1"

let gitHubRepoUrl = sprintf "https://github.com/%s/%s" gitOwner gitRepoName

let releaseBranch = "master"
let releaseNotes = Fake.Core.ReleaseNotes.load "RELEASE_NOTES.md"

let publishUrl = "https://www.nuget.org"

let docsSiteBaseUrl = sprintf "https://%s.github.io/%s" gitOwner gitRepoName

let disableCodeCoverage = environVarAsBoolOrDefault "DISABLE_COVERAGE" false

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -119,6 +131,9 @@ module dotnet =
let watch cmdParam program args =
DotNet.exec cmdParam (sprintf "watch %s" program) args

let run cmdParam args =
DotNet.exec cmdParam "run" args

let tool optionConfig command args =
DotNet.exec optionConfig (sprintf "%s" command) args
|> failOnBadExitAndPrint
Expand All @@ -129,6 +144,49 @@ module dotnet =
let sourcelink optionConfig args =
tool optionConfig "sourcelink" args

let fcswatch optionConfig args =
tool optionConfig "fcswatch" args

open DocsTool.CLIArgs
module DocsTool =
open Argu
let buildparser = ArgumentParser.Create<BuildArgs>(programName = "docstool")
let buildCLI =
[
BuildArgs.SiteBaseUrl docsSiteBaseUrl
BuildArgs.ProjectGlob srcGlob
BuildArgs.DocsOutputDirectory docsDir
BuildArgs.DocsSourceDirectory docsSrcDir
BuildArgs.GitHubRepoUrl gitHubRepoUrl
BuildArgs.ProjectName gitRepoName
BuildArgs.ReleaseVersion releaseNotes.NugetVersion
]
|> buildparser.PrintCommandLineArgumentsFlat

let build () =
dotnet.run (fun args ->
{ args with WorkingDirectory = docsToolDir }
) (sprintf " -- build %s" (buildCLI))
|> failOnBadExitAndPrint

let watchparser = ArgumentParser.Create<WatchArgs>(programName = "docstool")
let watchCLI =
[
WatchArgs.ProjectGlob srcGlob
WatchArgs.DocsOutputDirectory docsDir
WatchArgs.DocsSourceDirectory docsSrcDir
WatchArgs.GitHubRepoUrl gitHubRepoUrl
WatchArgs.ProjectName gitRepoName
WatchArgs.ReleaseVersion releaseNotes.NugetVersion
]
|> watchparser.PrintCommandLineArgumentsFlat

let watch projectpath =
dotnet.watch (fun args ->
{ args with WorkingDirectory = docsToolDir }
) "run" (sprintf "-- watch %s" (watchCLI))
|> failOnBadExitAndPrint

//-----------------------------------------------------------------------------
// Target Implementations
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -359,6 +417,36 @@ let formatCode _ =
| _ -> ()
)


let buildDocs _ =
DocsTool.build ()

let watchDocs _ =
let watchBuild () =
!! srcGlob
|> Seq.map(fun proj -> fun () ->
dotnet.watch
(fun opt ->
opt |> DotNet.Options.withWorkingDirectory (IO.Path.GetDirectoryName proj))
"build"
""
|> ignore
)
|> Seq.iter (invokeAsync >> Async.Catch >> Async.Ignore >> Async.Start)
watchBuild ()
DocsTool.watch ()

let releaseDocs ctx =
isReleaseBranchCheck ()

Git.Staging.stageAll docsDir
Git.Commit.exec "" (sprintf "Documentation release of version %s" releaseNotes.NugetVersion)
if isRelease (ctx.Context.AllExecutingTargets) |> not then
// We only want to push if we're only calling "ReleaseDocs" target
// If we're calling "Release" target, we'll let the "GitRelease" target do the git push
Git.Branches.push ""


//-----------------------------------------------------------------------------
// Target Declaration
//-----------------------------------------------------------------------------
Expand All @@ -377,12 +465,15 @@ Target.create "GitRelease" gitRelease
Target.create "GitHubRelease" githubRelease
Target.create "FormatCode" formatCode
Target.create "Release" ignore

Target.create "BuildDocs" buildDocs
Target.create "WatchDocs" watchDocs
Target.create "ReleaseDocs" releaseDocs

//-----------------------------------------------------------------------------
// Target Dependencies
//-----------------------------------------------------------------------------


// Only call Clean if DotnetPack was in the call chain
// Ensure Clean is called before DotnetRestore
"Clean" ?=> "DotnetRestore"
Expand All @@ -394,6 +485,14 @@ Target.create "Release" ignore
"GenerateAssemblyInfo" ?=> "DotnetBuild"
"GenerateAssemblyInfo" ==> "PublishToNuGet"

"DotnetBuild" ==> "BuildDocs"
"BuildDocs" ==> "ReleaseDocs"
"BuildDocs" ?=> "PublishToNuget"
"DotnetPack" ?=> "BuildDocs"
"GenerateCoverageReport" ?=> "ReleaseDocs"

"DotnetBuild" ==> "WatchDocs"

"DotnetRestore"
==> "DotnetBuild"
==> "DotnetTest"
Expand Down
3 changes: 3 additions & 0 deletions Content/Library/docsSrc/Explanations/Background.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Background

Here's a core concept and reasons why this exists at a deeper level.
2 changes: 2 additions & 0 deletions Content/Library/docsSrc/How_Tos/Doing_A_Thing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# How To do this specific thing

2 changes: 2 additions & 0 deletions Content/Library/docsSrc/How_Tos/Doing_Another_Thing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# How To do this specific thing

13 changes: 13 additions & 0 deletions Content/Library/docsSrc/Tutorials/Getting_Started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Getting Started

```fsharp
let foo = ()
let myAge = 21
```

## Here is the path to downloading

[lang=bash]
paket install MyLib.1


4 changes: 4 additions & 0 deletions Content/Library/docsSrc/content/hotload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var refreshSocket = new WebSocket('ws://' + window.location.host)
.onmessage = () => {
location.reload();
}
Loading