Citation system update

46 views
Skip to first unread message

san...@gmail.com

unread,
May 27, 2019, 3:06:57 PM5/27/19
to Pollen
Joel and I each shared our approaches to footnotes a while back (https://groups.google.com/d/msg/pollenpub/laWL4SWx0Zc/bNGZyKpABQAJ)

I now have a more complete citation system running in my Pollen setup:
I useful pattern that I've resorted to a few times is having Pollen tags render a placeholder span that either gets replaced or filled in during a later decode.

I do this with an empty placeholder span for short-forms in an initial citation. These initial short-forms don't actually get filled with content unless the work is cited a subsequent time in a way that uses the short-form. (I.e. I don't show a short-form if it is never used.) This replacement happens in the final decode (when we have the final citation count for each work and know whether it is necessary to display the short-form in the initial citation).

I also do this within the note tags. They detect whether any cited work that is contained within the note has already been cited previously. If a work has been cited previously, the note replaces the full-form citation with a short-form and back-reference. I use html data- attributes (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/data-*) to pass enough semantic information along with the full-form-citation span to allow Pollen to easily replace those spans with the appropriate short-forms and back-references.

Let me know if you have any suggestions for improvement or simplification.

Matthew Butterick

unread,
May 27, 2019, 8:13:07 PM5/27/19
to san...@gmail.com, Pollen
Looks cool! You should turn this into an installable Racket package with docs & tests, perhaps? I'm sure others would benefit from your suffering.

san...@gmail.com

unread,
May 29, 2019, 2:15:38 PM5/29/19
to Pollen
Yeah! I want to extract and make more generic the parts of this that can be used across projects so that my factum/paper authoring tool can use the same citation system as my website. I may as well prep it as a package.

Shrutarshi Basu

unread,
May 30, 2019, 10:18:56 AM5/30/19
to san...@gmail.com, Pollen
You may want to look at how BibTex or LaTeX do their citations. They may give some ideas and spare you the pain of reinventing the wheel. Unfortunately I don't know if this is documented simply anywhere so I don't have any pointers for you.

Thanks,
Basu

--
You received this message because you are subscribed to the Google Groups "Pollen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pollenpub+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pollenpub/0f5c3d70-cc28-484f-a321-cb874f134565%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Shrutarshi Basu
The ByteBaker -- computer science is not about computers

san...@gmail.com

unread,
Jun 8, 2019, 12:03:46 PM6/8/19
to Pollen

Still filling out tests, contracts, and documentation.

On Monday, May 27, 2019 at 5:13:07 PM UTC-7, Matthew Butterick wrote:
Reply all
Reply to author
Forward
0 new messages