Comments (2)
1. Verify TOC File Content:
Ensure that the toc.yml
and docs/toc.yml
files are correctly formatted. Check for proper indentation, correct file paths, and valid YAML syntax.
2. Check Navigation Configuration:
Confirm that your docfx.json
file is referencing the correct TOC files and that these files are included in the content
section of your build configuration.
3. Template Configuration:
Review the template configuration in docfx.json
. Ensure that the selected templates (default
, modern
, etc.) support the navigation elements you expect (top menubar and TOC sidebar).
4. Home/Index File Configuration:
Ensure that your index.md
file in the root folder contains appropriate metadata or configuration to link to the TOC and navigate to different sections of the documentation.
5. Serve Command:
When using docfx --serve
, check the console output for any error messages related to template rendering or missing files. This might provide clues about what's causing the navigation elements to not appear.
6. Template Overrides (if necessary):
If the default templates are not displaying as expected, consider creating custom overrides for templates or modifying existing templates to include the desired navigation elements.
7. DocFX Version Compatibility:
Although you mentioned using the latest version, sometimes certain features or behaviors might differ between versions. Consider checking for any GitHub issues or release notes related to navigation or TOC rendering in your specific version of DocFX.
Example Index.md Configuration:
Ensure that your index.md
contains proper metadata to link to the TOC and define the structure of the homepage:
---
uid: index
title: Home
---
# Welcome to Documentation
- [Introduction](docs/introduction.md)
- [Getting Started](docs/start.md)
- [API Documentation](api/index.html) <!-- Replace with the actual link to your API documentation -->
from docfx.
Thank you for your precious troubleshooting hints! I realized my script was just missing the top-level toc.yml
file, as I had to change the default one to fit my directory structure and I forgot to adjust it accordingly.
So in the end, for those like me using a default directory structure in a VS solution, where the .sln
file is at the root, and each project .csproj
is under its subfolder, and additionally you have all of your conceptual documentation under a docs
subfolder (with their images under docs/img
), you can follow these steps:
- of course, ensure to install
docfx
:dotnet tool update -g docfx
(globally). - under the solution root folder, create a new project:
docfx init
. - adjust the created
docfx.json
folder like this:
{
"metadata": [
{
"src": [
{
"src": ".",
"files": ["**/*.csproj"],
"exclude": ["**/*.Test.csproj", "**/bin/**", "**/obj/**"]
}
],
"dest": "api"
}
],
"build": {
"content": [
{
"files": [
"toc.yml",
"index.md",
"docs/**/*.md",
"docs/**/*.yml",
"api/**.yml",
"api/index.md"
],
"exclude": ["_site/**", "docs/old/**"]
}
],
"resource": [
{
"files": ["docs/img/**"]
}
],
"output": "_site",
"template": ["default", "modern"],
"globalMetadata": {
"_appName": "APPNAME",
"_appTitle": "APPTITLE",
"_enableSearch": true,
"pdf": true
}
}
}
I also add _site
and api
to the .gitignore
excluded files so that all what is needed in the repository is docfx.json
, toc.yml
, and index.md
at the root solution level; the content of these folders is generated by the tool and thus can be safely excluded from the repository, which instead includes docs
with its conceptual documentation.
from docfx.
Related Issues (20)
- [Feature Request] Consolidate overloads HOT 1
- How to get Extension Methods to display when using assembly references HOT 4
- [Bug] 'ApiPageDocumentProcessor': Input string was not in a correct format. HOT 1
- [Bug] Broken hrefs with `SeparatePages` when member names collide
- Enable rendering PDF-s with screen media type
- [Feature Request] Support for negative lookahead in regex / Use a more updated version of ECMAScript HOT 1
- [Call to action] Better support for partials (methods,types etc) in C# XML Doc
- Support multiple versions build
- docfx metadata hangs at: Determining projects to restore... Nothing to do. None of the projects specified contain packages to restore. HOT 13
- [Bug] IndexOutOfRangeException with FSharp assembly active pattern
- [Bug] DocFx generates incorrect links in "View Source" when building from a tag in Azure DevOps git repo HOT 3
- [Bug] Anchor links do not respect casing HOT 1
- Only some attributes are pulled into the auto-generated api .yaml files
- [Feature Request] Add support for `AllowUnsafeBlocks` in `properties`
- [Bug] StaticTOC search function does not work on Edge or Firefox HOT 2
- [Feature Request] Generated HTML should be valid XML (XHTML) HOT 1
- [Bug] Metadata extraction fails when C# projects pull in a newer compiler than DocFX ships with
- [Bug] PDF Header/Footer template path parsing HOT 1
- custom css is not applied for downloaded pdf
- [Bug] Generate documentation from dlls HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docfx.