0

When I print an mkdocs-generated html page (using google chrome in this case) the page explicitly prints the relative paths underlying a page link. For example:

In mkdocs markdown file:

to read more, visit this [page](../../more_info_page).

On the resulting HTML page:

to read more, visit this page.

Printing the html page:

to read more, visit this page[../../more_info_page].

Is there a way to stop this happening?

GerryDevine
  • 111
  • 1
  • 9
  • You don't mention which MkDocs theme you are using. It's possible the theme includes some [print specific CSS](https://css-tricks.com/snippets/css/print-url-after-links/) which is causing this. Or it could be the browser's default behavior. – Waylan Nov 27 '19 at 14:23
  • Good point. I'm using the 'Material' theme - I'll look into whether it may be using specific print css. Also, I tried printing across different browsers - same result. Cheers. – GerryDevine Nov 27 '19 at 22:09
  • Yes, the Material theme defines this rule for print: `@media print { .md-typeset a:after { color: rgba(0, 0, 0, .54); content: " [" attr(href) "]" } }`, which causes the URL to be displayed in brackets after the link text. You can see is defined in the [source code](https://github.com/squidfunk/mkdocs-material/blob/6e43b874f6eaa9764b67a0902d0eae38bbb35f35/src/assets/stylesheets/base/_typeset.scss#L152-L161). – Waylan Nov 28 '19 at 15:19
  • Okay, that's good to know. I can work with that. Thanks. – GerryDevine Dec 05 '19 at 23:54

0 Answers0