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

Make publisher a name variable. #368

Open
wants to merge 14 commits into
base: v1.1
Choose a base branch
from

Conversation

bwiernik
Copy link
Member

@bwiernik bwiernik commented Aug 18, 2020

Description

Make publisher a name variable and add place attribute to the name variable schema. This will permit correct rendering of multiple publisher/publisher places.

Also:

  1. adds new cs:name @form "none" to omit name and et-al elements from a names citation (e.g., to permit only the publisher-place to be rendered)
  2. adds @form attribute to cs:et-al. form="none" suppresses the et-al term. The options here are consistent with the same attribute used in cs:citation-label-format

Existing styles can be programmatically updated to achieve the current output behavior by replacing:

<text variable="publisher"/>

with

<names variable="publisher">
  <name form="long" delimiter="; "/>
</names>

and

<text variable="publisher-place"/>

with

<names variable="publisher-place">
  <name form="none"/>
  <place delimiter="; "/>
</names>

Fixes #13

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Copy link
Member

@bdarcus bdarcus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some feedback, but was hard to tell the diff since you moved names to a separate file.

Any chance you have a diff you can post of just the changes there?

schemas/input/csl-data.json Show resolved Hide resolved
schemas/input/csl-data.json Show resolved Hide resolved
schemas/input/csl-data.json Outdated Show resolved Hide resolved
schemas/styles/csl-names.rnc Outdated Show resolved Hide resolved
@bwiernik
Copy link
Member Author

Any chance you have a diff you can post of just the changes there?

Perhaps look at the individual commits? I initially moved the names to a new file without any changes.

@bdarcus
Copy link
Member

bdarcus commented Aug 18, 2020 via email

@bdarcus
Copy link
Member

bdarcus commented Aug 18, 2020

Actually, no it doesn't. The first commit is that; there's no commit with a diff of the main schema file.

Or if it's straightforward, I suppose you could just tell us what changed on that schema.

@bwiernik
Copy link
Member Author

On the main schema file, I just removed the cs:names content and the names-related style options.

@denismaier
Copy link
Member

Make publisher a name variable and add place attribute to the name variable schema. This will permit correct rendering of multiple publisher/publisher places.

In addition, this PR adds a new option for @form ("none"), right? Anything else? Maybe you could add that to the initial comment.

@bwiernik
Copy link
Member Author

Make publisher a name variable and add place attribute to the name variable schema. This will permit correct rendering of multiple publisher/publisher places.

In addition, this PR adds a new option for @form ("none"), right? Anything else? Maybe you could add that to the initial comment.

Update.

Also:

  1. adds new cs:name @Form "none" to omit name and et-al elements from a names citation (e.g., to permit only the publisher-place to be rendered)
  2. adds @Form attribute to cs:et-al. form="none" suppresses the et-al term. The options here are consistent with the same attribute used in cs:citation-label-format

@denismaier
Copy link
Member

Maybe I've missed it, but I've only seen delimiters between names and between places. But how do you actually specify the colon between the place and the publisher? Simply an affix on the name element?

schemas/styles/csl-names.rnc Outdated Show resolved Hide resolved
schemas/styles/csl-names.rnc Outdated Show resolved Hide resolved
@bwiernik
Copy link
Member Author

@denismaier Yes, like with a label.

@denismaier
Copy link
Member

denismaier commented Aug 19, 2020

@denismaier Yes, like with a label.

I've tested with the 1.1 branch:

<names variable="author">
  <label suffix=". "/>
</names>

Jing complains about the suffix on label. "Attribute 'suffix' not allowed here."

But that is:

<names variable="author">
 <name suffix=". "/>
 <label/>
</names>

So the idea is to do this?

<names variable="publisher">
 <place/>
 <name prefix=": "/>
</names>

@denismaier
Copy link
Member

If I remember correctly, 1.0.1 had affixes on cs:label. Why have we removed them?

@bwiernik
Copy link
Member Author

That's a bug. label.attributes-shared should be part of the names.label list.

@bwiernik
Copy link
Member Author

@denismaier That's fixed now.

@denismaier
Copy link
Member

But it is still only on label, not on place, right? Is that on purpose?

@bwiernik
Copy link
Member Author

Nope! Fixed.

@bwiernik
Copy link
Member Author

bwiernik commented Aug 19, 2020

I added most of the text formatting attributes. Any that place shouldn't have? Only one I'm not really sure about is strip-periods?

      affixes,
      font-formatting,
      strip-periods,
      text-case,

@denismaier
Copy link
Member

denismaier commented Aug 19, 2020

Not sure.
On the other hand, do we need an attribute to specify state formatting rules? "Cambridge/MA" vs "Cambridge (MA)"

@bwiernik
Copy link
Member Author

No, we've never had something like that before where we edit the contents of a string. I suggest we not do that now.

@bwiernik
Copy link
Member Author

bwiernik commented Sep 5, 2020

@bdarcus RTM?

Versus separate names.abbreviation, names.alternate, or names.place elements
@bwiernik
Copy link
Member Author

bwiernik commented Nov 2, 2020

@bdarcus @denismaier I reworked the names structure to use a single cs:names element for all of place, abbreviation, and alternate. Can you look over the csl-names.rnc schema again?

@denismaier
Copy link
Member

denismaier commented Nov 3, 2020

@bwiernik Can you please give a brief summary of your changes? And perhaps a couple of examples. It's been a while since we've discussed this.

@bwiernik
Copy link
Member Author

bwiernik commented Nov 3, 2020

