I use asp.net WebApi Help Page to generate the document from comments of source code. And I have used doxygen to generate the document before. The doxygen can parse markdown syntax in the comments and output the well formatted documents. But the WebApi Help Page could not parse markdown syntax now.
For example, the foo
function's comments contain Markdown comments, and it will be output as ### Markdown comments *It will return "foo" *It always returns "foo"
in WebApi Help Page.
public MyApiController : ApiController {
///<summary>
/// It will return "foo"
/// ### Markdown comments
/// * It will return "foo"
/// * It always returns "foo"
///</summary>
[HttpPost, ActionName("foo")]
public string Foo() {
return "foo";
}
}
Thanks for the hints, have just modified
HelpPageApiModel.cshtml
1) Install some Markdown library from NuGet, like
MarkdownDeep
2) Add Helper function. Notice, you should trim lines, as
<summery>
is parsed as-is with all trailing whitespaces after newlines. Otherwise all markdown lists etc, wont be correctly parsed.3) Preprocess the documentation string output