Skip to content

Add an identifying class to the page's edit link to make it easier to hide when rendering to PDF #1920

@dimrozakis

Description

@dimrozakis

I checked that...

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

Description

Please consider adding an identifying class to the page's edit link (the one with the pencil icon).

<a
href="{{ page.edit_url }}"
title="{{ lang.t('edit.link.title') }}"
class="md-content__button md-icon"
>
{% include ".icons/material/pencil.svg" %}
</a>

Use Cases

I'm working with a fork of https://github.com/comwes/mkpdfs-mkdocs-plugin to render the site to a single PDF. I'd like to be able to manipulate the links for editing pages (pencil icon) via either CSS or preprocessing of the HTML that goes into the PDF in order to be able to hide them entirely or have them appear differently in the PDF. The lack of some identifying class specifically for that link makes any such attempt quite fragile. If the link had a class of say edit-page it'd be much easier to find that element using beautifulsoup and remove the element or treat it in some other specific manner.

Such identifying classes could probably come handy for any other UI elements that are inserted into the article content, but for the time being it's only the edit link I'm having an issue with.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions