Template talk:Ref info
new template
[edit]This template is created as a proof of concept. Is it possible to learn about the referencing styles and methods used in an article. This experiment would suggest that it is. So the question is: Where to now? Certainly these things can be added/improved upon:
- make the output easier to read; perhaps a table
- detect ldr when it uses
<references>...</references>
- distinguish cs1 from templates that look like cs1 in name (
{{cite archive}}
,{{cite comic}}
,{{cite LSA}}
, etc) - add support for
{{rp}}
- add support for
{{r}}
- add support for
{{wikicite}}
- rewrite Module:ref info so that it isn't the hack that it is now
Where to now? Is this template worth pursuing? —Trappist the monk (talk) 19:18, 27 March 2016 (UTC)
- I'm finding it useful fixing long pages that turn up in Category:Pages with broken reference names. They have quite a mix of reference types, and it helps to see what is happening. However, that's just me. Would enough other people use this to make it worth your effort? StarryGrandma (talk) 08:56, 29 March 2016 (UTC)
- Good, thanks for using it. If you think of things that might be an improvement, ... I've done all of the things I listed above except the first. I did experiment with that and didn't find much benefit to making the output a table so until there is a reason to do so, I'll keep the current output form.
- —Trappist the monk (talk) 15:29, 29 March 2016 (UTC)
suggestions from WP:CITE
[edit]Some suggestions were made about this template at WP:CITE. I have attempted to extract them from the general discussion there:
- noting if the page has citations divided into two short and long sections
- the article class(es) assigned on talk page
- a |sidebar=y to wrap it in something like
{{archive box}}
- count of citation errors (of the red alert kind)
- detect citation dispute/cleanup templates (dead URL, unreliable source, failed verification, etc.) Category:Inline citation and verifiability dispute templates
- maybe detection of some variant templates in Category:Footnote templates and Category:Citation templates and subcats thereof (but not Category:Specific-source templates
- an additional parameter taking a revision ID
—Trappist the monk (talk) 19:38, 29 March 2016 (UTC)
- Item 4 :The large red error messages produced by MediaWiki are not visible in the source. Similarly, the error messages provided by Module:Citation/CS1 are not visible in the source. With a substantial rewrite of Module:Citation/CS1, Module:Ref info could use the new code from CS1. Another possibility exists: Module:Ref info could collect a list of cs1|2 templates and then send them one-at-a-time to Module:Citation/CS1. The results returned from CS1 could then be examined for error categories. I'll think about that.
- Item 7 : This is not possible as described. Scribunto does not allow modules to have access to older versions of an article. See WT:LUA. As an alternative, editors can add the template to an older version and Show preview to view the result. Alternately, an editor might save a snapshot copy of a particular version in user space, for example the version of an article that was promoted to FA. Then, this template can refer to that copy from anywhere. A demonstration of that using my talk page and one of its archive is similar:
|
|
- Re Item 4: There are multiple types of red errors. There are small-text red errors generated by the CS1 templates. There are larger red errors generated by duplicate references, unused references, and similar errors. There are also useful red errors that can be generated using User:Ucucha/HarvErrors.js, which show broken links between harv refs and full citations. There may be other types as well. It would be great if something, whether it is this template or not, could list all of those.
- Thanks for this interesting project. – Jonesey95 (talk) 17:42, 30 March 2016 (UTC)
- Item 7 : The output is now in table form and the template supports optional css styling for the table. To make it sidebar-like,
|style=float:right
. - —Trappist the monk (talk) 10:07, 2 April 2016 (UTC)
Template:Refn creates named references
[edit]I've just fixed a problem on a page that uses {{refn}}
extensively. (I thought I had seen all possible reference templates by now!). Ref info reports 7 named references on Jean Berko Gleason. I counted 26. Could you add this to your to do list? I do find the tool useful, and the output is fine as it is. Thanks. StarryGrandma (talk) 01:19, 2 April 2016 (UTC)
- Done.
- —Trappist the monk (talk) 10:02, 2 April 2016 (UTC)
- Thanks, that's very helpful. It makes it easy to take a quick look and see what's going on. In the Gleason article refn is mostly used to create full named references and r is used for further reference for those names.
- If you want to continue, there are the
{{efn}}
templates, named and unnamed notes. I ran into my first broken note name recently. Notes can have references and references can have notes, or at least they could. Every once and a while they change the parser and that doesn't work any more. StarryGrandma (talk) 22:54, 2 April 2016 (UTC)- Yeah, I thought about
{{efn}}
and decided against it. I don't want this template to be a count-everything-template. I'd like it to hew closely to its name and count those things that are really associated with referencing style. I'm wondering if the cleanup templates that are currently supported ({{citation needed}}
,{{disputed inline}}
,{{dubious}}
,{{failed verification}}
) really belong in this template. It was primarily created as a tool to help editors determine the consistency of an article's referencing which might then, perhaps, on a good day with a warm breeze from the south, reduce some of the squabbles around WP:CITEVAR. Checking other stuff muddles all that. - —Trappist the monk (talk) 23:47, 2 April 2016 (UTC)
- I think you are right about keeping it simple. You could have another template that counts the cleanups. StarryGrandma (talk) 06:45, 3 April 2016 (UTC)
- Yeah, I thought about
Thanks
[edit].... for creating this. I just assembled a user space document with a number of the articles I watch, each one using this template. Every so often I plan to load that page to give a fast ref-check to those pages. How handy! NewsAndEventsGuy (talk) 22:17, 20 February 2019 (UTC)
Great template, wrapped it to encourage its use
[edit]Trappist the monk, this template is really useful, thanks for creating it. In my opinion, it's underutilized and insufficiently publicized, and could be very handy on Talk pages where discussions about citations and cleanup are taking place. To encourage such use, I've created wrapper {{Ref info banner}} designed for use on Talk pages:
Show citation statistics for CS1 and CS2 citation elements in Edward Balliol.
Stats: unnamed refs = 12; named refs = 2; self closed = 3. Click show for details.
|
I already have a couple of articles which would benefit from it. I added a little hack to the wrapper to show three main stats as a kind of teaser to make it more interesting, but that means three extra calls to the module, or four in total, which is pretty heavy scripting usage especially if there are hundreds of references in the article, in which case a timeout can occur. It would be nice to have a lightweight version that would grab the three items needed without multiple calls, but I don't know if that's possible. If it is, maybe either a canned string as above, punctuation and all; or something more data-ish, maybe slash-separated sections, such as unnamed=27/named=13/self-closed=4
(or even just, 27/13/4
) which I could then parse in the template with #titleparts, and pass to Module:MultiReplace. Maybe a canned string is good enough (and a lot easier), because I don't know if there would be any other clients for the data version of it, other than the banner template. Mathglot (talk) 06:57, 9 March 2023 (UTC)
{{ref info|Ludwig Wittgenstein|_teaser=yes}}
→ unnamed refs = 120; named refs = 38; self closed = 30- —Trappist the monk (talk) 15:46, 9 March 2023 (UTC)
- Wonderful, thank you! That will be a big performance improvement. Mathglot (talk) 01:46, 10 March 2023 (UTC)
- Can you add sfn's to the teaser? Mathglot (talk) 12:01, 22 August 2024 (UTC)
- Why? The teaser is meant to be a teaser and nothing more. If there is a demonstrable need that can't be met by editors clicking the [show] link, I can add the sfn info to the teaser output.
- —Trappist the monk (talk) 14:32, 22 August 2024 (UTC)
- Can you add sfn's to the teaser? Mathglot (talk) 12:01, 22 August 2024 (UTC)
- Wonderful, thank you! That will be a big performance improvement. Mathglot (talk) 01:46, 10 March 2023 (UTC)
Can the template detection be made case-insensitive to the first character?
[edit]I noticed while working on a different page that the list of CS1 templates, including the one for Aristotle on this template's documentation page, contains both {{cite book}} and {{Cite book}}, which are the same template. Can the template detection and listing code be made case-insensitive to the first character of the template name? That would be a nice tweak. – Jonesey95 (talk) 04:49, 12 December 2023 (UTC)
- I left the listings as case sensitive because there are editors out there who get their panties in a bunch when template name capitalization is inconsistent.
- —Trappist the monk (talk) 12:51, 12 December 2023 (UTC)
- Oh, FFS. (Sorry, that was meant to be said in my internal voice.) OK, noted, I guess, and added to the documentation, mostly for my future self. I'll try not to repost this request in two years when I notice it again. If I search the doc for "case", which I did yesterday, I'll find it now. – Jonesey95 (talk) 16:39, 12 December 2023 (UTC)
Add: Accessdate, Archivedate
[edit]These two would be helpful. Headbomb {t · c · p · b} 09:28, 22 August 2024 (UTC)
- How? What sort of information are you looking for?
- —Trappist the monk (talk) 14:20, 22 August 2024 (UTC)
Lua error: attempt to index local 'name' (a nil value)
[edit]Getting the message 'Lua error in Module:Ref_info at line 497: attempt to index local 'name' (a nil value).' when using the module via template {{Ref info banner}} with this callback:
callback stack
|
---|
Lua error in Module:Ref_info at line 497: attempt to index local 'name' (a nil value). Backtrace: Module:Ref_info:497: in function "func" Module:Ref_info:1323: in function "chunk" mw.lua:527: ? [C]: ? [C]: in function "getAllExpandedArguments" mw.lua:196: ? [C]: in function "pairs" Module:Arguments:207: in function "mergeArgs" Module:Arguments:320: ? [C]: in function "pairs" Module:Message_box:103: in function "new" Module:Message_box:619: ? (tail call): ? mw.lua:527: ? [C]: ? |
as in rev. 1245819010 of Talk:French criminal law. It could be the template doing someting wrong, but I don't know what. Thanks, Mathglot (talk) 09:26, 15 September 2024 (UTC)
- When trying to grab the name of the templates, the code didn't account for the template possibly having no parameters, so the {{cite Legifrance}} was causing an error. I've fixed that case. Aidan9382 (talk) 10:18, 15 September 2024 (UTC)