Marking PDF links | |
I seem to recall reading about a feature so that you could apply
different styles to different kinds of link.
e.g. local and offsite or to automatically put a logo beside some
domain links.
I would like to add an icon to pdf links.
I'm after something of the form a:link("*.pdf) { properties ... }
Does anyone know the names of the keywords or the syntax, or if this
is even possible?
--
Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching. | | | | re: Marking PDF links
Roedy Green wrote:
[color=blue]
> I seem to recall reading about a feature so that you could apply
> different styles to different kinds of link.
>
> e.g. local and offsite or to automatically put a logo beside some
> domain links.[/color] http://www.w3.org/TR/css3-selectors/...ute-substrings
Note that this is a working draft, not a final spec. There are some
experimental implementions in the wild, but everything is still subject to
change.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is | | | | re: Marking PDF links
David Dorward <dorward@yahoo.com> wrote:
[color=blue]
> Roedy Green wrote:
>[color=green]
>> I seem to recall reading about a feature so that you could apply
>> different styles to different kinds of link.
>>
>> e.g. local and offsite or to automatically put a logo beside some
>> domain links.[/color]
>
> http://www.w3.org/TR/css3-selectors/...ute-substrings
>
> Note that this is a working draft, not a final spec. There are some
> experimental implementions in the wild, but everything is still subject to
> change.[/color]
If you use type="application/pdf" for links to PDF resources, you could use
attribute selectors in CSS for them.
That would be an exercise in futility, though. It is useful, and often
essential, to indicate PDF links as PDF links, since following such a link
may confuse the user, cause a considerable delay, result in a blank window,
crash the browser, give the user data that he cannot use because PDF is so
inaccessible a format (despite all the Adobe marketese), or simply fail to do
anything useful due to lack of any PDF viewer on the user's system. However,
many of these points are equally relevant or more relevant in browsing
situations where style sheets are not in use (or the intended visual
indication fails miserably, e.g. because it relies on colors and the user is
blind).
Thus, the best approach is something like
"There are more details on this in the (PDF) document Foo Bar."
--
Yucca, http://www.cs.tut.fi/~jkorpela/ | | | | re: Marking PDF links
On Sun, 22 Jan 2006 11:33:26 +0000 (UTC), "Jukka K. Korpela"
<jkorpela@cs.tut.fi> wrote, quoted or indirectly quoted someone who
said :
[color=blue]
>That would be an exercise in futility, though. It is useful, and often
>essential, to indicate PDF links as PDF links, since following such a link
>may confuse the user, cause a considerable delay, result in a blank window,
>crash the browser, give the user data that he cannot use because PDF is so
>inaccessible a format (despite all the Adobe marketese), or simply fail to do
>anything useful due to lack of any PDF viewer on the user's system.[/color]
However, if others have elected to provide their papers only in PDF
format, you have no choice if you want to link to them. The best I
figured I could do is warn people a link was to a PDF document.
--
Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching. | | | | re: Marking PDF links
Roedy Green wrote:[color=blue]
> I seem to recall reading about a feature so that you could apply
> different styles to different kinds of link.
>
> I would like to add an icon to pdf links.
>[/color]
CSS:
a .pdf {
background: #fff url(pdf-image-path) left center no-repeat;
padding-left: width-of-image-px;
}
HTML:
<a href="http://..." class="pdf">whatever</a>
The image would have to be fairly small (< 16px height) to not interfere
with other inline text. Which would likely make the PDF logo unrecognizable.
--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email) | | | | re: Marking PDF links
On Sun, 22 Jan 2006 11:33:26 +0000 (UTC), "Jukka K. Korpela"
<jkorpela@cs.tut.fi> wrote, quoted or indirectly quoted someone who
said :
[color=blue]
>That would be an exercise in futility, though. It is useful, and often
>essential, to indicate PDF links as PDF links, since following such a link
>may confuse the user, cause a considerable delay, result in a blank window,
>crash the browser, give the user data that he cannot use because PDF is so
>inaccessible a format (despite all the Adobe marketese), or simply fail to do
>anything useful due to lack of any PDF viewer on the user's system. However,
>many of these points are equally relevant or more relevant in browsing
>situations where style sheets are not in use (or the intended visual
>indication fails miserably, e.g. because it relies on colors and the user is
>blind).[/color]
what I have done in the meantime looks like this:
<a href="http://www.cs.brown.edu/courses/cs161/papers/j-nio-ltr.pdf"
class="pdf">nio tutorial in PDF</a>
--
Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching. | | | | re: Marking PDF links
Roedy Green wrote:
[color=blue]
> On Sun, 22 Jan 2006 11:33:26 +0000 (UTC), "Jukka K. Korpela"
> <jkorpela@cs.tut.fi> wrote, quoted or indirectly quoted someone who
> said :
>
>[color=green]
>>That would be an exercise in futility, though.[/color][/color]
(snip)
[color=blue]
>
> what I have done in the meantime looks like this:
>
> <a href="http://www.cs.brown.edu/courses/cs161/papers/j-nio-ltr.pdf"
> class="pdf">nio tutorial in PDF</a>[/color]
Roedy,
Actually, the SOURCE looks like this. Since the newsgroup doesn't have
access to your stylesheet, we have no idea what the RESULT looks like.
In any case, IMO:
- Yes, you should identify links to PDFs (or any filetype other than
(X)HTML.
- You should also show its size, since many such external resources
are huge. At the least, this will allow the user to know in advance
that linking to this resource might be a good time to take a bathroom
break...
(Yes, in this case DeveloperWorks could update the document and change
its size, but you'd probably still be in the ballpark.)
Chris Beall | | | | re: Marking PDF links
In article <87p6t118mbpsm4cr3s2ri380eevf8deg8h@4ax.com>,
Roedy Green <my_email_is_posted_on_my_website@munged.invalid > wrote:
[color=blue]
> I seem to recall reading about a feature so that you could apply
> different styles to different kinds of link.
>
> e.g. local and offsite or to automatically put a logo beside some
> domain links.
>
> I would like to add an icon to pdf links.[/color]
Have a look at
<http://www.euronet.nl/~tekelenb/WWW/userfriendlierhyperlinks/>
--
Sander Tekelenburg, <http://www.euronet.nl/%7Etekelenb/> | | | | re: Marking PDF links
On Sun, 22 Jan 2006 21:11:40 GMT, Chris Beall
<Chris_Beall@prodigy.net> wrote, quoted or indirectly quoted someone
who said :
[color=blue]
>(Yes, in this case DeveloperWorks could update the document and change
>its size, but you'd probably still be in the ballpark.)[/color]
I generate much of my code with HTML static macros expanded prior to
upload. So if I really wanted I could check the file sizes. I do to
some extent for local files.
see http://mindprod.com/jgloss/htmlstaticmacros.html
the style looks like this:
..pdf, a.pdf:link, a.pdf:visited, a.pdf:active
/* download a pdf file */{
background: url(images/pdf.png) transparent no-repeat scroll
right;
/* top right bottom left */
padding: 3px 35px 3px 2px;
}
The problem was not the style. It was trying to automatically hook it
up to the .pdf extension.
You can see it in action at http://mindprod.com/jgloss/nio.html
near the bottom.
--
Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching. | | | | re: Marking PDF links
On Mon, 23 Jan 2006 01:01:48 +0100, Sander Tekelenburg
<user@domain.invalid> wrote, quoted or indirectly quoted someone who
said :
[color=blue]
>Have a look at
><http://www.euronet.nl/~tekelenb/WWW/userfriendlierhyperlinks/>[/color]
I'm puzzled how you could select by MIME type. You don't normally find
that out the MIME type until you probe the server. But you don't
normally do that until you click a link.
Does the browser probe all the links on page??? Surely not. Or does it
make some guess at the MIME type from the extension.? That guess is
probably wrong as every server uses a different table of extensions to
MIME.
Severs would have to divulge their lists.
..
--
Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching. | | | | re: Marking PDF links
> On Mon, 23 Jan 2006 01:01:48 +0100, Sander Tekelenburg[color=blue]
> <user@domain.invalid> wrote, quoted or indirectly quoted someone who
> said :
>[color=green]
>>Have a look at
>><http://www.euronet.nl/~tekelenb/WWW/userfriendlierhyperlinks/>[/color][/color]
Roedy Green wrote:[color=blue]
> I'm puzzled how you could select by MIME type. You don't normally find
> that out the MIME type until you probe the server.[/color]
Right, but there is the type attribute which contains a _hint_ about the
MIME type. That's what is used here.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.) | | | | re: Marking PDF links
On Mon, 23 Jan 2006 10:59:57 +0100, Johannes Koch
<koch@w3development.de> wrote, quoted or indirectly quoted someone who
said :
[color=blue]
>
>Right, but there is the type attribute which contains a _hint_ about the
>MIME type. That's what is used here.[/color]
where does a browser find out the type attribute of a link?
all it has is the extension, right?
--
Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching. | | | | re: Marking PDF links
In article <jhgat15ri5n9e8ohe9osvqo0a62dovg6c9@4ax.com>,
Roedy Green <my_email_is_posted_on_my_website@munged.invalid > wrote:
[color=blue]
> On Mon, 23 Jan 2006 10:59:57 +0100, Johannes Koch
> <koch@w3development.de> wrote, quoted or indirectly quoted someone who
> said :
>[color=green]
> >Right, but there is the type attribute which contains a _hint_ about the
> >MIME type. That's what is used here.[/color]
>
> where does a browser find out the type attribute of a link?[/color]
Why, in the HTML obviously. Just like with any other elements and
attributes. Did you read the page I referred you to? Did you look at its
HTML?
[color=blue]
> all it has is the extension, right?[/color]
If that's all its been given, yes. But nothing is stopping you from
providing it with a proper MIME type, through the type attribute.
I thought this was all made pretty obvious at
<http://www.euronet.nl/~tekelenb/WWW/userfriendlierhyperlinks/>.
--
Sander Tekelenburg, <http://www.euronet.nl/%7Etekelenb/> | | | | re: Marking PDF links
On Mon, 23 Jan 2006 22:46:29 +0100, Sander Tekelenburg
<user@domain.invalid> wrote, quoted or indirectly quoted someone who
said :
[color=blue][color=green]
>> where does a browser find out the type attribute of a link?[/color]
>
>Why, in the HTML obviously. Just like with any other elements and
>attributes. Did you read the page I referred you to? Did you look at its
>HTML?[/color]
No, not "obviously". That scheme has no automation unless there is
somewhere locally a table of extensions. You might as well tag with
ordinary classes. You still have to manually assign the types in the
markup. It is just a variant of manual tagging with classes. . MIME
types normally come from the server. This is a mis-use of the term.
Further the author of the page did not show markup, just styles, other
than via view source. Further his examples did not work, so it was not
obvious he even did anything in the markup.
Ideally he would have given a concrete example in addition to the BNF
of both a style and markup. When you talk about the "type" of
something you could be talking in the ordinary English sense, about
the extension, about a type derived, or about a literal TYPE tag. It
is obvious only once you are familiar with how it works.
I have been adding classes to my website links and discovered that I
don't really want to select ALL links by extension. There are many I
want to exclude, so manually inserting classes on the links is
probably the best you can do.
--
Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching. | | | | re: Marking PDF links
Deciding to do something for the good of humanity, Roedy Green
<my_email_is_posted_on_my_website@munged.invalid > declared in
comp.infosystems. www.authoring.stylesheets:[color=blue]
> On Mon, 23 Jan 2006 22:46:29 +0100, Sander Tekelenburg
> <user@domain.invalid> wrote, quoted or indirectly quoted someone who
> said :
>[color=green][color=darkred]
>>> where does a browser find out the type attribute of a link?[/color]
>>
>>Why, in the HTML obviously.[/color]
>
> No, not "obviously".[/color]
Why not? Where else would you look for attributes in an HTML document,
other than the HTML?
--
Mark Parnell
================================================== ===
Att. Google Groups users - this is your last warning: http://www.safalra.com/special/googlegroupsreply/ | | | | re: Marking PDF links
In article <thjbt1hsq96bmo3li2jg51v96gff98qj2l@4ax.com>,
Roedy Green <my_email_is_posted_on_my_website@munged.invalid > wrote:
[color=blue]
> On Mon, 23 Jan 2006 22:46:29 +0100, Sander Tekelenburg
> <user@domain.invalid> wrote, quoted or indirectly quoted someone who
> said :
>[color=green][color=darkred]
> >> where does a browser find out the type attribute of a link?[/color]
> >
> >Why, in the HTML obviously. Just like with any other elements and
> >attributes. Did you read the page I referred you to? Did you look at its
> >HTML?[/color]
> No, not "obviously". That scheme has no automation[/color]
{confused} What sort of "automation" are you looking for?
[color=blue]
> unless there is
> somewhere locally a table of extensions.[/color]
"extensions"? (Do you mean file name extensions? What is the relevance
of that?)
[color=blue]
> You might as well tag with
> ordinary classes.[/color]
Yes, you can, but if you're going to add classes, you might as well add
type attributes. Type attributes actually have meaning on the Web, plus
this way you avoid 'CLASS-soup'. Personally I prefer to add as little
DIVs, SPANs, classes and IDs as is possible - keep the HTML clean and
make use of CSS selectors to target things.
[color=blue]
> You still have to manually assign the types in the
> markup.[/color]
Less so than you have to manually add classes. My argument for using the
type attribute instead is not only that it adds more value than just
being a CSS selector, but also that automated Web publishing systems
could easily insert type attributes automagically - something they can't
do with classes. Thus using the type attribute provides a much better
opportunity for an automated authoring approach then using classes.
[...]
[color=blue]
> MIME types normally come from the server.[/color]
MIME types are MIME types. Servers serve them through Content-Type
headers and before they do, they look them up through whatever mechanism
the server's local environment provides for that (which does not have to
be through file name extensions - for instance, on a Mac a server might
use the system's type/creator database).
[...]
[color=blue]
> Further the author of the page did not show markup, just styles, other
> than via view source.[/color]
What's too hard about viewing the source?
[color=blue]
> Further his examples did not work[/color]
"work" in the environment of the Web is extremely tool-dependant. If the
tool you used didn't 'work', then maybe that tool doesn't work.
The bottom of that page lists some browsers that *do* support this. Did
you see that? Didn't it make you think that perhaps the browser you were
using might not be working?
[color=blue]
> , so it was not
> obvious he even did anything in the markup.[/color]
The page explains how to "target the type attribute", big header,
through CSS and shows two examples. How then can it not be obvious that
the HTML contains type attributes?
[color=blue]
> Ideally he would have given a concrete example in addition to the BNF
> of both a style and markup. When you talk about the "type" of
> something you could be talking in the ordinary English sense, about
> the extension, about a type derived, or about a literal TYPE tag.[/color]
Indeed. Therefore, at that page I don't just vaguely speak of "type",
but of "type attributes" - each and every time.
--
Sander Tekelenburg, <http://www.euronet.nl/%7Etekelenb/> |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,295 network members.
|