Skip to content

Commit c5904b6

Browse files
authored
Create APIdoc as PDF file (#18)
* Add PDF generation in APIdoc * Update azure-pipelines.yml for choco install wkhtmltopdf * Enable noStdIn option for Azure Devops build cf. dotnet/docfx#4719 * Update azure-pipelines.yml for chocolatey debug * Update azure-pipelines.yml for choco verbose logging * Update azure-pipelines.yml for choco debugging * Update azure-pipelines.yml for choco debugging step 2 * Update azure-pipelines.yml for choco debugging step 3 * Update azure-pipelines.yml for choco debugging step 4 * Update azure-pipelines.yml for choco debugging step 5 * Update azure-pipelines.yml for apidoc PDF publish * Update azure-pipelines.yml for api doc PDF explicit path * Add generated pdf to apidoc website * Update README.md with link to APIdoc PDF
1 parent 264fb2a commit c5904b6

5 files changed

Lines changed: 82 additions & 2 deletions

File tree

FollowingFileStream.APIdoc/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
/**/bin/
88
/**/obj/
99
_site
10+
_site_pdf

FollowingFileStream.APIdoc/docfx.json

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,17 @@
2121
}
2222
}
2323
],
24-
"build": {
24+
"pdf": {
25+
"noStdin": true,
2526
"content": [
2627
{
2728
"files": [
2829
"api/**.yml",
2930
"api/index.md"
31+
],
32+
"exclude": [
33+
"**/toc.yml",
34+
"**/toc.md"
3035
]
3136
},
3237
{
@@ -35,13 +40,70 @@
3540
"articles/**/toc.yml",
3641
"toc.yml",
3742
"*.md"
43+
],
44+
"exclude": [
45+
"**/bin/**",
46+
"**/obj/**",
47+
"_site_pdf/**",
48+
"**/toc.yml",
49+
"**/toc.md"
3850
]
51+
},
52+
{
53+
"files": "pdf/toc.yml"
3954
}
4055
],
4156
"resource": [
4257
{
4358
"files": [
4459
"images/**"
60+
],
61+
"exclude": [
62+
"**/bin/**",
63+
"**/obj/**",
64+
"_site_pdf/**"
65+
]
66+
}
67+
],
68+
"overwrite": [
69+
{
70+
"files": [
71+
"apidoc/**.md"
72+
],
73+
"exclude": [
74+
"**/bin/**",
75+
"**/obj/**",
76+
"_site_pdf/**"
77+
]
78+
}
79+
],
80+
"dest": "_site_pdf",
81+
"xrefService": [
82+
"https://xref.docs.microsoft.com/query?uid={uid}"
83+
]
84+
},
85+
"build": {
86+
"content": [
87+
{
88+
"files": [
89+
"api/**.yml",
90+
"api/index.md"
91+
]
92+
},
93+
{
94+
"files": [
95+
"articles/**.md",
96+
"articles/**/toc.yml",
97+
"toc.yml",
98+
"*.md"
99+
]
100+
}
101+
],
102+
"resource": [
103+
{
104+
"files": [
105+
"images/**",
106+
"_site_pdf/*.pdf"
45107
]
46108
}
47109
],
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: Articles
2+
href: ../articles/toc.yml
3+
- name: Api Documentation
4+
href: ../api/toc.yml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Any read operation will not report a zero result while the file is locked for wr
66

77
It is usually compared to the "tail -f" approach.
88

9-
[API Documentation](https://followingfilestream.azurewebsites.net/api-doc)
9+
[API Documentation](https://followingfilestream.azurewebsites.net/api-doc) [[PDF](https://followingfilestream.azurewebsites.net/api-doc/_site_pdf/FollowingFileStream.APIdoc_pdf.pdf)]
1010

1111
[Source Browser](https://followingfilestream.azurewebsites.net/#FollowingFileStream/)
1212

azure-pipelines.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ jobs:
153153
pool:
154154
vmImage: 'windows-latest'
155155
steps:
156+
- task: ChocolateyCommand@0
157+
inputs:
158+
command: 'install'
159+
installPackageId: 'wkhtmltopdf'
160+
156161
# First restore to resolve external dependencies
157162
- task: DotNetCoreCLI@2
158163
displayName: Restore
@@ -175,7 +180,15 @@ jobs:
175180
replaceExistingArchive: true
176181

177182
- task: PublishBuildArtifacts@1
183+
displayName: Publish Website
178184
inputs:
179185
PathtoPublish: '$(Build.ArtifactStagingDirectory)/apidoc_website.zip'
180186
ArtifactName: 'apidoc_website'
187+
publishLocation: 'Container'
188+
189+
- task: PublishBuildArtifacts@1
190+
displayName: Publish PDF
191+
inputs:
192+
PathtoPublish: '$(Build.SourcesDirectory)/FollowingFileStream.APIdoc/_site_pdf/FollowingFileStream.APIdoc_pdf.pdf'
193+
ArtifactName: 'apidoc_pdf'
181194
publishLocation: 'Container'

0 commit comments

Comments
 (0)