Skip to content

Commit 414b8c1

Browse files
authored
Merge PR #374: Update Docs generation
* Fix docfx metadata generation * Move CI scripts to separate files and add docfx generation * Fix typos and add more output * Fix directory traversal for docfx and change output colors * Fix swapped output logic * Add basic docfx template * Update docfx.json to use template * Update year and repo URL
1 parent 56cbe99 commit 414b8c1

File tree

8 files changed

+121
-5
lines changed

8 files changed

+121
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,4 @@ paket-files/
252252
*.sln.iml
253253
/test/ICSharpCode.SharpZipLib.TestBootstrapper/Properties/launchSettings.json
254254
_testRunner/
255+
docs/help/api/.manifest

appveyor.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,17 @@ nuget:
1818
disable_publish_on_pr: true
1919
before_build:
2020
- ps: nuget restore ICSharpCode.SharpZipLib.sln
21+
- ps: .\tools\appveyor-docfx-init.ps1
2122
build:
2223
project: ICSharpCode.SharpZipLib.sln
2324
publish_nuget: true
2425
publish_nuget_symbols: true
2526
verbosity: normal
27+
after_build:
28+
- ps: .\tools\appveyor-docfx-build.ps1
2629
test_script:
27-
- ps: tools/appveyor-test.ps1
30+
- ps: tools\appveyor-test.ps1
31+
artifacts:
32+
- path: docs\help\_site
33+
type: zip
34+
name: Documentation

docs/help/docfx.json

+12-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
]
1515
}
1616
],
17-
"dest": "api"
17+
"dest": "api",
18+
"properties": {
19+
"TargetFramework": "NETSTANDARD2"
20+
}
1821
}
1922
],
2023
"build": {
@@ -62,17 +65,22 @@
6265
],
6366
"globalMetadata": {
6467
"_appTitle": "SharpZipLib Help",
65-
"_appFooter": "Copyright © 2000-2017 SharpZipLib Contributors"
68+
"_appFooter": "Copyright © 2000-2019 SharpZipLib Contributors",
69+
"_gitContribute": {
70+
"repo": "https://github.com/icsharpcode/SharpZipLib",
71+
"branch": "master"
72+
}
6673
},
6774
"dest": "_site",
6875
"globalMetadataFiles": [],
6976
"fileMetadataFiles": [],
7077
"template": [
71-
"default"
78+
"default",
79+
"template"
7280
],
7381
"postProcessors": [],
7482
"noLangKeyword": false,
7583
"keepFileLink": false,
7684
"cleanupCacheHistory": false
7785
}
78-
}
86+
}

docs/help/template/logo.svg

+34
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<nav id="autocollapse" class="navbar navbar-default ng-scope" role="navigation">
2+
<div class="container">
3+
<div class="navbar-header">
4+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
5+
<span class="sr-only">Toggle navigation</span>
6+
<span class="icon-bar"></span>
7+
<span class="icon-bar"></span>
8+
<span class="icon-bar"></span>
9+
</button>
10+
{{>partials/logo}}
11+
</div>
12+
<div class="collapse navbar-collapse" id="navbar">
13+
<form class="navbar-form navbar-right" role="search" id="search">
14+
<div class="form-group">
15+
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
16+
</div>
17+
</form>
18+
</div>
19+
</div>
20+
</nav>

docs/help/template/styles/main.css

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
button, a {
2+
color: #516d86;
3+
cursor: pointer;
4+
}
5+
6+
.navbar-default .navbar-nav>.active>a, .navbar-default .navbar-nav>.active>a:focus, .navbar-default .navbar-nav>.active>a:hover {
7+
color: #181c20;
8+
background-color: #c4cdd4;
9+
}
10+
11+
svg:hover path {
12+
fill: currentColor;
13+
}
14+
15+
.navbar-default .navbar-brand:focus, .navbar-default .navbar-brand:hover {
16+
color: #3d4852;
17+
}

tools/appveyor-docfx-build.ps1

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
if(-Not $env:APPVEYOR_PULL_REQUEST_TITLE -and $env:CONFIGURATION -eq "Release")
2+
{
3+
pushd docs\help
4+
# & docfx metadata
5+
& docfx docfx.json
6+
if ($lastexitcode -ne 0){
7+
throw [System.Exception] "docfx build failed with exit code $lastexitcode."
8+
}
9+
popd
10+
<#
11+
## Useful for automatically updating gh pages:
12+
13+
git config --global credential.helper store
14+
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:access_token):[email protected]`n"
15+
git config --global user.email $env:op_build_user_email
16+
git config --global user.name $env:op_build_user
17+
git clone https://github.com/ICSharpCode/SharpZipLib.git -b gh-pages origin_site -q
18+
Copy-Item origin_site/.git _site -recurse
19+
CD _site
20+
git add -A 2>&1
21+
git commit -m "CI Updates" -q
22+
git push origin gh-pages -q
23+
#>
24+
}

tools/appveyor-docfx-init.ps1

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if(-Not $env:APPVEYOR_PULL_REQUEST_TITLE -and $env:CONFIGURATION -eq "Release")
2+
{
3+
git checkout $env:APPVEYOR_REPO_BRANCH -q
4+
choco install docfx -y
5+
}

0 commit comments

Comments
 (0)