Ellerbach / docfx-companion-tools

A suite of tools, pipelines templates to take the very best of DocFX
MIT License
66 stars 18 forks source link

Files index.md are ignored by TocDocFxCreation #1

Closed sacrejohn closed 3 years ago

sacrejohn commented 3 years ago

Hello,

I don't understand why the index.md files are ignored by TocDocFxCreation and don't appear in the toc file ?

Regards,

Jonathan

Ellerbach commented 3 years ago

Hi, can you give a bit more context? index.md files are definitively used. There is even an option to create them if they are not present.

sacrejohn commented 3 years ago

Example :

I have a directory test containing 3 files :

I execute TocDocFxCreation in this directory :

TocDocFxCreation.exe -d test

Desired file :

# This is an automatically generated file
items:
- name: Index
  href: index.md
- name: File1
  href: file1.md
- name: File2
  href: file2.md

Resulting file :

# This is an automatically generated file
items:
- name: File1
  href: file1.md
- name: File2
  href: file2.md

test.zip

Ellerbach commented 3 years ago

I execute TocDocFxCreation in this directory :

TocDocFxCreation.exe -d test

Use the -i option to create and use the index. So TocDocFxCreation.exe -d test -i should work for your scenario.

sacrejohn commented 3 years ago

I tried with the -i option, but it does not solve my problem.

According to my tests, if a subdirectory does not contain an index.md file, the index.md file is created and is referenced in the toc file, but if it already exists it is also ignored in the subdirectory.

Another point, the -i option does not create an index.md file at the root of the test directory.

test.zip

Ellerbach commented 3 years ago

Another point, the -i option does not create an index.md file at the root of the test directory.

So that then maybe your issue. Just checked on an existing project where the TOC is build automatically, and correct, the root one seems ignored. As it's in the default page, it always shows up because it's pointed out in the main TOC.

@mtirion maybe something you want to look at?

mtirionMSFT commented 3 years ago

I see the same issue. I'll investigate and fix

mtirion commented 3 years ago

Issue fixed. INDEX.md's were ignored, but not anymore.

sacrejohn commented 3 years ago

Thank you