Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Improving C,C++, C# Code Detection #7065

Closed
4 tasks done
ValerioOniride opened this issue Apr 19, 2024 · 4 comments
Closed
4 tasks done

Improving C,C++, C# Code Detection #7065

ValerioOniride opened this issue Apr 19, 2024 · 4 comments

Comments

@ValerioOniride
Copy link

Context

After several attempts with the extra.css file and experimenting with different language combinations, including C#, I've concluded it's necessary to submit this request

Description

I would like to request an enhancement for the code block parsing capability, specifically to improve its recognition of key elements within C#, C++, and C code blocks. I suggest augmenting the parser to identify and classify these elements with a similar accuracy and granularity as demonstrated in the example provided in the Vsuals section."

Related links

Use Cases

Enhancing the API's code block parsing will improve code clarity for both authors and users, ensuring better communication of intended messages. This change will expedite learning and development within the community, aligning with the project's goal of providing accessible documentation and fostering collaboration.

Visuals

Screenshot 2024-04-19 113641

immagine

Before submitting

@alexvoss
Copy link
Sponsor Collaborator

Hi,

the code highlighting is configurable. Which options have you tried and what did you not manage to achieve?

Please note that there is probably nothing to be done in Material for MkDocs per se. Either Pygments or Highlight.js would need to accept a change request. If you decide to contact them, please try to be more specific about what does not work for you and make sure to document what you have tried.

@ValerioOniride
Copy link
Author

I haven't tried Highlight.js, im using this .yml configuration:
markdown_extensions:

  • pymdownx.highlight:
    anchor_linenums: true
    use_pygments: true
  • pymdownx.inlinehilite
  • pymdownx.snippets:
    base_path: ["overrides"]
  • pymdownx.blocks.admonition
  • pymdownx.arithmatex:
    generic: true
  • footnotes
  • pymdownx.blocks.details
  • pymdownx.superfences
  • pymdownx.mark
  • pymdownx.keys
  • attr_list
  • pymdownx.emoji:
    emoji_index: !!python/name:material.extensions.emoji.twemoji
    emoji_generator: !!python/name:material.extensions.emoji.to_svg

The issue i'm facing is that i don't like the result of the codeblock highlight, could you help me setting up highlight.js to make a test with?

@alexvoss
Copy link
Sponsor Collaborator

All you need is in the documentation but since we don't have an example in our example repository yet, I just put one together. You need to change the code block to the language you want.

9.5.18-code-highlight-javascript-example.zip

@squidfunk
Copy link
Owner

Converting to discussion, since this is essentially a customization request.

Repository owner locked and limited conversation to collaborators Apr 19, 2024
@squidfunk squidfunk converted this issue into discussion #7066 Apr 19, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants