'Create Bibliography', markdown-formatted
Is it possible to format a bibliography using markdown syntax? That is, to select a number of items in a Zotero library, right-click to choose Create Bibliography From Item, but then instead of having the formatted text copied to clipboard, have the markdown that would lead to those same formattings.
Markdown itself can't properly represent all the formatting that citation styles require, so this wouldn't make sense. But you can always paste HTML into a Markdown document.
Instead of
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Bibliography</title>
</head>
<body>
<div class="csl-bib-body" style="line-height: 1.35; margin-left: 2em; text-indent:-2em;">
<div class="csl-entry">Lastname, Firstname. <i>This is the Title</i>. North Charleston, SC: Publisher's Name, 2017.</div>
<span class="there is a mysterious secret span here that I deleted"></span>
<div class="csl-entry">Glen. “GTD Cheatsheet: The Workflow.” LifeDev, February 1, 2007. <a href="https://lifedev.net/2007/02/01/gtd-cheatsheet-the-workflow/">https://lifedev.net/2007/02/01/gtd-cheatsheet-the-workflow/</a>.</div>
<span class="there is a another mysterious secret span here that I deleted"></span>
</div></body>
</html>
. . . You'd have . . .
<div class="csl-bib-body" style="line-height: 1.35; margin-left: 2em; text-indent:-2em;">
<div class="csl-entry">
Lastname, Firstname. _This is the Title_. North Charleston, SC: Publisher's Name, 2017.
</div>
<div class="csl-entry">
Glen. “GTD Cheatsheet: The Workflow.” LifeDev, February 1, 2007. [https://lifedev.net/2007/02/01/gtd-cheatsheet-the-workflow/](https://lifedev.net/2007/02/01/gtd-cheatsheet-the-workflow/).
</div>
</div>
So the only actual differences are the italics and the link, which are pretty minimal, and if the whole thing has to be wrapped in HTML tags for styling anyway, who cares? You just ignore that block. This isn't body text that's meant to be human readable or writable.
The div tags are only there to apply CSS. That is how you do it with markdown and in HTML. So ... that is their only similarly really.
The HTML is HTML + CSS.
The markdown is markdown + CSS
To use it as markdown standalone or as a snippet, I would have to do the link and italics conversion and strip out all the excess. Just extra work. Yes, you could leave the links and italics as is, but ... that's just sloppy, IMHO.
My hand created stuff looks even more stripped down (and I move the CSS to a stylesheet), but that is beyond the discussion:
<div class="csl-bib-body" style="line-height: 1.35; margin-left: 2em; text-indent:-2em;">
Lastname, Firstname. _This is the Title_. North Charleston, SC: Publisher's Name, 2017.
Glen. “GTD Cheatsheet: The Workflow.” LifeDev, February 1, 2007. [https://lifedev.net/2007/02/01/gtd-cheatsheet-the-workflow/](https://lifedev.net/2007/02/01/gtd-cheatsheet-the-workflow/).
</div>
But I can see how someone might want two layers of CSS there. I digress.
The span. I had no idea why it was there. So I suppose that remains. How does that work with an RTF document?
My meager vote is to include markdown notes as an option, but my vote is only one small vote and I just wanted it filed in the comments. Thanks for listening. :)
If you need HTML divs, inline CSS, and COinS spans in both, then it just makes no sense to worry about the italics and link, which are barely noticeable in the context of the rest. It's just a chunk of HTML that you paste in to get a bibliography, the same as any other special-purpose block of HTML you might paste into a Markdown file. Just ignore it. The inner divs aren't optional for many citation styles, so this isn't a relevant example. The COinS lets Zotero save data from webpages. (The 'S' in COinS stands for 'spans'.) It's not relevant for RTF.
Look. You don't have to respond. I see your point that HTML can be used in markdown and it just does the right thing. And you can't go the other direction. I just like to keep my documents as clean as possible. There are converters I can use to take an HTML file and make it markdown. And that is probably what I will end up doing.
Thanks again for clarifying things. Cheers.
The main other benefit to Create Bibliography is that you can configure the style settings on the fly, and if you want that for your Markdown document, you can take the extra two seconds to strip the headers. But the csl-bib-body, for the reasons I've explained, would be almost entirely the same even in a Markdown version, so it wouldn't make sense to create an option called "Markdown" for Create Bibliography whose main difference was not including the HTML header. This use case would be better addressed just by providing an option in the dialog to copy to the clipboard as an HTML snippet instead of formatted text, as is an option with Quick Copy.
(RTF isn't really relevant here. That needs to be a file to be openable in word processors.) The standard output of Markdown is HTML, so if you want Zotero to be able to import data back from the webpage, you would want to keep the span.
So, I disagree with your logic. We shall agree to disagree. :) My vote is noted. Well, I think it is noted. Maybe I should just open a github ticket instead.
Cheers.
FWIW, I know there are use cases for just copy&paste, but my sense is that most people working/writing in markdown (of which there are many) just create the bibliographies via pandoc/pandoc-citeproc (for which there a number of elegant workflows from Zotero) and the main use case for copy&paste are people using md to build jekyll or hugo websites, for which the html option actually provides a better solution, so yours is a pretty niche request.
Could probably be done by an add-on which might be as simple as re-converting the html output to md automatically.