lijunle / Vsxmd

VS XML documentation -> Markdown syntax.
MIT License
215 stars 51 forks source link

Is there a hidden option to not escape backticks? #73

Open metaleap opened 4 years ago

metaleap commented 4 years ago

Loving this, here's my Vsxmd-generated result .md: https://github.com/metaleap/vscode-appz/tree/master/libs/cs#readme

Wondering if I can pass through all backticks without them getting backslash-escaped as currently happens. These are bindings being generated for various languages (C# being merely one of many) from a .d.ts IDL. So its source doc-comments are reused for all generated code in the appropriate target language syntax and these however do contain "code" formatting with backticks already, also because the major doc scenarios for the audience will be VS-Code hover-tips and markdown files, those generated doc-comments are further slightly augmented by backticks for method param names etc. (you can see those incorporate inside the <summary> — with the benefit of them showing up in VSCode hover-tips, unlike <param> which are still also generated)

Of course I could add a post-build sed step but... :smile:

metaleap commented 4 years ago

Well, I figured out one way to do this via .csproj addition like so, given sed is locally in $PATH:

  <Target Name="ReadmeMdUnescapeBackticks" AfterTargets="Build" BeforeTargets="Publish">
    <Exec Command="sed -i 's/\\`/`/g' $(DocumentationMarkdown)" />
  </Target>

Neat! Feel free to close, the above works for me as a hacky workaround.