docascode/docfx-feature-proposals

Ability to include a `toc.yml` file to generate a hierarchical list of links on the page

icnocop asked for this feature over 3 years ago — 1 comment

icnocop commented over 3 years ago

I'd like to be able to include a toc.yml file in a markdown file and have docfx generate a hierarchical list of links on the generated page.

For example, given the file structure:
docfx.json
index.md
toc.yml
articles/
toc.yml
topic1.md
topic1a.md
topic1b.md
topic2.md
topic3.md
topic3a.md

The contents of the root toc.yml:
- name: Help
href: articles/

The contents of articles/toc.yml:
- name: Topic 1
href: topic1.md
items:
- name: Topic 1 a
href: topic1a.md
- name: Topic 1 b
href: topic1b.md
- name: Topic 2
href: topic2.md
- name: Topic 3
href: topic3.md
items:
- name: Topic 3 a
href: topic3a.md

I would like to be able to the have a hierarchical list of links generated on the index page.

For example, if index.md contains:
[!include[](articles/toc.yml)]

I would like the generated index.html to contain something like this:
Topic 1 Topic 1 a Topic 1 b Topic 2 Topic 3 Topic 3 a

Thank you!

Join the discussion!

Sign-in with GitHub to comment