-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add sub/main form values to cs:text #271
Conversation
Good call. Is it possible to validate a style so that the I think that the |
Yes it is. It's just not easy, so I want confirmation before doing it.
I think so. The case that would be relevant here is a simple title like "A Book."
Yes, but also, these two issues are, I think, related. I was planning to build on this to resolve the first point. But I can do that other ways; it's not necessary. |
I would like the validator to reject something like |
This allows specification of formatting for split title parts; like subtitles.
d3c0375
to
f2e7c77
Compare
Should work as expected now. Relevant change is here. I removed the additional stuff I did earlier, so this is mostly just adding this. |
I also just removed the sub/main title variables. Which raises a question I think I should ask at this point: should we move "-short" titles to this mechanism too? |
Yes. Short should be moved to this too. But short is relevant for more than just titles. |
We could deal with those questions separately?
For now, just about titles and text.
|
Actually, short variables are only on titles, so I think this only applies to titles? |
But the plan was to extend short to other variables as well, right? |
So two options (I don't care):
Preference? |
In any case, when you guys are ready to GTM, please approve the PR. |
Let’s remove short from rnc. Should stay in some form in JSON. Can’t see How to access the review system on mobile, but this looks good to me |
Git question: how can I checkout a PR for testing? |
Here's one, direct, way. Can also fetch the branch, then check it out. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's drop -short
and then LGTM
Concerning json input: @dhimmel has indicated elsewhere that we might find a solution that doesn't involve polluting the json schema with I was only able to find this comment by @dhimmel on this topic, but maybe he can give some more hints on what would be involved, and on potential drawbacks. Besides that, looks good to me. |
The @Form='short' variant can be used to access this, and so this removes all the -short title variants.
schemas/styles/csl-variables.rnc
Outdated
@@ -122,10 +116,7 @@ div { | |||
| "section" | |||
| "source" | |||
| "status" | |||
| "title" | |||
| "title-short" | |||
| "translated-title" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
translated-title
should be under "variables.titles", shouldn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't translated-title
be moved to variables.titles
?
Should |
I was assuming no, so in the process of removing them from there. |
@denismaier I don't understand this PR (and the RNC side of things) sufficiently to weight in here. It looks like their are four possible forms:
As far as the CSL JSON goes, given that container-title:
long: PLOS Computational Biology
short: PLOS Comp Bio As opposed to the traditional: container-title: PLOS Computational Biology
container-title-short: PLOS Comp Bio But keeping this traditional syntax valid (at least for |
Why no? As they are clearly titles, I guess they should be there as well. |
Because they were listed in under the "strings" list; not titles. See the latest commit and confirm that looks right? |
Not written yet. But, examples: title: "Some Title: And a Subtitle"
main: Some Title
sub: And a Subtitle "Short": when we originally defined it, I thought of it as alias for what we now introducing as "main." But it seems for very long titles, they may differ. These are style details, BTW; not necessarily translating to the input json, which would stay the same. We'll define heuristics to derives these subfields. |
Yes, they are not the same. title: "An important title: and a subtitle"
main: "An important title"
short: "important title"
sub: and a Subtitle |
Yes, but as |
I was hoping that we could get away with some sort of addition to the the specs: "processors should accept -short variants to all variables." Or something similar? Wdyt @dhimmel? Would that be reasonable? |
And then also add On one hand, we could keep the number of CSL JSON top-level fields minimal with a syntax like: title:
long: "An important title: and a subtitle"
main: "An important title"
short: "important title"
sub: and a Subtitle On the other hand, there seems to be a preference for flat CSL JSON (ignoring the funky date-variables nesting). And some of the flat fields already exist like If going with the flat structure, I think it's best to update the CSL JSON schema to include these properties. I don't think it makes sense to add To enable the flexibility to add suffixes to CSL fields, we could look into JSON Schema pattern properties. This would allow us to keep the number of schema definitions from exploding: {
"type": "object",
"patternProperties": {
"^title(-long|-sub|-main|-short)?$": { "type": "string" }
},
"additionalProperties": false
} |
I don't believe that will be necessary, as these can be derived from the full title.
It also occurred to me recently that we could use this mechanism, and possibly a similar one in rng, to allow prefix extension data; like That would be a big decision to make, but it seems easy enough technically. And we could couple it, say, with a wiki to collect the extensions. |
Yes, also
Each of those will have
This looks promising. This will work for {
"type": "object",
"patternProperties": {
"^(container-|collection-)?title(-long|-sub|-main|-short)?$": { "type": "string" }
},
"additionalProperties": false
} Or should we add one pattern per title? {
"type": "object",
"patternProperties": {
"^title(-long|-sub|-main|-short)?$": { "type": "string" },
"^container-title(-long|-sub|-main|-short)?$": { "type": "string" },
"^collection-title(-long|-sub|-main|-short)?$": { "type": "string" }
},
"additionalProperties": false
} Readability is better here, but it is redundant, of course. Maybe something like this? {
"type": "object",
"patternProperties": {
"^(container-
|collection-
|volume-)?
title(-long|-sub|-main|-short)?$": { "type": "string" }
},
"additionalProperties": false
} |
Sure we need them. Heuristics can fail and we need to provide some way to override those derived variables. |
We were cross-posting.
What applications or legacy data formats will allow a user to manually specify these though? E.g. how would that "override" process actually work? Biblatex has some of it, but handles in a flat representation, which is analogous to allowing @Book{Williams2002,
Title = {Free as in Freedom},
Author = {Williams, Sam},
Publisher = {O'Reilly Media},
Year = {2002},
ISBN = {0-596-00287-4},
Subtitle = {Richard Stallman's Crusade for Free Software}
} |
In Zotero you will just add The assumption is: Users enter the full title in the |
Concerning biblatex: Biblatex's |
I agree that there should be a way to manually specify
None yet, but perhaps in the future some. For Manubot we edit CSL JSON by hand when automated generation fails. Our reference manager is a bunch of persistent identifiers for which CSL JSON is automatically generated. And when that fails, the user manually provides the CSL JSON.
I like this format because we should be defining JSON Schema's |
To elaborate on this, what this behavior is is that citeproc-js has behavior to extract CSL variables from the top of |
This uses @Form to allow specification of formatting for split title parts; like subtitles. Also, removes -sub/-main and -short title variables, which are no longer needed.
This uses @Form to allow specification of formatting for split title parts; like subtitles. Also, removes -sub/-main and -short title variables, which are no longer needed.
Description
This moves specification of split title components from dedicated variables to new "sub" and "main"
@form
values.Removes the -short title variable variants as well.
Type of change