Skip to content

Instantly share code, notes, and snippets.

@mdschweda
Last active April 3, 2023 16:28
Show Gist options
  • Save mdschweda/08d82c27d392e6f0a35fbadf0d2e28e7 to your computer and use it in GitHub Desktop.
Save mdschweda/08d82c27d392e6f0a35fbadf0d2e28e7 to your computer and use it in GitHub Desktop.
Multiple projects DocFX structure
{
"metadata": [
{
"src": [
{
"files": "src/ProjectA/**.cs",
"exclude": [
"**/obj/**",
"**/bin/**"
],
"src": ".."
}
],
"dest": "api/ProjectA"
},
{
"src": [
{
"files": "src/ProjectB/**.cs",
"exclude": [
"**/obj/**",
"**/bin/**"
],
"src": ".."
}
],
"dest": "api/ProjectB"
}
],
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/**/index.md"
]
},
{
"files": [
"articles/**.md",
"articles/**/toc.yml",
"toc.yml",
"*.md"
],
"exclude": [
"obj/**",
"bin/**"
]
}
],
"resource": [
{
"files": [
"images/**"
],
"exclude": [
"obj/**"
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**"
]
}
],
"dest": "_site",
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": [
"default"
],
"postProcessors": [],
"noLangKeyword": false
}
}
+-- doc
⁞ +-- api
⁞ ⁞ +-- ProjectA
⁞ ⁞ ⁞ +-- index.md
⁞ ⁞ +-- ProjectB
⁞ ⁞ +-- index.md
⁞ +-- docfx.json
⁞ +-- toc.yml
+-- src
+-- ProjectA
+-- ProjectB
- name: Welcome
href: articles/
- name: Project A
href: api/ProjectA
homepage: api/ProjectA/index.md
- name: Project B
href: api/ProjectB
homepage: api/ProjectB/index.md
@alimhabib
Copy link

I got this error [19-10-04 10:11:55.892]Warning:BuildCommand.BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor.Prebuild.BuildTocDocumentUnable to find either toc.yml or toc.md inside articles/. Make sure the file is included in config file docfx.json!
[19-10-04 10:11:55.893]Warning:BuildCommand.BuildCore.Build Document.LinkPhaseHandlerWithIncremental.TocDocumentProcessor.SaveInvalid file link:(/api/xxx/index.md).
[19-10-04 10:11:55.893]Warning:BuildCommand.BuildCore.Build Document.LinkPhaseHandlerWithIncremental.TocDocumentProcessor.SaveInvalid file link:(
/api/xxx).
[19-10-04 10:11:55.894]Warning:BuildCommand.BuildCore.Build Document.LinkPhaseHandlerWithIncremental.TocDocumentProcessor.SaveInvalid file link:(/api/xx).
[19-10-04 10:11:55.895]Warning:BuildCommand.BuildCore.Build Document.LinkPhaseHandlerWithIncremental.TocDocumentProcessor.SaveInvalid file link:(
/api/xx/index.md).
5 Warning(s)
0 Error(s)

can you help me with those warning, I see that index.md per api project never get generated

@mdschweda
Copy link
Author

mdschweda commented Oct 9, 2019

I got this error [19-10-04 10:11:55.892]Warning:BuildCommand.BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor.Prebuild.BuildTocDocumentUnable to find either toc.yml or toc.md inside articles/. Make sure the file is included in config file docfx.json!
[19-10-04 10:11:55.893]Warning:BuildCommand.BuildCore.Build Document.LinkPhaseHandlerWithIncremental.TocDocumentProcessor.SaveInvalid file link:(/api/xxx/index.md). [19-10-04 10:11:55.893]Warning:BuildCommand.BuildCore.Build Document.LinkPhaseHandlerWithIncremental.TocDocumentProcessor.SaveInvalid file link:(/api/xxx).
[19-10-04 10:11:55.894]Warning:BuildCommand.BuildCore.Build Document.LinkPhaseHandlerWithIncremental.TocDocumentProcessor.SaveInvalid file link:(/api/xx). [19-10-04 10:11:55.895]Warning:BuildCommand.BuildCore.Build Document.LinkPhaseHandlerWithIncremental.TocDocumentProcessor.SaveInvalid file link:(/api/xx/index.md).
5 Warning(s)
0 Error(s)

can you help me with those warning, I see that index.md per api project never get generated

Do you get any MSBuild errors when running docfx build doc/docfx.json?

@virzak
Copy link

virzak commented Dec 19, 2021

does this work for docfx v3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment