dadhi / CsToMd

Visual Studio extension and Dotnet CLI Tool to generate the Markdown Docs from the C# Tests keeping your Docs and Tests in sync!
MIT License
35 stars 4 forks source link

Question: how is the table of contents created? #11

Closed Nednilrev closed 4 years ago

Nednilrev commented 4 years ago

Hi, I noticed that your Decorator.cs file contained '[TOC]' and that the output automagically contains the table of contents with all the headers on the page. How does this work? (sorry for the noob question that may be unrelated to CsToMd, but didn't know where to ask it).

dadhi commented 4 years ago

Hi @Nednilrev

I am not using TOC anymore. It was a custom extension understood by BitBucket wiki but not by GitHub.

Instead I am using the markdown plugin for VSCode ehich has a command Create Table of Contents.. and Update Table of Contents, and also shows the hint when the toc is outdated.

So first I am generating the .md file without the toc, then creating the toc in .md file via plugin, and copy-paste it into the original .cs file.

I will post the gif with the my workflow later and probably add this explanation into the readme.

Nednilrev commented 4 years ago

Thanks for the explanation. I use the md viewer extension for chrome, which generates a toc automatically, but it's on the left of the page. I prefer it to be in the md itself, though.

dadhi commented 4 years ago

@Nednilrev

Here is the gif ;)

CsToMd_TOC

Nednilrev commented 4 years ago

@dadhi Thanks for the gif and the tip! Will definitely give this plugin a try. So far, I've been using the Mardown Editor plugin. By the way, love the latest features of your plugin!

Nednilrev commented 4 years ago

Just wanted to come back to say that 'Markdown all in one' is only available for Visual Studio Code, and not for Visual Studio 2019.

dadhi commented 4 years ago

@Nednilrev Yes. I am lately rarely using the VS.. There is a plugins for VS. But not sure about their TOC capabilities, so my answer would be to have VSCode opened nearby for the TOC.

If you find a more straightforward way, please give me a notice. Thanks.