hayagriva
hayagriva copied to clipboard
Change publisher to dictionary
Follows and fixes #34.
Changes:
- Changes the
publisher
field to be either aFormatString
or a dictionary withname
andlocation
. -
location
field remains but only for events; publisher location must be in thepublisher
field. - Update: Publisher name is now optional
To discuss:
- Should the
location
field of an entry be renamed (e.g.,event-location
) or handled in another way?
TODO:
- Document changes to format.
Could this be implemented in a way that makes defining a standalone location for everything that isn't an event possible? In my university it seems to be standard practice to sometimes only display the location of a book, not the publisher itself, so I don't always have that information. Right now I have to define an empty string for the publisher, which obviously isn't ideal. Currently this code is responsible for hiding the location if the publisher is None: https://github.com/typst/hayagriva/blob/d2db1fae5dcb258e649b1e78164c73320e95b664/src/csl/taxonomy.rs#L318 but obviously different in this new version.
Could this be implemented in a way that makes defining a standalone location for everything that isn't an event possible?
That would kind of be the current implementation. Technically, in my implementation you can always define a location but
- It is not intended as far as I am concerned;
- Translating from bib(la)tex to hayagriva would ignore the location as you define it. Cases like this is why this is a draft: We need some discussion on how the format should be changed.
In my university it seems to be standard practice to sometimes only display the location of a book, not the publisher itself, so I don't always have that information.
If I may ask: Why? And what style are you using? It seems odd and is certainly not intended by most styles.
Right now I have to define an empty string for the publisher, which obviously isn't ideal. Currently this code is responsible for hiding the location if the publisher is None:
https://github.com/typst/hayagriva/blob/d2db1fae5dcb258e649b1e78164c73320e95b664/src/csl/taxonomy.rs#L318 but obviously different in this new version.
In my version, hayagriva behaves exactly the same: If no publisher is present, it shows no location.
If I am correct, and having a location but no publisher is not intended, adding an empty string seems fair.
This PR might have been the wrong place to bring this up because, as you say, it doesn't change the behaviour I'm talking about. I'm also not sure whether my initial impression is correct that it'd make exposing a location without a publisher more difficult.
I don't know which style they use, I'm not even sure they use a standard because at least one professor sometimes includes the publisher's name, sometimes they don't. I have briefly looked at the citations in two text books and one of them also only prints the location, so my professors don't seem to be that far from the standard of the field (social science). I will ask them though, if I get the chance.
Below are some example citations (in German, unfortunately):
What's the rationale behind hiding the location when the publisher isn't set? My workaround works well, and setting a single empty string isn't too bad, I was just very confused by this behaviour. But documenting that would resolve it as well. Does bibtex do the same? I don't have any experience with that, unfortunately.
This PR might have been the wrong place to bring this up because, as you say, it doesn't change the behaviour I'm talking about. I'm also not sure whether my initial impression is correct that it'd make exposing a location without a publisher more difficult.
It’s supposed to make it clear that they belong together, usually.
I don't know which style they use, I'm not even sure they use a standard because at least one professor sometimes includes the publisher's name, sometimes they don't. I have briefly looked at the citations in two text books and one of them also only prints the location, so my professors don't seem to be that far from the standard of the field (social science). I will ask them though, if I get the chance.
That’s very weird. Line I said, it’s supposed to be the location where it’s published, which is odd without a publisher.
Below are some example citations (in German, unfortunately):
I’m German so that’s fine. If you can ask someone why they wrote it like that, that would be great!
What's the rationale behind hiding the location when the publisher isn't set? My workaround works well, and setting a single empty string isn't too bad, I was just very confused by this behaviour. But documenting that would resolve it as well. Does bibtex do the same? I don't have any experience with that, unfortunately
BibTeX is too permissive here, it seems.
Okay after looking through some more random sociology and political science books, only two included the publisher's name and five didn't while all included the location. Obviously not representative, but I think it shows that that style is at least somewhat common place.
And don't get me wrong: I think it's pretty weird too and it makes finding the correct book a lot harder but maybe hayagriva might want to support it because enough people seem to use it? Besides, what is the actual gain of forbidding it?
Also I think making the name
field optional on the Publisher
struct could be enough to support it? That should also make it clear that it's supposed to be the location of the publisher, even if no name is given
Okay after looking through some more random sociology and political science books, only two included the publisher's name and five didn't while all included the location. Obviously not representative, but I think it shows that that style is at least somewhat common place.
And don't get me wrong: I think it's pretty weird too and it makes finding the correct book a lot harder but maybe hayagriva might want to support it because enough people seem to use it?
Strange... But yeah, in that case we should support it. The question is whether we consider it rare enough that setting the publisher's name to an empty string is the way to support it (in which case, we should document that), or just disregard this PR.
Besides, what is the actual gain of forbidding it?
The gain of this PR is to structure the information in hayagriva better. And as far as I can see, in the vast majority of styles and for most tools, a location without a publisher is not intended.
Also I think making the
name
field optional on thePublisher
struct could be enough to support it? That should also make it clear that it's supposed to be the location of the publisher, even if no name is given
That's possible. But if someone just writes publisher: some string
, should we still consider this the name?
That's possible. But if someone just writes publisher: some string, should we still consider this the name?
I think that's a good compromise, maybe it could accept the following:
guide:
...
publisher: Megadodo
guide:
...
publisher:
name: Megadodo
location: Ursa Minor
guide:
...
publisher:
location: Ursa Minor
Would that work?
That looks good
I think that renaming location
to event-location
is too broad. What, for example, if you want to encode the Geo-Tag of a social media post or that you are citing the manuscript that your mentor wrote on Base Camp of Mount Everest? Otherwise, this change looks good to me!