jkomoros / card-web

The web app behind thecompendium.cards
Apache License 2.0
46 stars 8 forks source link

A system for external citations #202

Open jkomoros opened 4 years ago

jkomoros commented 4 years ago

Would show up in the info panel of a card (with a possible shortcut to it showing on the card itself).

A citation is a title, a link, an optional page number or other secondary information, and then a blob of markdown text

jkomoros commented 4 years ago

Some of the manual todos in the content library actually are citations

jkomoros commented 4 years ago

These should actually be called "References", with a citation boolean on them for ones that are an explicit citation. Otherwise they're just "see also, but for non-cards"

jkomoros commented 4 years ago

And then references should also have a "Same author" bool, which is to say, content from the same person who authored the card--which is more of a reference to an alternate medium for that content.

jkomoros commented 4 years ago

Should references be factored somewhere central? That would allow in the future doing something like "Show all cards that reference seeing like a state"

jkomoros commented 3 years ago

Have the references (should they be called citations in the internals, since that's more clear than the more general 'reference's) be a card, of type=reference. Cards that are references can also reference other cards. These references can be of reference_type tweet, person, publication. Each one has different fields that are expected. Like url, picture, etc.

Will need to factor it out so you can do queries on non-content cards. Maybe have an implied queryPrefix that the dialog normally sets to card-type:content but that can be set to card-type:reference.

Cards have a references map, which is just a map of card_id to true. Or, the key can be a string, which then means that the string gives more information about the reference, for example what page within the reference the thing comes from. (How to allow for direct vs indirect references, as noted above? most will be 'inspired by'). Could have two separate maps, or could be that the values of the keys of the map can have more information in them.

See also the issue about more formal ways of cards being related to each other (e.g. see also) and see what about that design makes sense to use.

... Should every author of cards or comments in the card web have their own reference card?

Create a separate issue to track having content-editable for different fields that's easy to do instead of highly intricate and bespoke like body. (Although if it's just a single text with no styling allowed the other fields will likely be easier)

jkomoros commented 3 years ago

Fields would include description, twitter link

jkomoros commented 3 years ago

Some citations are soft, e.g informed by a conversation with that entity. Some are very formal and specific, e.g. a quote. Some are more indirect, a general idea. That specificity might be implied in what you link to.

E.g, link to a person: very indirect. Link to a broader body of thing: more specific. Link to a specific page of a specific thing: most specific.

jkomoros commented 3 years ago

The idea of having these be literal cards, which would have to be explicitly excluded from all kinds of stuff, like similar cards, etc, seems messy. Derived cards (#344) feels like the right path.

jkomoros commented 3 years ago

When adding a new reference-type (as in #354), perhaps add a configuratino field for each of whether they should have any restrictions on what types of cards you can point to

jkomoros commented 3 years ago

Now with concept cards being fully fleshed out and all of the other associated machinery, this might not be THAT hard to do. There's still the question of if the data canonically lives in special fields that are only on citation cards or somewhere else.

jkomoros commented 3 years ago

There's two new type of card, a citation-author and citation-work card. They're both citations type cards. (Should we formalize the notion of sub-types of cards? E.g. a full-bleed card and quote card (#465) could be sub-types of content cards)

A new type of reference, a citation, which can point from any card to any card of type citation-*. If the link to the citation card has specific text (e.g. a page number) then it's a 'hard' citation, otherwise it has a soft citation. (What's the UI for setting this?)

Each citation card has the following types of derived fields (some of which might be empty):

Notionally every citation reference points to a citation-work card. The work card has a set of authors, which might be set directly on the card (e.g. in a title_alterrnates-style field) or it might itseld cite citation-author cards, and extratct their titles to use as the set of authors.

In some cases though a specific work doesn't exist to cite; maybe it was based on an unciteable conversation with that person. Or maybe we don't yet have the specific work to reference, a kind of TODO. In either of these cases the card can have a citation reference directly to the author, which is effectively sugar for an implied citation-work card with a blank title and that one author.

A citation-work card will backport its authors field based on backported titles of author cards it cites. A citation-author card may not use a citation reference to any other cards. A citation-work card may only use a citation-reference to cards of type citation-author.

A citation reference backports text from the citation card it links to of the form <work-title> :: <author>, <author>. That structure allows it to have that data factored out on the card itself.

(Check the titles of works to ensure they never have the ::. Or maybe the delimiter should be \n, with the first line being work title, then each subsequent being an author).

jkomoros commented 3 years ago

backportFallbackTextMapForCard could be extended so instead of fetching title directly from other card, it uses cardTitleForFallbackText(card, reference_type). But the transitive nature of citation-work to citation-author still implies that citation-work have their titles done first before that...

But then that also breaks the "unset text for soft citation" thing

It's not that big of a deal to do the citation-work title generation by first backporting the text of citation-author to citation-work. synonymMap has a TODO to do multiple iterative runs on backporting, which is more annoying than this is, for a simple two-phase backporting

No need to treat Links specially; they can just be bullets lists in the body field.

It's not a big deal to have getCardTitleForBackporting manually go back for each card that has refs to an author, because it will be relatively rare and also only one ply backward.

jkomoros commented 3 years ago