dotnet / docfx

Static site generator for .NET API documentation.
https://dotnet.github.io/docfx/
MIT License
4.04k stars 858 forks source link

VB .Net documentation creates code tags with lang-csharp style with the default template. #2030

Open mcurros opened 7 years ago

mcurros commented 7 years ago

DocFX Version Used: 2.23.1

Template used: (default or statictoc or contain custom template) default

Steps to Reproduce:

  1. Create a VB .NET project.
  2. Add some source code with XML documentation.
  3. Add DocFX
  4. Compile.

Expected Behavior: All code blocks should be created with class vbnet for .vb files.

Actual Behavior: Only XML comments with example tags are generated with vbnet class. Syntax, constructors, methods and declaration are all with lang-csharp class, so the code shown is csharp, not VB.

vwxyzh commented 7 years ago

@mcurros metadata command always generates the syntax of both csharp and vb, whatever the source files are in csharp or vb, but current default template only takes csharp.

vwxyzh commented 7 years ago

@superyyrrzz can you update the template?

mcurros commented 7 years ago

I will try. Just seems not right, as for the <example> tag it takes into account the extension of the filename being documented, so the example tag is correct, but all the other code is not. If it is possible to do it for the example tag, why not in all the other tags? Or at least I should be able to provide a global hint, does that make sense?

superyyrrzz commented 7 years ago

There's some difference between example and syntax. The content inside example is treated as a piece of Markdown string, so it can keep in original form. For syntax, it's fetched after compiling the source code, and DocFX doesn't konw the original languange after that. A solution is to add a tab to UI to switch between csharp and vb.