AndrewBelt / WiTeX

If Donald Knuth had designed Wikipedia
368 stars 28 forks source link

Another way to auto-update the stylesheet #8

Open zhaofengli opened 9 years ago

zhaofengli commented 9 years ago

Hello, Andrew. There's a better way to have users' stylesheets updated without using any browser add-ons, in case if you are not aware. You can create a central stylesheet under your userspace so that users can use it in two ways:

P.S. Your stylesheet is being discussed at Administrators' noticeboard as multiple editors are worried about potential abuse. Your input is appreciated and can clear out confusion. Thank you.

Zhaofeng Li (User:Zhaofeng Li on Wikipedia)

zhaofengli commented 9 years ago

Another way is to serve the stylesheets with GitHub Pages, which sends the correct Content-Type (text/css). This may violate the privacy policy I'm afraid.

AndrewBelt commented 9 years ago

Thanks for the notice. The following works for me when I paste it into my vector.css stylesheet.

@import url("//cdn.rawgit.com/AndrewBelt/WiTeX/master/style.css");

It updates from the master branch of this repo, and it caches once loaded from rawgit.com and is not loaded from Wikipedia's servers, so it's a win-win. I'll clear up some confusion on the noticeboard before I push that change to the README.

zhaofengli commented 9 years ago

Looks like it doesn't work that way... From rawgit.com: "Files are cached permanently after the first request." And on-wiki elements should not depend on third-party servers, or there may be some problems with the privacy policy.

AndrewBelt commented 9 years ago

It looks like you're right about the caching. I'll try your recommendation of Github Pages.

I'm not sure I understand the privacy policy point. The WiTeX stylesheet already loads fonts from a separate domain, so loading the stylesheet itself from another domain wouldn't void parts of the PP any more than it already is.

AndrewBelt commented 9 years ago

I should note that hosting a "master copy" of the stylesheet on Wikipedia allows users to change everyone's stylesheet at the same, and I'm not sure of the security issues of doing this. Is it possible to lock one's Vector.css stylesheet from editing?

zhaofengli commented 9 years ago

I've left a note on the noticeboard about the privacy policy. Maybe someone from WMF can answer that? Aside from administrators and interface editors, you are the only one who can edit the *.css and *.js subpages in your userspace (Or everyone will start injecting fun stuff into others' script pages).

AndrewBelt commented 9 years ago

Okay, I'll opt for your original idea then. It seems to work across Wikipedia languages as well. I've created a new Wikipedia account for this purpose. Here's the final code.

@import url("https://en.wikipedia.org/w/index.php?title=User:AndrewBelt/WiTeX.css&action=raw&ctype=text/css");
zhaofengli commented 9 years ago

Um, looks good, but I'm still a little bit concerned about the privacy issue. We have Tool Labs which provides free hosting for tools "that help users maintain and use wikis", so your stylesheet may fall into its scope. The logs there are redacted in order to play nice with the privacy policy. I'd appreciate if you restore the "edit" link besides the headings in a non-obtrusive way, so that users are able to fix problems they encounter. By the way, I just love the minimalistic design when reading. Maybe I can make a script to switch to the "Reader view" and back later.

AndrewBelt commented 9 years ago

I've opened #9 to handle the edit link.

A thought experiment: What's the difference according to MediaWiki's privacy policy between someone pasting

body{background: url("a cool picture I found on the internet.com");}

and users pasting the WiTeX script? And what's the difference between users pasting the script itself and a link to the script, either hosted at en.wikipedia.org or github.io?

My intuition is that all share one feature, that the user inserting third party code cannot expect the relevant parts of MediaWiki's privacy policy to hold, as would be true for all websites with a privacy policy.

zhaofengli commented 9 years ago

Very true. They are exactly of the same nature, and in my opinion render the privacy policy meaningless. Although users should take their privacy into consideration when installing such scripts, we can make them feel safe by conforming to the policy. Maybe I can help you set up a tool on Tool Labs that serves all the fonts?