vladocar / Hartija---CSS-Print-Framework

Universal CSS for web printing

Home Page:http://www.vcarrer.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion: Add a commented rule for links with a “rooted” URLs.

7studio opened this issue · comments

Hi Vladimir,
it could be interesting to add a commented rule for noticing that it is also possible to print the links which have this kind of URL: /issues/1.
Here is an exemple:

/*
a:link[href^="/"]:after, a[href^="/"]:visited:after { 
  content: " (http://www.vcarrer.com" attr(href) ") ";
  font-size: 90%;
}
*/

Sorry for the bad manipulation during the opening of the issue.

Excellent suggestion! This will work great for internal links, example "wikipedia.org" internal linking system.

Maybe it will be also interesting to add rules for all the internal links with .html and .htm at the end. Example "somepage.html"

IMHO, it could be dangerous and difficult to do the same thing with this kind of case.
You took somepage.html for example but we can have ./somepage.html, ../../somepage.html, ?page=somepage.html or maybe file://somepage.html. It can quickly become complicated to make a CSS selector which will be right in all cases and understandable.

Otherwise, my first proposition is not completely true (sorry) because of the selectors which match absolute URLs without scheme (e.g.: //www.paulirish.com/2010/the-protocol-relative-url/).
This one seems OK:

a:link[href^="/"]:not([href^="//"])::after,
a[href^="/"]:not([href^="//"]):visited::after {
  content: " (http://www.vcarrer.com" attr(href) ") ";
  font-size: 90%;
}

We are pushing the limits of CSS .. this is obviously task for JavaScript.

IMHO by adding internal links we put additional information to the text that maybe is not that useful and can potentially hurt the readability of the text and the text flow.

Example if we have: Some internal links "../long/ugly/internal/url/"

It is relatively difficult from printed paper to trace this url .. (current url + internal link)

I would probably type the current link in the browser and click on the internal link.

So basically what I'm saying .. this is probably bad idea from UX standpoint.

Any thoughts on this matter?

Unfortunately, I think that all the links can potentially hurt the readability of the text in a printed page even the external ones.
It may be the worst exemple but it could happen: http://www.dailymail.co.uk/sciencetech/article-2594078/Everyones-touch-typist-Technology-addiction-means-average-person-type-72-words-minute-without-looking.html
This kind of never ending links will take up one or two lines and I am sure that it will never be copied by the users like your example.

The best solution would be to add a data-* attribute including a shortened version of the url for each link that we want to print. It is an extra work which is difficult (or impossible) to automate but it will provide a good UX for sure.