According to MDN,
Code samples added on or after August 20, 2010 are in the public domain (CC0). No licensing notice is necessary, but if you need one, you can use: "Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/".
Code samples added to this wiki before August 20, 2010 are available under the MIT license; you should insert the following attribution information into the MIT template: "©
". You can determine which license a code sample is available under by browsing through the article's history. To view the history:
- Click the Edit in wiki button in the article header. This takes you to the same article on the editable, wiki version of MDN Web Docs (but does not actually put the article in edit mode).
- Click the gear-shaped icon in the header of the wiki article, and choose History in the menu that appears.
- Click View All, and then look for the most recent revision that occurred before August 20, 2010 (if any).
- Click the date stamp of that revision to see the version of the article on that date.
Is it possible to know the license of code, after MDN's transition to Yari?
This repo doesn't seem to contain history older than 15 Sep 2020
According to README, which points to LICENSE.md, it will remain CC0 (code) resp. CC BY-SA 2.5 (prose).
@Ryuno-Ki According to LICENSE.md, only code added after August 20, 2010 falls under CC0, otherwise it is licensed under MIT License.
https://github.com/mdn/content/blob/9ca97d18a387ef8a77e64191dd05e6e621d8ad53/LICENSE.md#L207-L211
Because this repo doesn't contain history older than 15 Sep 2020, the old way of determining license of a code sample doesn't work anymore.
The question is, after the transition to Yari, is there a way to figure out which license applies to a specific code sample, CC0 or MIT?
I think, this is related to https://github.com/mdn/yari/issues/706.
@peterbe and @fiji-flo looked how to get _wikihistory.json right.
/cc @escattone
@Ryuno-Ki Not quite related, we are talking about created date of code sample, not modified date.
Furthermore, this repo only contains MDN history after 15 Sep 2020. Unless Mozilla import the whole history database to this repo, git log won't work.
I'm aware, that the created / modified date won't show up in git. They can't. Right now, MDN is stored in a MySQL database. (Ctrl-F „Changes in a nutshell”).
My understanding was, that the meta information is dumped into a JSON file, which then gets evaluated next to git metadata for the display of created / modified date.
I read the guide to determine license of a code sample again and found that I was wrong.
To find out if a code sample was added before August 20, 2010, it would require more than just the metadata/created date, but the whole history of the corresponding article (we need to use git blame instead of git log).
For example, an article may be created before August 20, 2010, but some code sample it contains might be added after that date. In that case, those code sample added after the date will be licensed under CC0.
If the old history won't be imported or accessible by the public after the transition, could Mozilla review and mark license of every code sample for us?
given the lack of clear history tracking before Yari, I think it would probably simpler to assume any code sample pre-Yari is available under MIT license, and only bring the CC0 license for post-Yari submissions.
In practice, availability under MIT license is already very permissive, so doing a lot of uncertain history tracking to "only" get the bonus of CC0 doesn't seem worth the time IMO.
Mozilla can just run an instance of old MDN so users could access history before 15 Sep 2020.
@dontcallmedom it would be a pain in the ass if we were required to include the whole MIT license text in a JavaScript file, just because we copied a few lines of code. The license test may even be longer than the code snippet we copied.
As far as I understand, the only difference between my suggestion and doing the historical research (or allowing others to do that research) is that the code samples submitted between Aug and December might be upgraded from MIT to CC0. Unless there was a particular streak of code submissions in that period, it still feels unlikely to yield much benefit compared to the required effort.
(wrt copying a few lines of code - IANAL, but code samples just a few lines long are likely not copyrightable in the first place - copyright only applies to original work after all)
Sorry for the confusion here. Thank you for bringing this up @danny-laa and to everyone else for their comments/thoughts. It's something that @chrisdavidmills, myself, and others (most likely Mozilla legal) are discussing how to resolve, and we'll report back as soon as we can.
@escattone Any news?
@danny-laa Sorry for the delayed response! Thanks for the reminder. We had started this discssion, but in the rush of everything else going on, never finished it. We'll get it rolling again.
@escattone Is there any estimated date when will this issue be resolved?
Most helpful comment
Sorry for the confusion here. Thank you for bringing this up @danny-laa and to everyone else for their comments/thoughts. It's something that @chrisdavidmills, myself, and others (most likely Mozilla legal) are discussing how to resolve, and we'll report back as soon as we can.