squidfunk / mkdocs-material

Documentation that simply works

Home Page:https://squidfunk.github.io/mkdocs-material/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

style for inline line numbers

2bndy5 opened this issue · comments

Contribution guidelines

I want to suggest an idea and checked that ...

  • ... to my best knowledge, my idea wouldn't break something for other users
  • ... the documentation does not mention anything about my idea
  • ... there are no open or closed issues that are related to my idea

Description

Superfences offers an inline setting to their config for linenums_style. This renders without the expected styling:
image
whereas the expected style for line numbers renders properly with the table or pymdownx-inline settings:
image

I understand there may be other implications to using inline numbers (like with clipboard.js).

Use Cases

Accessibility standards. People with screen readers are not exposed to the line numbers when pymdownx-inline setting is used. They are improperly exposed to the line numbers when table setting is used, but screen readers announce all line numbers first then literal code after (which I imagine is annoying) because of the 1-row table that's generated.

Full disclosure: I'm hoping to take the new CSS downstream (sphinx-immaterial) because Sphinx has recently switched their default to inline behavior, and the table behavior has been deprecated for accessibility sake.

Screenshots / Mockups

No response

Thanks for reporting. We support table and pymdownx.inline, as per our documentation. inline is not supported, as it renders copy-to-clipboard unusable. Thus, this will not be implemented, but you can add the necessary CSS yourself.

We could and should improve the accessibility of pymdownx.inline; possibly via aria-* attributes. If you feel that this is a good idea, you might create an issue upstream over at Python Markdown Extensions.