JakubAndrysek/mkdocs-open-in-new-tab

Add icon to external links

Opened this issue · 2 comments

It would be cool if you could add an option to enable adding an icon behind links to show that links open in a new tab.

Something like this:

# mkdocs.yaml
plugins:
  - search
  - open-in-new-tab:
      add_icon: true

Then it could look like this:

image

Mkdocs-material already has a nice set of icons you can choose from

image

Technically, you would have to add an extra event event that processes and updates either the markdown or the HTML. An example of a plugin that does this is table-reader

I have tested adding icons using JS, but it will also add icons next to the images and to the top Github link.
So I will have to modify the generated HTML as you wrote in the previous comment.

More in new external-links-icon branch

image

Looks great though