The current state: If a style wants to show an institution abbreviation, an alternative name (e.g., a pseudonym or screenname), or a place, they would add a cs:component element as a child to cs:names.

This is a change from the previous version, where each of these three had separate child elements on cs:names.

So, for example, to render publisher and publisher place:

<names variable="publisher">
  <component component="place" suffix=": "/>
  <name form="long"/>
</names>

So, to render an institutional name in long form with the abbreviation the first time, then just the abbreviation subsequently:

<names variable="author">
  <name>
    <name-type name="personal" form="short"/>
    <name-type name="institutional" form="long" form-subsequent="short"/>
  <name/>
   <component component="abbreviation" prefix=" [" suffix="]"/>
</names>

To render a name with its alternative form:

<names variable="author">
  <name form="long" name-as-sort-order="all"/>
  <component component="alternative" prefix=" [" suffix="]"/>
</names>

A single cs:names element might have multiple of these, such as both abbreviation and alternative.

@bdarcus
Copy link
Member

bdarcus commented Nov 3, 2020 via email

@bwiernik
Copy link
Member Author

bwiernik commented Nov 3, 2020

In general and at first glance, looks good ... except for that
component/@component duplication.

Is that correct, or a typo?

Not following. The name of the element is component, and it has a component attribute indicating which component to render.

@bdarcus
Copy link
Member

bdarcus commented Nov 3, 2020 via email

@bwiernik
Copy link
Member Author

bwiernik commented Nov 3, 2020

I really don't see the problem. The element is "Add another component". The attribute is "which component should we add?". It's not ambiguous. We could rename the attribute which or which-component, but why make it more ambiguous or verbose? The closest analogue we have currently is the cs:name-type element has the name attribute to mean "Why type of name is it?" Honestly, that would be clearer as attribute name-type to me, too. But I don't have a strong preference.

Edit: Oh, name there refers to the name of the element, not a name variable.

@denismaier
Copy link
Member

Ok, this change does not affect the general behaviour here, or does it? It's only that there's now one element instead of multiple, correct?

Anyway, it's hard for me to get a grasp of this using the web interface. Is it possible to checkout the PR or a certain commit? I could do some tests then in with Atom or Oxygen. @bdarcus ?

@bwiernik
Copy link
Member Author

bwiernik commented Nov 5, 2020

Exactly.

See here for how to check out a PR http://stackoverflow.com/questions/27567846/ddg#30584951

@bdarcus
Copy link
Member

bdarcus commented Mar 6, 2021

Where do we stand with this one?

The issue does flag an unaddressed requested change, which I assume @bwiernik did address. If yes, can you please click that you did so, so that goes away?

And on a related note, once PRs are ready, nothing has changed; right? Since this has no conflicts, I can just do the merge?

I will plan to follow @denismaier's thought to actually test it soon.

@bwiernik
Copy link
Member Author

@bdarcus Is this good to merge now?

@bdarcus
Copy link
Member

bdarcus commented Mar 27, 2021

@bdarcus Is this good to merge now?

Can you just respond to my last note, then I can test it tomorrow.

IIRC, the only issues was the name/name node name issue.

@bwiernik
Copy link
Member Author

I resolved the component element/attribute issue yes.

Copy link
Member

@bdarcus bdarcus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a few minor requests. In the meantime, I'll spend some time testing the rnc schema changes.

When you resolve, can please indicate that you've done so by clicking whatever github button. I forget how to actually do so, but I think it's straightforward.

EDIT: I just tried to load the csl.rnc file in nxml-mode, and got the following error:

nxml-display-file-parse-error: Reference to undefined pattern names-inheritable-options

Is it because you don't include the csl-names.rnc file?

If I do that, the rnc-validate-format.sh script reports ...

.../csl-names.rnc:309:7: error: syntax error

... though I'm confused by that.

@@ -243,7 +243,18 @@
"alternate": {
"title": "Alternative name, such as screen name for online item or real name of pseudonymous author.",
"description": "E.g. rendered as 'Smith, J. [@JSmith]'",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please include "examples" in the json schema, as elsewhere, @bwiernik?

@@ -472,6 +483,14 @@
"$ref": "#/definitions/name-variable"
}
},
"publisher": {
"title": "Publisher of the item",
"description": "e.g., [{'institution': 'Publisher', 'place': 'London, UK'}], [{'institution': 'Publisher A', 'place': 'New York, NY, US'}, {'institution': 'Publisher B', 'place': 'Berlin, Germany'}]",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here; the "e.g." stuff should go in "examples"; see the title properties, or "custom".

@@ -634,7 +653,7 @@
"type": "string"
},
"original-publisher-place": {
"description": "[Deprecated - Use `original` related `publisher-place` property instead]",
"description": "[Deprecated - Use `original` related `publisher` property `place` property instead]",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "[Deprecated - Use `original` related `publisher` property `place` property instead]",
"description": "[Deprecated - Use `original` related `publisher` property `place` instead]",

Right?


## If name="alternate", use to apply separate formatting to individual name parts or to personal vs. institutional names
name.name-part,
name.name-type
Copy link
Member

@bdarcus bdarcus Mar 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name.name-type
name.name-type }

I think this is the change you need for the one error, but then I get others.

Unless I'm doing something wrong with git, maybe double check the syntax problems and let me know when I can try again?

EDIT: obviously the CI isn't working correctly, as it should have flagged these issues.

@bdarcus
Copy link
Member

bdarcus commented Oct 16, 2021

Status of this PR?

Also, now that you're working on 1.1, any objections @cormacrelf?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants