Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add .NET namespace information in DocFX

Tags:

docfx

The title says it all ...

In Sandcastle Help File Builder we added the NamespaceDoc class to each namespace to create namespace documentation.

How do we to the same using DocFX?

like image 214
AxD Avatar asked Jan 04 '18 00:01

AxD


1 Answers

Here's how I did it:

  1. In the root folder of your documentation project, add a folder named namespaces.
  2. Update your docfx.json file to include markup files added to the namespaces folder. You need to update the overwrite property in the build section. It will look something like this:
    "overwrite": [
      {
        "files": [
          "apidoc/**.md",
          "namespaces/**.md"
        ],
        "exclude": [
          "obj/**",
          "_site/**"
        ]
      }
    ],
  1. Create a markdown file in the namespaces folder for every namespace you want to add documentation to. It is probably best to name these files the same as the namespace.

    The files should have a YAML header with a UID that matches the namespace's name. The summary: *content line tells docfx to overwrite the summary of the namespace with the contents of this file.

    The rest of the page is standard markdown that will become the namespace's summary. For example:

    ---
    uid: My.Groovy.Namespace
    summary: *content
    ---
    The My.Groovy.Namespace namespace contains a bunch of classes and interfaces.

like image 64
Doug Clutter Avatar answered Oct 31 '22 14:10

Doug Clutter