Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layCite should not use showUID #2805

Open
Ant13731 opened this issue Aug 19, 2021 · 2 comments
Open

layCite should not use showUID #2805

Ant13731 opened this issue Aug 19, 2021 · 2 comments
Assignees

Comments

@Ant13731
Copy link
Collaborator

From @JacquesCarette,

So I think the idea is that an EntryID might actually be different. In fact, I think it's a hack that we're using the UID for the EntryID. The EntryID will be user-visible, at least inside the sources. UIDs, other than in debugging (or the dependency graph) really should be invisible.

Specifically, layCite should not use showUID:

-- | For importing a bibliography.
layCite :: Citation -> P.Citation
layCite c = P.Cite (showUID c) (c ^. citeKind) (map layField (c ^. getFields))

@balacij
Copy link
Collaborator

balacij commented Jan 24, 2023

So, I'm not entirely sure what the context of that quote is, but, from looking at that code snippet, I'm not quite sure that I understand what the need is for the P.Citation data type. Is it meant to be an internal citation with extra restrictions for printing into other artifact types?

In any case, in the spirit of #2788 and #2873, if P.Citation is a chunk type (and I think it should be considered one), then it should have (a) a “drasil”-related UID and (b) a “UID” that it exposes for printing. While they might be equivalent, we shouldn't rely on that coincidence because the UID is internal cruft while the “UID” field that defines the citation is a part of its definition.

Additionally, instead of using showUID, since this chunk is derived from another, we might prefer to use one of the new UID constructors used in #2788.

@JacquesCarette
Copy link
Owner

I believe that P.Citation is an internal type for "printing-ready form for a citation". It is still format independent, but it has been "unpacked".

I think Citation is a chunk type, P.Citation isn't, and doesn't need to be. It is Citation that is a little broken, because it does not contain the needed information, which is the human-printable label we want to refer to this citation as. I think we should take a page out of bibtex (and friends) on how to derive these labels.

@balacij balacij self-assigned this Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants