SeanKilleen
SeanKilleen

Reputation: 8977

How can I surface TOC items within docfx that are not directly tied to content?

I am in the process of porting the NUnit docs from their GitHub wiki to docfx.

I am trying to understand if this is expected behavior or if there is something I can do within my config file to prevent it.

  1. Pull nunit/docs repo
  2. cd docs
  3. docfx build; docfx serve

Actual Behavior

Articles are shown for "runn" because the content article titles contain that phrase

image

Articles are shown for "runner" because the content article titles contain that phrase

image

Articles are not shown for "running" because none of the content article titles contain that word, even though the TOC item does

image

Expected Behavior

I'd like the "Running Tests" item to show up at least -- preferably with the content pages underneath it as well.


How do I get these TOC items to surface in the search? Do I need to add content to them so they are treated as pages?

Upvotes: 1

Views: 356

Answers (1)

SeanKilleen
SeanKilleen

Reputation: 8977

OK, I figured it out -- it appears the topicHref is what I'm looking for in these cases.

In my example above, I modified my toc.yml to set the topicHref to be the first item in the child toc.yml file.

- name: Running Tests
  href: running-tests/toc.yml
  topicHref: running-tests/Console-Runner.md

Now, when I search for "Running" as above, I see the expected result:

image

Upvotes: 1

Related Questions