cran-task-views / ctv

CRAN Task View Initiative
81 stars 13 forks source link

distinctive font for packages #49

Closed wibeasley closed 1 year ago

wibeasley commented 1 year ago

When a package is marked with ctv's pkg() function, could it be displayed with a font that is different than the vanilla hyperlink?

For instance in the screenshot below, the link to the "pdftables" package would be a different color/style/font than the link to "PDFTables.com".

image

zeileis commented 1 year ago

We're using the usual CRAN_web.css that is also used for the other content such as the individual package web pages. This has different colors for a few types of packages from other sources (e.g., Bioconductor, etc.) but does not distinguish CRAN packages and other types of links. My feeling is that we have exhausted what we can do well enough with the colors in this setup. But I'll raise it with the CRAN team.

tuxette commented 1 year ago

As for me, I agree with Achim: the current CSS is simple and sober, which I think is a good think. Indeed, in your screenshot, it makes no difference between links and packages (which, I agree can be confusing) but it is rare that a CTV paragraph as so many links (not all paragraphs are related to web services).

zeileis commented 1 year ago

The CRAN team liked the suggestion of using a dedicated <span class="CRAN">...</span> for all links on CRAN. You may have to clear the cache of your browser but afterwards package web pages should use a slightly diffferent blue (in fact taken from the R logo) for CRAN links:

https://CRAN.R-project.org/package=Wats

Note also that not only packages on GitHub but also GitHub URLs are now rendered in a different color (green taken from GitHub buttons).

So the CRAN Task view pages now use the same colors. It can make some pages rather colorful but helps a lot to distinguish what is a link to a CRAN resource or an external resource:

https://CRAN.R-project.org/view=WebTechnologies

wibeasley commented 1 year ago
  1. I like the muted shade of blue!
  2. Is it hard for the character's color to match the underline's color? (I rarely touch css, so I don't know.)
  3. Now the non-CRAN links are a different color, would you still like a CTV to state "Not on CRAN"?

image

zeileis commented 1 year ago

The effectiveness of the colors will probably be different in different contexts so I lean towards adding some comment. But it is not a requirement to explicitly say "not on CRAN".

An alternative way would be to have a separate list with a comment like "Additionally, the following packages are available from GitHub and provide interfaces to..."

Regarding the underline colors: It probably isn't very difficult. Will ask a colleague who knows much more about CSS.

zeileis commented 1 year ago

Quick follow-up: One needs to add text-decoration: underline to the span.* definitions to get the same color for the line as for the text. I will pass this on to the CRAN team.

wibeasley commented 1 year ago

@zeileis, I love the softer colors. It's been three weeks, and I still smile every time I land on a CRAN page.