From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/10928 Path: news.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Citations in HTML output Date: Tue, 16 Sep 2014 10:30:39 -0700 Message-ID: <20140916173039.GB24079@berkeley.edu> References: <87k3p1dena.fsf@eeepc.nowhere.net> <79d1d93d-c165-4508-86b1-c3e2342ea0fb@googlegroups.com> <20130401164720.GA15068@protagoras.phil.berkeley.edu> <29e5f88e-ccf7-4760-b810-58c64a41e607@googlegroups.com> <3861e392-a02f-4a48-aeca-5c3f9219392d@googlegroups.com> <20140915174046.GA44459@localhost.hsd1.ca.comcast.net> <53b48228-ea74-410f-af27-0dae2bc85f79@googlegroups.com> <20140915214837.GC53488@dhcp-128-32-252-51.lips.berkeley.edu> <8fa35efa-7be2-4af6-b5ef-c2998d467741@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1410888662 15217 80.91.229.3 (16 Sep 2014 17:31:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Sep 2014 17:31:02 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBS7H4GQAKGQEAF72NBA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Sep 16 19:30:57 2014 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-vc0-f186.google.com ([209.85.220.186]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XTwab-0006iY-35 for gtp-pandoc-discuss@m.gmane.org; Tue, 16 Sep 2014 19:30:53 +0200 Original-Received: by mail-vc0-f186.google.com with SMTP id ij19sf29241vcb.23 for ; Tue, 16 Sep 2014 10:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=from:date:to:subject:message-id:references:mime-version:in-reply-to :user-agent:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe:content-type :content-disposition:content-transfer-encoding; bh=ldRl/knGtlPIdZ44YGjUVr01izXChb06JkhfWiP5sx8=; b=grhms7U0u7C3VOrGDeyn46CXZ01F+u3s2SsWloVKOQM1Nnbl2PllitHowregGFDNNM zfTHNenvAqHhimXLMvk9FTlGUUSfWHKl24mrYLz9V6A6FVXTKuP/Nd0u+vM9RvhtyLZF 46X3lJ2CtssFoYzPtI2+9d67EH8hhMiHqu/7JI31pXRITdKJq/F4f/e3tTM5wjUGOKCh nxUH1wiEJln6LcPMD0vhkyaWgKTEWBIuZxbw53Ay0rzNUVCEozqUNeDLAig3gozy8KGV t3bQkolYZ6YUh7AhKoje9Q8f3Dz9Fkh53CEuVsOI8oZZfG0mdPeEQrMgXhK+term9rDd X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:subject:message-id:references :mime-version:in-reply-to:user-agent:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type:content-disposition :content-transfer-encoding; bh=ldRl/knGtlPIdZ44YGjUVr01izXChb06JkhfWiP5sx8=; b=Ae/mVW3VwglDiaxiJIIny8Hx7HzCeodm8rPluC2ieSut9uiin6g+oN/oS2uoSKVm08 fC+IJvCz/UxvX+lx1sY+6MMlQca0B/84+SM37GyQYumfO0GXGwATz9XoN2X1L8zY3IX4 GWvbC3aD0efahNoDiX7VMhjmX6g796khK98hPqzgIFzrxDHAuz0eJnUumj1e42JI12OX PQ+V9sl7GN4S4w2stxzGSxY8qbm7mTHd/A4D3dDvp6BcmJJU1A5O1IiHnO7bjKXbWWNd IVcj1NDbRRXxwtGAHB0CfpH5Uo8cAkcuP0be73Hff3Ui X-Received: by 10.50.117.7 with SMTP id ka7mr1500igb.2.1410888652285; Tue, 16 Sep 2014 10:30:52 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.50.44.43 with SMTP id b11ls177730igm.19.gmail; Tue, 16 Sep 2014 10:30:51 -0700 (PDT) X-Received: by 10.68.69.67 with SMTP id c3mr20020253pbu.3.1410888651708; Tue, 16 Sep 2014 10:30:51 -0700 (PDT) Original-Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by gmr-mx.google.com with ESMTPS id ss9si2359308pab.1.2014.09.16.10.30.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Sep 2014 10:30:51 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 209.85.192.180 as permitted sender) client-ip=209.85.192.180; Original-Received: by mail-pd0-f180.google.com with SMTP id ft15so221510pdb.39 for ; Tue, 16 Sep 2014 10:30:51 -0700 (PDT) X-Gm-Message-State: ALoCoQmbv/maRqAoiRlD7rGRlHAEZgUQ4nIK3D68pc2rwOMV/dLk9REknIcK+A+3K34DIiCdatqt X-Received: by 10.66.189.131 with SMTP id gi3mr25140849pac.114.1410888651581; Tue, 16 Sep 2014 10:30:51 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by mx.google.com with ESMTPSA id ow7sm14696474pbc.30.2014.09.16.10.30.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Sep 2014 10:30:50 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 4126CA162; Tue, 16 Sep 2014 13:34:32 -0400 (EDT) In-Reply-To: <8fa35efa-7be2-4af6-b5ef-c2998d467741-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-PGP-Key: http://johnmacfarlane.net/jgm.asc User-Agent: Mutt/1.5.21 (2010-09-15) X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 209.85.192.180 as permitted sender) smtp.mail=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Content-Disposition: inline Xref: news.gmane.org gmane.text.pandoc:10928 Archived-At: One possibility would be to have pandoc-citeproc wrap each bibliography entry in a pandoc Div element with the relevant attribute (and perhaps also an id attribute). I'd have to look at the code to see how hard this would be. Having these Divs might also allow us to support things like hanging indents, which are specified in the styles but currently unsupported. +++ mb21 [Sep 16 14 05:24 ]: > Yes, would it be hard to do? Maybe I could take a look at it... > On Monday, September 15, 2014 11:48:23 PM UTC+2, John MacFarlane wrote: > > I see. This would require changes in pandoc-citeproc as well. > +++ mb21 [Sep 15 14 10:47 ]: > >Yes, it's already in the ` data-cites=3D"item1">`, but > >not in the `

Doe, John. 2005. ...` > > > >So if I were to write some JavaScript to create a link, I've got no > easy > >target for the link. > > > >On Monday, September 15, 2014 7:41:01 PM UTC+2, John MacFarlane > wrote: > >> > >> This feature is already there, for HTML5 output: > >> > >> % pandoc -F pandoc-citeproc --biblio src/pandoc-citeproc/tests/ > biblio.bib > >> -t html5 > >> @item1 > >>

Doe > (2005)

> >>
> >>

Doe, John. 2005. First Book. Cambridge: Cambridge > University > >> Press.

> >>
> >> > >> > >> +++ mb21 [Sep 15 14 08:49 ]: > >> > Is it at least feasible for citeproc-hs to include the > citation-id so > >> > that pandoc-citeproc could use that (with a prefix to avoid > conflicts) > >> > as an id in the rendered bibliography? If we could get that, > I think > >> > the need for a generic solution would be greatly reduces > since it > >> would > >> > be relatively straight-forward to run some JavaScript to > convert the > >> > `data-cites` attributes to proper links=E2=80=94at least for t= he > simpler use > >> > case of one citation. > >> > On Monday, June 3, 2013 10:06:36 PM UTC+2, Makaken Affe > wrote: > >> > > >> > Mark Reid wrote: > >> > > >> > I will see whether there is any simpler, less general way to > achieve > >> to > >> > result I am after. If I can't I'll try to become more > familiar with > >> > citeproc-hs and CSL before asking those groups about a > possible > >> > extension along the lines of what you suggested. > >> > > >> > This feature has been asked before and before, so one should > at least > >> > provide guidelines for hacks. The HTML5 output format at > least > >> contains > >> > the citation ID in the `data-cites` attribute, which can be > converted > >> > to a link with some JavaScript or HTML postprocessing (easy > for single > >> > citations, more complex if multiple documents are cited > together). The > >> > references list, however does not contain this identifiers, > so one > >> must > >> > use heuristics to get the right link target. > >> > How about this dirty hack: > >> > 1. Create primary HTML5 output > >> > 2. Parse citation-ids from data-cites attributes > >> > 3. For each citation-id, e.g. @Foo2013 > >> > 3.1. create a temporary markdown document that only contains > >> [@Foo2013] > >> > 3.2. convert to HTML5 to get the reference > >> > 3.3. look for the same reference in the primary output > >> > 3.4. add a link target in this line, e.g. id=3D"ref-Foo2013" > >> > Jakob > >> > > >> > -- > >> > You received this message because you are subscribed to the > Google > >> > Groups "pandoc-discuss" group. > >> > To unsubscribe from this group and stop receiving emails from > it, send > >> > an email to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > . > >> > To post to this group, send email to > >> > [2]pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . > >> > To view this discussion on the web visit > >> > [3] > >> [1]https://groups.google.com/d/msgid/pandoc-discuss/e620c845- > f47b-4431- > >> > a44a-be15055566ac%[2]40googlegroups.com. > >> > For more options, visit [4][3]https://groups.google.com/ > d/optout. > >> > > >> >References > >> > > >> > 1. mailto:[4]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > >> > 2. mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > >> > 3. > >> [5]https://groups.google.com/d/msgid/pandoc-discuss/e620c845- > f47b-4431-a44a-be15055566ac-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=3D > email&utm_source=3Dfooter > >> > 4. [6]https://groups.google.com/d/optout > >> > > > >-- > >You received this message because you are subscribed to the Google > Groups "pandoc-discuss" group. > >To unsubscribe from this group and stop receiving emails from it, > send an email to [7]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > >To post to this group, send email to [8]pandoc-...@googlegroups. > com. > >To view this discussion on the web visit > [9]https://groups.google.com/d/msgid/pandoc-discuss/53b48228- > ea74-410f-af27-0dae2bc85f79%40googlegroups.com. > >For more options, visit [10]https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google > Groups "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to [11]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to > [12]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > [13]https://groups.google.com/d/msgid/pandoc-discuss/8fa35efa-7be2-4af6 > -b5ef-c2998d467741%40googlegroups.com. > For more options, visit [14]https://groups.google.com/d/optout. > >References > > 1. https://groups.google.com/d/msgid/pandoc-discuss/e620c845-f47b-4431- > 2. http://40googlegroups.com/ > 3. https://groups.google.com/d/optout > 4. javascript:/ > 5. https://groups.google.com/d/msgid/pandoc-discuss/e620c845-f47b-4431-= a44a-be15055566ac-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=3Demail&utm_source=3Dfooter > 6. https://groups.google.com/d/optout > 7. javascript:/ > 8. javascript:/ > 9. https://groups.google.com/d/msgid/pandoc-discuss/53b48228-ea74-410f-= af27-0dae2bc85f79%40googlegroups.com > 10. https://groups.google.com/d/optout > 11. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > 12. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > 13. https://groups.google.com/d/msgid/pandoc-discuss/8fa35efa-7be2-4af6-= b5ef-c2998d467741%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > 14. https://groups.google.com/d/optout --=20 You received this message because you are subscribed to the Google Groups "= pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/20140916173039.GB24079%40berkeley.edu. For more options, visit https://groups.google.com/d/optout.