Module talk:Citation/CS1/Archive 12
![]() | This is an archive of past discussions about Module:Citation. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 5 | ← | Archive 10 | Archive 11 | Archive 12 |
Author parsing
So after the latest blowup over template changes, I think adopting the "vauthors=" mechanism from Template:Vcite2 journal is worth serious consideration. The current approach is very unambiguous, but having the first and last name of every author as a separate parameter makes for very bloated markup, and it's definitely a burden on those of us who are still hand-typing citations. I support the goal of making our references into something semantically meaningful, because I think that many useful tools for article curation could be built if we had a reliable way of identifying which articles were supported by which references, which journals, books, authors, etc. But the content has to come first: if the semantic markup scheme is deterring authors from editing, there is a serious problem. In the big picture, it's much more important to have people identify sources in medical articles as being WP:MEDRS (or not) than it is for those references to emit correct metadata. (I think the medical articles tend to be a bigger friction point because they often have very large author lists that bloat enormously.)
So, is it possible to graft the parsing code for "vauthors=" onto the "authors=" parameter here? I assume "authors=" already dumps its entire string as a single author into the COinS metadata, so it's unlikely to make things worse. And is it possible to parse "et al." or "''et al.''" at the end of that string without needing explicit markup? I have enough experience of HTML parsing to know that this kind of "do what I mean" parsing is risky, but given the debacle of the Visual Editor rollout, we're going to have to cope with hand-writing these templates for quite a while. Explicitly marking up every author may be less prone to error, but this isn't the first time there has been pushback about this, and I think this solution might make the process of structuring references a lot less objectionable. Choess (talk) 02:18, 6 May 2015 (UTC)
- I haven't given the question of how would
|vauthors=
parsing work within Module:Citation/CS1 a great deal of thought but I'm pretty sure that it could be done. And it would produce better metadata because a requirement of|vauthors=
would be that author (and editor) name lists would be required to adhere to the Vancouver system. Because|authors=
does not have that kind of requirement, a wide variety of formats can be found.
- Module:Citation/CS1 already recognizes a variety of et al. forms. It is that recognition that causes the population of Category:CS1 maint: Explicit use of et al. That same recognition strips the et al. from the author and editor lists before they are sent to metadata and causes the module to render the author and editor lists with the standardized form of et al. appended. The cs1|2 templates' remit includes handling and placement of static text but it is necessary to have a proper and consistent mechanism to inform the template when it should render certain static text. This is why we have
|display-authors=etal
.
- When editors feel free to add non-author-name text et al. to author-name parameters, I think that they then feel free to add other non-author-name text to author-name parameters in spite of instruction to the contrary in all cs1|2 documentation. Et al. is relatively easy to detect and compensate for; other text, not so easy; if it were, I'd have a category full of pages that have such cs1|2 template parameters.
Redirect this page to Help talk:Citation Style 1?
Should we redirect this page to Help talk:Citation Style 1? That page is watched by 160 editors, while this one is watched by only 60, and they are essentially the same forum. I think we should have just one discussion location for issues relating to the CS1 templates. – Jonesey95 (talk) 03:21, 14 May 2015 (UTC)
- I would support this.
- —Trappist the monk (talk) 11:33, 14 May 2015 (UTC)
- Given the above discussion occurred, absolutely. --Izno (talk) 19:49, 14 May 2015 (UTC)
- And see the proposals below. I support the redirect. Just merge the existing discussions into the talk over there, if still active, archive them otherwise. — SMcCandlish ☺ ☏ ¢ ≽ʌⱷ҅ᴥⱷʌ≼ 02:15, 14 June 2015 (UTC)
Et al 3
Please see this thread at the Helpdesk. The author name Sheetal is being rendered as She et al. in {{citation}}. Something to do with the regex for et al., apparently. Thanks. - Sitush (talk) 18:32, 26 May 2015 (UTC)
(ec) For details, compare:
- {{citation |first=Sheetal |last=Ranjan |chapter=Crimes Against Women in India |editor-first=N. Prabha |editor-last=Unnithan |title=Crime and Justice in India |year=2013 |publisher=SAGE Publications |isbn=978-8-13210-977-8 |url=https://books.google.co.uk/books?id=k_6HAwAAQBAJ}}
- Ranjan, Sheetal (2013), "Crimes Against Women in India", in Unnithan, N. Prabha (ed.), Crime and Justice in India, SAGE Publications, ISBN 978-8-13210-977-8
This is evidently caused by the over-eager regexp in the following code line:
local pattern = ",? *'*[Ee][Tt] *[Aa][Ll][%.']*$"
which will recognize an "et al" mark even if it has neither a space between the two words nor a word boundary before it. Could we have a "\w" check or something of the sort built in to the beginning of that regexp to avoid this?
Fut.Perf. ☼ 18:34, 26 May 2015 (UTC)
- Specifically, I'd recommend replacing
",? *"
with"(, *| +)"
(i.e. either a comma plus optional space, or at least one space to separate the "et al" string from the preceding text). Fut.Perf. ☼ 06:53, 27 May 2015 (UTC)
Lua doesn't support the regex alternation |
operator. Fixed in the sandbox I think:
Wikitext | {{citation
|
---|---|
Live | Ranjan, Sheetal (2013), "Crimes Against Women in India", in Unnithan, N. Prabha (ed.), Crime and Justice in India, SAGE Publications, ISBN 978-8-13210-977-8 |
Sandbox | Ranjan, Sheetal (2013), "Crimes Against Women in India", in Unnithan, N. Prabha (ed.), Crime and Justice in India, SAGE Publications, ISBN 978-8-13210-977-8 |
—Trappist the monk (talk) 13:19, 30 May 2015 (UTC)
- Hm. Like practically everything else that happens here, you are talking in cryptic terms that simply fly over the head of most people. Does fixing in the sandbox mean that there is going to be a proper fix or am I supposed to work it out by deploying whatever hack you did there? Female infanticide in India stills shows the error. - Sitush (talk) 19:56, 7 June 2015 (UTC)
- The sandbox is the development environment for the citation templates. Changes are introduced and tested there, typically after a discussion like this one. Once the changes have been tested, the changes are moved to the main module, which makes them active in the templates. Because the citation templates are used millions of times in articles, the main module code is changed only once every few months. – Jonesey95 (talk) 00:48, 8 June 2015 (UTC)
- Thank you. Your response makes sense, although I'd query the testing bit given the number of bug reports that seem to appear here ;) - Sitush (talk) 01:47, 8 June 2015 (UTC)