Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Support fenced code block styles that compatible to learn.microsoft.com #9921

Open
filzrev opened this issue May 14, 2024 · 0 comments
Labels
markdown Authoring and presenting content using markdown

Comments

@filzrev
Copy link
Contributor

filzrev commented May 14, 2024

Is your feature request related to a problem? Please describe.

I want to use learn.microsoft.com style codeHeader for Fenced Code Block syntax.

Samples Image:

image
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/aspnetcore-openapi?view=aspnetcore-9.0&tabs=visual-studio#add-and-configure-openapi-document-generation

On above example. csharp fenced code block is rendered with "C#" header div region.

Describe the solution you'd like

Add custom CodeBlockRenderer implementation to support following features.

  • If language is specified (e.g. csharp). Display normalize language name at codeHeader (e.g. C#).
  • Change copy button location/style to learn.microsoft.com style.
  • If language and filename is specified (e.g.: csharp Sample.cs). Display filename at codeHeader (e.g.: Sample.cs) instead of language name. (Some other markdown processor support this kind of features)

Additional context
trailing string after Fenced code block is defined as info string by CommonMark Spec.
Thought info string format is not standardized.
See: https://talk.commonmark.org/t/code-blocks-extension-for-filenames-and-line-numbers/536/9

@yufeih yufeih added the markdown Authoring and presenting content using markdown label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
markdown Authoring and presenting content using markdown
Projects
None yet
Development

No branches or pull requests

2 participants