Closed aurimasv closed 10 years ago
the key looks good. How hard would it be to add at least the author after the first pipe? You're already parsing the JSON, aren't you?
It wouldn't be terribly hard, though the JSON we're parsing above doesn't contain those details. I was just being lazy and didn't want to try accounting for cases with multiple authors, missing authors, missing dates, missing everything... Will take a look at it in a bit.
See if it's worth it. Two reasons I'd like to have it:
Forgot to change the comment at the top, but give this a go. Should work pretty well I think.
BTW, we should probably serve the bookmarklet via something like https://github.com/matthodan/bookmarklet-loader instead of directly for easier updating.
Edit: but that loader needs some tweaking
OK, one last thing that I'm on the fence on is the form of the citation after the first pipe. Scannable Cites produces Smith, (2001)
, which doesn't make much sense, since most of the author-date styles produce (Smith, 2001)
, no? Furthermore, even this latter form doesn't make sense in the marker, since prefix, suffix, etc. are supposed to end up inside the parentheses. In the marker, IMO, the parentheses are supposed to be represented by the braces, so, I think, the following should be the marker format: {|Smith, 2001|||zu:123:ABCD1234}
. Is there a reason for year in parentheses?
As the time I wrote the code, I probably mimicked Bluebook cite forms, which place the year in parens at the end. In MLZ "wrapped cites" mode, the CSL-generated form of the currently selected default export style is written in there. It really doesn't matter, so long as enough information is provided for a human reader to distinguish the cited source.
The only thing I would ask is that allowance be made for items with no author (statutes, legal cases, others), but you've already done that.
OK. I dropped the parentheses. It's {|Smith, 2001|||zu:1234:ABCD1234}
now. Have nothing more planned for this, so if you have no other concerns, feel free to merge.
Looks great to me - a nice addition. Sebastian?
I'll feel pretty dumb if this is already available (I didn't see it), but here goes. This is a bookmarklet that will generate barebone ODF/RDF marker for selected citations on zotero.org
The bookmarklet-mini.js is just bookmarklet.js passed through http://chriszarate.github.io/bookmarkleter/ but with !function(){...}() wrapper converted to (function(){...})(), which works better on Firefox.
Please double-check the item key that is created. I haven't tested it with actual ODF/RDF scan.