Template talk:Ref info

new template
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:
 * 1) make the output easier to read; perhaps a table✅
 * 2) detect ldr when it uses ✅
 * 3) distinguish cs1 from templates that look like cs1 in name (,, , etc)✅
 * 4) add support for ✅
 * 5) add support for ✅
 * 6) add support for ✅
 * 7) 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
Some suggestions were made about this template at WP:CITE. I have attempted to extract them from the general discussion there: —Trappist the monk (talk) 19:38, 29 March 2016 (UTC)
 * 1) noting if the page has citations divided into two short and long sections
 * 2) the article class(es) assigned on talk page
 * a |sidebar=y to wrap it in something like ✅
 * 1) count of citation errors (of the red alert kind)❌
 * 2) detect citation dispute/cleanup templates (dead URL, unreliable source, failed verification, etc.)
 * 3) maybe detection of some variant templates in and  and subcats thereof (but not
 * 4) an additional parameter taking a revision ID❌
 * 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:


 * —Trappist the monk (talk) 16:06, 30 March 2016 (UTC)


 * 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, float:right.
 * —Trappist the monk (talk) 10:07, 2 April 2016 (UTC)

Template:Refn creates named references
I've just fixed a problem on a page that uses 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 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 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  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)

Thanks
.... 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
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:

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  (or even just,  ) 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)
 * —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)
 * 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?
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)