question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Yaml Code highlite

See original GitHub issue

Description

Hi,

I am using the last Docker images, and I try to get my Yaml code highlighted but seems not working.

Here my mkdocs.yml

site_name: test
theme:
  name: 'material'
  palette:
    primary: 'blue'
    accent: 'blue'

markdown_extensions:
  - codehilite
  - admonition
  - pymdownx.details
  - pymdownx.critic
  - pymdownx.superfences
  - pymdownx.mark

pages:
- 'Home': index.md
- 'Requirements': Requirements.md

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:19 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
shinji62commented, Jul 25, 2018

It works !!! Thanks !!!

1reaction
facelessusercommented, Jul 23, 2018

@markainick, that isn’t what I meant. I meant, don’t use Pygments, but instead use a JavaScript based syntax highlighter like highlight.js or something else. You’d have to disable pygments use in things like CodeHilite. You’d have to look at their documentation and use the appropriate option. Then you’d have to include the JS highlighter and theme of your choice, and possible configuration. I unfortunately don’t have a step by step guide handy at this moment.

In short, there are only three options:

  • Accept that Pygments isn’t going to highlight yaml like you like. It does highlight certain things in yaml, but maybe just not to the level you are used to. This is fine for me in my projects, but I can understand that it may bother some people.
  • Quote your keys to make them different like @squidfunk, suggested. This isn’t ideal as it forces you to present yaml in a very specific way for the sake of highlighting, but there is nothing wrong with this approach.
  • Or use a different highlighter than Pygments. You’ll have to disable Pygments use in Python Markdown extensions that are applicable and references the JS highlighter’s documentation of your choice to see how to include and use it.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Highlight YAML - Online YAML Tools
Free, quick and easy online utility that highlights YAML syntax right in your browser. There are no ads or downloads. Simply enter YAML...
Read more >
Syntax Highlighting in YAML Documents - Oxygen XML Editor
Syntax Highlighting in YAML Documents · Open the Preferences dialog box . · Go to Editor > Syntax Highlight. · Select and expand...
Read more >
andreazorzetto/yh: YAML syntax highlighter to bring ... - GitHub
A dummy syntax highlighter that brings colours to YAML output, jq style. This project starts with the author's incapacity to give up on...
Read more >
Inline YAML Syntax Highlighting - Visual Studio Marketplace
Inline YAML Syntax Highlighting. Provides basic inline, template literal syntax highlighting through grammar injection for ...
Read more >
YAML Syntax Highlighting - TeX - LaTeX Stack Exchange
The »minted« package is your friend here. It uses Python Pygments as back-end for syntax highlighting. And one of the Pygments lexers is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found