Output citation with literal html codes (e.g. italics) for webpage?
Is there a convenient way to maintain the
(In my particular case, I think I primarily need only italics, but a few other things like superscript come up in a few item titles at least, so copying everything over would be preferred.)
<i>
etc. formatting within a style? I'm copying many citations to a webpage and it would take a lot of time to manually reformat everything. Even search/replace would work if there's some way to export some kind of marker in the text. Would this require a variant of the style? Can CSL force literal HTML? Or is there another convenient workaround?(In my particular case, I think I primarily need only italics, but a few other things like superscript come up in a few item titles at least, so copying everything over would be preferred.)
But it exports with a lot of extra content following Zotero formatting. Is there some way to automatically strip that out if I'm just trying to copy the text of the reference itself (along with italics, links, etc.) to an HTML document, rather than as a
<div>
, etc.? If not, this will work, and I will just find a way to automatically strip that out.References are part of a bibliography, and you wouldn't generally copy them individually — you copy the bibliography all at once, and Zotero applies proper formatting to the entire div (in addition to doing proper sorting).
Regarding the HTML content, I've looked into this some more, and here are some thoughts, including why I'd rather remove it:
1. Your point about COinS is important, but the data actually saved there is not very useful. Book editors, for example, are treated as "authors", and a lot of other information is lost. The metadata isn't high enough quality that I'd recommend others use it, so in my opinion it's not worth including. Adding better metadata to the webpage later is something I will consider because that does seem useful, but via some other method than COinS.
2. The HTML output uses explicit formatting, rather than allowing general formatting via CSS. It is also odd in its design, most obviously because it lacks paragraph elements (and from what I understand this is problematic for accessibility software like screen readers that expect p elements inside divs). In short, I think the purpose of Zotero is to generate content (references) to be included in a webpage, not to generate the formatting of that webpage.
For the HTML, Zotero generates exactly what it needs to generate to produce a correct bibliography according to the selected citation style that can be inserted into a larger document, and that implies using inline style. You can restyle with CSS from the containing document if you want to do something different, but it would be incorrect for it to not apply indents or spacing.
Zotero uses div elements for the same reason — because the goal is to produce a correctly formatted bibliography, and divs generally won't have browser-default or other styling interfering. divs are block-level elements. There's no requirement for p elements and no reason screen readers should have any problem with it — they just need to read the text within each block.
Not sure if there's now a better alternative -- JSON-LD at the item level? RDFa?
As for COinS and alternatives, the current version just doesn't seem close enough to useful to be worth including. I understand it was the best option at the time, but it's more misleading than clarifying, at least for many of my references (often book chapters, and given that Zotero records often have editors first if you start by entering a book by ISBN, that is particularly confusing when they're listed as first author in COinS). If there's some better way to do this later I'd be interested to hear about it, but that's probably beyond the scope of my current project, or at least the current stage of it.
Thanks for your replies.