Skip to content

Allow extensions/plugins to alter nav display #2311

Description

@Andre601

This was originally posted on squidfunk/mkdocs-material#2318
See the issue for any additional info needed.

The Idea

From what I understand does MkDocs not allow extensions or plugins to customize the look of (at least) the navigation in terms of displayed text.

It would be a interesting idea to allow extensions and/or plugins to alter this navigation to allow support for things such as custom SVG icons or images.

Example

When you want to link to an external site and want to indicate this with the Fontawesome external-link-alt could you use Materials for MkDocs and the MaterialX emoji extension together with pymdownx's emoji extension, to have something like this:

nav:
- 'Our Website :fontawesome-solid-link-external-alt:': 'https://example.com'

The result would be Our Website with the icon right next to it.

Alternatives

The only alternatives I can think of is using Unicode emojis directly in the text which has its own set of flaws:

  • Emojis are limited. There can be cases where no emoji matches what you need.
  • Emojis may look different depending on the OS used to view the page. It could perhaps even not work (Be unsupported)

Final words

I hope you'll take a look at this.
If that is already possible, would I like to know more details about this, as it could perhaps become a part of an existing extension/plugin for future use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions