Highlight Lines (hl_lines) didnt match up with Line Numbers (linenums) #5234
-
ContextAFAIK I expect Issue DescriptionFor example I have the code like this
for which will be rendered as adding the specific highlights instead, the result is a bit different Suggestion:Though I would not say it is demanding as I think this is a niche unworthy work that needs not and should not to be prioritized. But if you are interested, I have some ideas that you might wanna expand: Relative Highlight: Using Code Wrappers: Wrap a bunch of code that allows the user to toggle collapsible Range RelativeHighlight: Dimish Unimportant: To get rid of those unimportant parts with a shady darker brightness Mouse Coordination: To know the current position of the mouse on the code (Row, Column) with a vertical and horizontal highlight Code Pointer: Toggle for the user to be able to move around the code using arrows keys Hover Note: Like code annotation, but specifies note on sideways upon hovering Minimal Base Yamlimage: python:latest
pages:
stage: deploy
script:
- pip install git<private link>
- mkdocs build --site-dir public
artifacts:
paths:
- public
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' features:
- content.code.select
- content.code.copy
markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
use_pygments: true
auto_title: true
linenums: true
linenums_style: pymdownx-inline
pygments_lang_class: true
line_spans: __span
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences Related Linkshttps://squidfunk.github.io/mkdocs-material/reference/code-blocks/?h=hl+lines#highlighting-specific-lines BrowserChrome Before Startings The Discussions
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The Material theme does control this. I believe this would be a request for https://github.com/facelessuser/pymdown-extensions.
This is definitely not a bug but works as intended. Now, it may be that it is desired that enhance this with an optional setting, if so, feel free to create a feature request over at Pymdown Extensions. I'll have to make a decision on whether to add the feature, but I'd at least get an issue created if you are really wanting it. |
Beta Was this translation helpful? Give feedback.
The Material theme does control this. I believe this would be a request for https://github.com/facelessuser/pymdown-extensions.
hl_lines
highlights the line you tell it to.linenums
is a cosmetic change making the line numbers visible and allowing you to remap them relative to some new start.This is definitely not a bug but works as intended. Now, it may be that it is desired that enhance this with an optional setting, if so, feel free to create a feature request over at Pymdown Extensions. I'll have to make a decision on whether to add the feature, but I'd at least get an issue created if you are really wanting it.