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.

Allow configuration of admonition, details, etc. icons via mkdocs.yml

See original GitHub issue

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

It would be a nice addition, if the Material theme could offer a setting for choosing your icon-set. I talk about the icons used in things such as admonition headers.

It could be an extra setting:

extra:
  icon-set: material # Uses Material icon set

extra:
  icon-set: fontawesome # Uses FontAwesome icon set

extra:
  icon-set: octicons # Uses Octicons icon set

Use Cases

It would allow people without a big CSS knowledge to switch to a different set of icons, if they don’t like the default ones used. I’m well aware of the example on the reference section in the docs, about how to add custom icons. But in such a case like this one here would this create a rather large CSS file for just changing your icons used…

Screenshots / Mockups

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
squidfunkcommented, Mar 15, 2021

Note: this is yet unreleased

This turned out pretty great! Here’s an example using custom icons from the Octicons icons package. Of course, this can be used with any icon from any package, even custom icons as described in the documentation.

mkdocs.yml

theme:
  icon:
    logo: logo
    admonition:
      note: octicons/tag-16
      abstract: octicons/checklist-16
      info: octicons/info-16
      tip: octicons/squirrel-16
      success: octicons/check-16
      question: octicons/question-16
      warning: octicons/alert-16
      failure: octicons/x-circle-16
      danger: octicons/zap-16
      bug: octicons/bug-16
      example: octicons/beaker-16
      quote: octicons/quote-16

Result:

localhost_8000_reference_admonitions_ (2)

0reactions
Andre601commented, Mar 20, 2021

Insiders 2.4.0 just shipped support for custom admonition icons!

Cool. Will wait for the actual release…

Couldn’t this be put on a lower insiders milestone? 👉👈 I can’t afford to be part of insiders (yet) and the 8k milestone sure will take a long time to be reached…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Martin Donath
Users of Material for MkDocs Insiders can now configure admonition icons and set them to any of the 8k bundled icons, or even...
Read more >
Configuration
Guide to all available configuration settings. Introduction . Project settings are configured by default using a YAML configuration file in the project ......
Read more >
Include Admonition "example" qualifier · Issue #646
The docs say admonition allows for custom qualifier, and mkdocs-material adds a few of its own. There is no example to use a...
Read more >
Admonitions - Material for MkDocs
This configuration enables admonitions, allows to make them collapsible and to nest arbitrary content inside admonitions. Add the following lines to ...
Read more >
Material for MkDocs - GitHub
Minimal configuration. Simply add the following lines to mkdocs.yml to enable the theme. Note ... Fixed sizing of icons in admonitions, task lists,...
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