<code> tag extension to support a 'lang' or 'language' attribute.#127
Open
WetHat wants to merge 3 commits intoejball:masterfrom
Open
<code> tag extension to support a 'lang' or 'language' attribute.#127WetHat wants to merge 3 commits intoejball:masterfrom
WetHat wants to merge 3 commits intoejball:masterfrom
Conversation
inspecting the 'lang' or 'language' attribute of the tag. Enhanced the TrimCode method to inspect the entire code (not just the first line) to figure out the optimal indentation length.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The motivation for this pull request is the poor (non-existing) support for code language in
<code>sections by the XML documentation specification: D.3.3<code>. Oftentimes it is necessary to include code fragments in the documentation which are not CSHARP. Typical examples include XML, HTML, Javascript , or mermaid diagram code. To support these use cases the other tools such as the Sandcastle help file build allowadditional
langorlanguageattributes on the<code>tag.Example:
would be converted to this Markdown fenced block:
In the code changes provided in this pull request I have:
langorlanguageattributes to generate Markdown output as shown in the example above.TrimCodemethod to be smarter about finding the optimal indent length of a code block.I hope you find this contribution useful.
WetHat