A +*citations card can be added to any card or list of cards to find their citations. For example, if the above card were entitled "Squorigins", the collection of citations inside it would be called "Squorigins+*citations}}. If you have X+*citations and X is a collection (Pointer or Search), then we should find all the citations referred to in the collection.
Note that these become standard inclusions and can use all the same patterns as normal inclusions.
Tricky Parts
There are two keys ways we might implement the +*citation card, as a virtual Search or as a virtual Pointer. each has its challenges.
+*citation as search
One big trick here is that we don't yet have a way to narrow inclusions on the basis of the view with which they are included. You can find all the cards that A includes, but not all the ones that it includes in open or (more relevantly) "cite" view. But to match the superscript numbers (and to have the numbers be consecutive) it's important that the results all of the cited sources and only the cited sources.
The other trick is that searches don't yet have the capacity to return results in Pointer order, so see respect order of Pointer items found with referred_to_by.
+*citation as pointer
There are two ways we could do citations as a pointer: static(real) and dynamic(virtual).
In the static solution, every time you save a card with citations, it automatically generates a pointer card that stores all the citations in a pointer. The advantage of this solution is speed. The tricky part is configuration / implementation. What triggers the generation of the citation? If it's the presence of the "cite" view, then again, as in searches, there's some trickiness, as there's not really a trigger mechanism based on views. Even harder: how would Wagn know to add the more complex citation patterns mentioned above?
In the dynamic solution, when you go to card1+*citation, it parses card1 on the spot and generates the citation card right then. This is slower, but you don't need much configuration: you just do the citation lookups whenever they're requested.
numbering across multiple cards
Regardless of the solution for the citation list (search or pointer), it will be tricky to handle numbering citations differently for multiple cards. For example, imagine that we were trying to grab citations from both +summary and +about and we wanted them in one list. If we have some three sources in +summary and four sources in +about, we would need +summary to have citation [1], [2], and [3], and then +about has citation [4], [5], [6], and [7]. That means the wagn renderer would have to have more contextual information than it currently has. when rendering one card it would need to know (a) that it was going to be part of the generation of a citation list and (b) where it fit into the current order of things.
One solution might be to generate the numbering in javascript so that the renderer can still be a bit dumb on this stuff, but in any case there's a whole lot of "awareness" that will need to be added somewhere in the system for this to work.
Next Steps
I (efm) would suggest that we start small on this. That means that we start by implementing:
- as a module for wikirate.org and then generalize if there is interest.
- using the "real" pointer solution, using wikirate modules to trigger their creation (meaning this will be set up in code, not via wagneering)
- for single cards only. That's not to say that you can't use queries to generate meaningful lists of sources (you can); it just means you can't do citation numbering across multiple cards yet.