Template talk:CelestialRef

cite simbad
It seems to me that this template would benefit from invoking cite simbad rather than create it's own reference output. The triple external links default output is also... very ugh, at least for an inline citation. A multiple link SIMBAD template could be created, but it should follow JPL small body and be confined to the external links section, IMO. Headbomb {talk / contribs / physics / books} 14:58, 19 July 2013 (UTC)


 * Hope this isn't too bewildering, been working on this on and off all day, having new ideas and documenting them here as I go along. Anyway all ready to complete an "All singing dancing" template which can also be simplified to be almost same as yours and could be called by a template of different name that would work exactly like yours with link=no as the default instead of link=yes. Or whatever. Know what to do, pretty sure would work, only thingn is, to check on direction before going ahead, a bit of time for reflection, and will see if you have ideas about it all.Robert Walker (talk) 02:05, 20 July 2013 (UTC)

Overhaul
I've overhauled the code at CelestialRef/sandbox. It's much simpler in implementation.


 * 1 &rarr; WYSIWYG field, displayed name, etc. Example &rarr;
 * 2 &rarr; If you want a link, and the target article is different than the WYSIWYG output. Example &rarr;
 * link &rarr; set to  if you want a link, and the WYSIWYG field matches the link. Example  &rarr;
 * simbad name &rarr; if the SIMBAD database requires a different input than the WYSIWYG field. &rarr;

Opinions? Headbomb {talk / contribs / physics / books} 16:30, 19 July 2013 (UTC)


 * Okay, first, thanks for cleaning up the presentation of the page too, and thanks for the code suggestion in the sandbox!


 * Your template is much simpler of course, and it looks great if you want just the one link to the object on SIMBAD. If that's what you want, then it's the way to go.


 * I need to explain the motivation for the triple link.

Clicks reduction

 * For the table I have in the example documentation - lets you present a list of objects, and, suppose the reader wants to check the bibliography for each one, to take an example. Maybe you want to check out which ones look most interesting from its bibliography, say.


 * Then with my version, they click on the ref, click on the bibliography link, and they are there in two clicks. Going through the list they can quickly check the bibliography for each one. For that matter if already in the list of links on the bottom of the page can just click through the list, right click on bibliography and open in new page for each one. Very quick to do.


 * Otherwise you click on the ref, click to go through to the simbad page, click to the bibliography there, then click to expand the bibliography. It's twice the number of clicks. That may not seem a big difference but in UI design if you can get from 4 clicks down to 2 it is a big improvement. I'm a software developer and always on a look out for ways to reduce the number of clicks for the software I design.


 * Also, the 4 click version takes you to a new page between clicks 2 and 3, a psychological "change of scene", and the final click is a button rather than a link and is way over to the right of the page so you move your mouse to click it. While with the 2 click version all the clicks are on the same page and you just go to the other page to look at the output.

Star plot preset radius

 * Then with the star plot, the thing is, with some stars a plot of 10 arcmins is rather small, with other targets a plot of 5 arcsecs is more appropriate and 10 arcmins is dense with objects and takes a while to plot and isn't readable when it appears. So by putting the star plot as an optional link and optional parameter, it makes it possible for the author of the page to preset a radius for the star plot.

Siblings

 * The siblings also isn't easy to find on simbad. If the object is part of a cluster e.g. the example given part of the extended Hyades cluster, it might be useful to display the siblings, and this gives you a quick way to see them.


 * So that's the motivation.

Idea, to combine both - done
One idea, combine the two.


 * 1) Made mine into a single parameter instead of the clumsy two by using urlencode as for simbad which I didn't know about.
 * 2) When you look at how cite simbad works, it works the same way as my code except it uses sim-basic. So, changed that too - so any name that works for cite simbad will work for this as well.
 * 3) Added the SIMBAD and CDS links, formatted as for cite, done that.
 * 4) In the multiple links version have it abbreviated to CDS instead of the longer "Centre de données astronomiques de Strasbourg.". And made the other entry names shorter, e.g. Ids instead of "Alternative Ids"
 * 5) Did the extra options in brackets after the citation. Alternatively can do dash - or in some other way set aside from them so you can see it is an extra visual element. Trying brackets first.


 * Have just given all that a go, here it is in action, using my sandbox template, which is where I worked on it before putting it here into the main space: User:Robertinventor/StarRef


 * Yields
 * Yields


 * Yields
 * Yields


 * Yields
 * Yields


 * How does that idea look? Haven't added your extra options yet, expect will be easy to do.

Your extra options

 * Alternative name parameter - alternative name as parameter 2 is fine, if I do that would need to have a named parameter for the star plot e.g. plot=20 to do star plot up to 20 arcmins. That's fine, better practice actually.


 * Link param - the thing is, you get star articles with lists of stars, many to a page, and they are all internal links. Often they are all existing articles too, there are many star articles for individual stars, as many individual stars are notable. In the pages I've seen, it is rare to have one that isn't an internal link. So you want the most common use to be the easiest to use. If you just have that's easiest. And in practice, SIMBAD can find just about any name you enter as well. Has no problem with  which it does as . So it is probably rare that you are going to want to not link the name. So that is why I had it as a special param name=none for case where you don't want to link and in that case, to just turn it into a bare reference like cite simbad, then that seemed as good a solution as any.


 * How does that all sound? If that's okay then I can add in the alternative name parameter + the plot= instead of second param for the star plot.


 * Oh just had another idea. Test to see if the second param is blank, and if so, if user adds extra param but has it blank then that's the name=none. So don't need a name=param. That's quite intuitive because it means the user has set an alternative name but set it to be blank i.e. don't want a name displayed at all.


 * To make that work you preset the second param to something user will never enter as a star id:
 * {{#ifeq:{{{2|--no-name--}}}|--no-name--|{{#ifeq:{{{link}}}|no|{{{1}}}|{{{1}}}}}|{{#ifeq:{{{2}}}|||{{#ifeq:{{{link}}}|no|{{{2}}}|{{{2}}}}}}}
 * should do the trick (if I haven't missed a matching brace somewhere :).


 * I.e. test {{#ifeq:{{{2|--no-name--}}}|--no-name--|
 * Then if the two are equal means user didn't set parameter 2 so just use parameter 1. Otherwise, user did set parameter 2, test to see if it is blank by {{#ifeq:{{{2}}}|| and if so then don't show anything at all, otherwise use parameter 2 here and then test for link=no inside both cases. Something like that, will test it tomorrow and once it works put it into the template Robert Walker (talk) 01:48, 20 July 2013 (UTC)


 * Then - can have your link param but instead, default is to link, so do as {{CelestialRef|Barnard's Star|link=no}} . Since that is the one likely to be least often used I think.


 * Could always have a template CelestialRefNoLink which sets link=no and then calls this one. Or other simpler CelestialRefXxxs that call this one. E.g. CelestialRefAll could be {{CelestialRef|{{{1}}}||siblings=show|plot={{{2|20}}}|image=show|ids=show|bibliography=show}} - shows all the information with optional 2nd parameter for plot radius in arcmins, no alternative naming. CelestialRefBib could be {{CelestialRef|{{{1}}}|{{{2}}}|bibliography=show}} or whatever, not nec. those particular ones, but just to show if this is the all singing dancing template then can have others using it like that when you want different defaults. Robert Walker (talk) 02:02, 20 July 2013 (UTC)


 * But will see what you think before coding up any of this. Robert Walker (talk) 22:31, 19 July 2013 (UTC)

Image parameter

 * Image url Just to mention this. Added it as an extra option


 * Yields
 * Yields


 * Yields
 * - actually anything except colour=colour changes it to B&W as the other option
 * Yields
 * Yields

Option to just show image, siblings etc
I've done it now so that extras shows the id and bibliography, if left out you can still show the siblings or image, e.g.


 * Yields
 * Yields

What is the purpose of the template
The big question is what is the purpose of the template?


 * If it is to support data, and cite the SIMBAD database, then the links to the siblings, plot, etc... are all superflous, and the template is overdesigned.
 * If the template is there to allow flexibility in what part you can cite from SIMBAD, then it should take inspiration from cite sbdb, again linking to only the relevant section you actually want to use for the article.
 * If the template is there to maximize access to all parts of the SIMBAD database on a particular object, then that really is only suitable on the article about that object. Linking to all the various SIMBAD sections of the M52 entry on the M12 article overloads the reader with low-relevance links. That kind of stuff about M52 goes in the external links section on the M52 article, and the template should then take inspiration from JPL small body.

However one template to do all of this is just... a coding and usability nightmare. Headbomb {talk / contribs / physics / books} 04:53, 20 July 2013 (UTC)


 * More succinctly, I think the solution is to have two templates, one akin to cite sbdb for inline citations, and the other akin to JPL small body for external links. Form follows function, and all that jazz. Headbomb {talk / contribs / physics / books} 05:06, 20 July 2013 (UTC)


 * Okay if that's the general feeling. Will see if anyone else comments on this. The usability and coding issues can be addresssed. So I think focus should be on whether this template is useful.


 * In your list, it is intended as the second, to add flexibility on what you can cite from Simbad, and to allow addition of extra entries in the footnote, e.g. link to the bibliography already expanded. The cite web template doesn't have the flexibility to do that. Yes was intended to link only to relevant sections for the article, and the extra options mainly for tables with lists of many objects in them, not individual inline mentions of objects, hadn't thought through those.


 * For the coding, the issue I had there was that there seems to be no way to add internal documentation to a wikipedia template. Compared with the programming I am used to, this doesn't seem that complex. It would need some documentation to explain how it works for future coders who want to update it.


 * The many optional parameters needn't be a usability issue as the default would be the same as cite simbad, but with default to make the object name into a link. So the default interpretation of would work just as the user would expect it to.


 * I think if I update it to my latest version and update the documentation you'll see what I mean there.


 * It could easily be made into a template suitable for use in the external links section if that is desired. But that doesn't address the original need I created it for, to have an easy way for the user to quickly jump to e.g. the bibliography of any object in a long list of stars. Perhaps I'm the only editor who feels that is a useful thing to have... Will see if there are any other comments on this.


 * I will update this draft template to my latest version, incorporate the alternative name and nolink options, add code documentation in the documentation section, and will then await more comments, before doing anything more.


 * It is clearly a bit controversial to add this template, which I didn't expect. That's okay, you only find out these things by trying them out and was just a suggestion and attempt to be helpful. Thanks! Robert Walker (talk) 09:32, 20 July 2013 (UTC)


 * As you'll see below I've updated it so it can function either as a footnote like cite simbad or as an inline external links section type template like JPL small body. The advantage is you just have one set of source code to maintain. Can add an extra template e.g. CelestialRefEx or whatever which calls it, defaulted to external links section formatting. Have found out how to inline comments in a template addresses the maintainability issues. Robert Walker (talk) 10:31, 21 July 2013 (UTC)

Naming
Why is this called ? SIMBAD hosts things other that stars also. Further, non-SIMBAD sites host information on stars as well. Shouldn't this be called SIMBAD or simbad instead? Or are you going to support other reference sites? -- 76.65.128.222 (talk) 09:39, 20 July 2013 (UTC)


 * I thought of that yes. The reason for not having simbad in the name was because it could include potentially have items not in SIMBAD. The new image option already uses the Aladin sky atlas, which though used also by SIMBAD, is a different thing.


 * It is true that it is more than stars, including galaxies, nebulae etc. Open to suggestions for a better name there! Please treat it as a provisional name for now.


 * One suggestion, what about "AstroRef" - is that a better name?Robert Walker (talk) 09:53, 20 July 2013 (UTC)


 * That sounds better. Or perhaps CelestialRef ? (since "astro" can refer to the science and theory side of things as well... whereas celestial would just be referencing things in the sky) -- 76.65.128.222 (talk) 10:01, 20 July 2013 (UTC)


 * CelestialRef sounds great to me! Robert Walker (talk) 10:06, 20 July 2013 (UTC)

New version - Celestial Ref
I've made a new version of this template here, using the name CelestialRef as suggested, here it is:

Template:CelestialRef

What do you all think? Might be best to continue this conversation on the talk page Template_talk:CelestialRef.

I've added a link back to this conversation there.


 * I should have moved it as an ip address just said on talk page for CelestialRef. Since Template:CelestialRef exists I have to do an Admin request. Or does anyone here have admin privileges to just do it right away?


 * Of course documentation should also be moved will add a request for that as well. Have backed up Template:CelestialRef


 * Just realised easier approach is to delete Template:CelestialRef to permit the move, so will do that instead. Robert Walker (talk) 08:48, 21 July 2013 (UTC)

CelestialRef
CelestialRef is the latest version of

How does it look now, everyone? Any more thoughts or comments or criticisms? Robert Walker (talk) 14:40, 20 July 2013 (UTC)


 * Why didn't you just rename ? (renaming would keep the talk page attached, to continue discussions) -- 76.65.128.222 (talk) 05:09, 21 July 2013 (UTC)


 * Will do. I couldn't see a Move option but now realise was just because was hidden in the droplist. Will move this one first then move StarRef then add all this to StarRef Robert Walker (talk) 08:22, 21 July 2013 (UTC)

Example of this template in use for a single star.
I have just used this template in the article for HD_133600 to see what it is like in a single star type article. This a low importance article that I have just restored from WP:PROD.

I used:

to display all the possible options, including both B&W and colour images, as a test to see how it looks visually supposing someone wants them all.

This is useful for an editor while working on an article for a single star.

I think also that as a single line in the list of references at the end of the article, it is not too confusing to the eye and could be kept in place as is IMHO. Interesting to hear what the rest of you think.

In this case it has no siblings so obviously will remove that from the ref, left it in for now to show what it looks like with all the links included.

The B&W image is useful apart from case where you want it in B&W for some reason, because the Aladdin previewer shows it on the screen more quickly than the colour image. Robert Walker (talk) 20:04, 20 July 2013 (UTC)

Added comments
Just discovered, you can add comments to the templates as html comments, makes sense, so have commented the code which should make it easy for anyone to read and edit, will remove the code section from the documentation. Robert Walker (talk) 21:30, 20 July 2013 (UTC)

Done now, except, if the template ever needs to be used with subst: may need to rewrite the comments as here: Advanced_template_coding - seems unlikely to me that that could ever cause any issues in this case however. Robert Walker (talk) 22:32, 20 July 2013 (UTC)

Inline option for e.g. External links section
You can now inline by adding inline=yes which inlines the footnote content.

E.g. *



You can also add an indented radio as for JPL small body by adding radio=yes.

E.g. *



Idea is rather than have two separate templates, better to do it all as one so have only one set of source code to maintain. For the Extra Refs section would probably write another template that calls this one e.g. CelestialExRef Or whatever is appropriate.

See Template:CelestialRef/doc

Any suggestions for tweaking the format? Robert Walker (talk) 10:06, 21 July 2013 (UTC)

These examples currently use CelestialRef
I have requested speedy delete of CelestialRef. talk page and documentation. Will move the pages here once they are deleted, meanwhile using CelestialRef for the examples to show how it works.

Will copy CelestialRef over to CelestialRef and rename the examples once the deletion and move is completed. Robert Walker (talk) 09:08, 21 July 2013 (UTC)

New line in footnote. Might be best default?
I've added a new option newline=yes:

For simpler example, compare:

and

If this is better, I can make newline default to yes so need to do newline=no to have it all on one line.

To compare the two ways of presenting the extra links for a table see Confirmed Giant Planets around Mid- and Late-K-type Dwarf Stars.

Robert Walker (talk) 14:03, 21 July 2013 (UTC)

Am editing the template right now
Since no-one is using it yet, except me in one minor article, am just working with the template directly.

Am defaulting newline to show, also better format for the external links section. May not display the examples correctly here or the documentation for a short while. Robert Walker (talk) 18:28, 22 July 2013 (UTC)

Finished editing for now
I've added a new 'at=yes' option to more closely resemble the JPL small bodies. Will now try a CelestialRefEx template to call it.

For newline=yes as default, ran into issue there that it would still do a new line even if there were no extras to add and because of limitations in the way you can program in templates, was tricky to work around that. So have just left it for now as newline=no as default, but can return to it later. Robert Walker (talk) 18:58, 22 July 2013 (UTC)

Test of CelestialRefEx
*



Parameters as for CelestialRef except, can't show the name (removed the name section) and defaults to all=show so if you don't want all the links have to set all=hide and then set the ones you want to show individually.

Of course could change that behaviour as appropriate depending on what's needed. Robert Walker (talk) 19:10, 22 July 2013 (UTC)

Move completed
The CelestialRef pages got speedily deleted on request so have now done the move and updated the code.

Will now change CelestialRef to CelestialRef everywhere.

Then will request speedy delete of the original StarRef once everything is sorted out, in case someone else wants to create a template called "StarRef" in the future. Robert Walker (talk) 19:46, 22 July 2013 (UTC)

Documentation of CelestialReEx and example of use in page
Hi, I've done the documentation of it now at Template:CelestialRefEx/doc

Have also tried it out in a low importance main space article:

Gliese 146

Robert Walker (talk) 20:20, 22 July 2013 (UTC)

Mid edit again briefly, to get it to default to newline = yes
For a short while some examples may not display correctly, will soon fix that. Slightly techy coding and since no-one else is using this yet thought I'd just do it in place here. This is the last major change to do to the template AFAIK, depending of course on what anyone else says about it. Robert Walker (talk) 10:49, 23 July 2013 (UTC)

All finished now
Done those edits now, and it now defaults to newline=yes and you have to set newline=no if you want everything on one line.

I think it is just about done for now. So have removed the underconstruction. Any comments? Does it look good now, or any issues remaining? Robert Walker (talk) 13:14, 23 July 2013 (UTC)


 * One minor final edit. I've done a bit of extra coding in CelestialRef/Extras to hide the first " - " in the line for the newline=yes and radio=yes cases, also if user sets extrasep


 * This means don't need to have the Links: in second line (which I did mainly because a line starting with "- " looks bad). So have removed that. Now almost exactly like JPL Small Body for external links section.

*

Yields:




 * If there are no more comments then I'll remove the "in development" mbox in a few days time and then we can start using it in mainspace articles.


 * Any other thoughts about it? Robert Walker (talk) 06:29, 24 July 2013 (UTC)

CelestialRefAll
New template CelestialRefAll - sets all=yes and calls CelestialRef, and leave out the extra options so will have much simpler documentation, just plot and siblings to describe plus the two unnamed params.

Yields

Robert Walker (talk) 08:48, 24 July 2013 (UTC)

Defaults now to "at the SIMBAD Astronomical Database
I've made the default to at=yes now, so similar to JPL Small Body. Thought especially with SIMBAD an internal link, you don't really need to add a separate link to the CDS on each footnote, and it is easier on the eye, especially when you have any extra links. Can still get the previous format with use of at=no. Any thoughts on this? Robert Walker (talk) 08:43, 24 July 2013 (UTC)

Try out for Solar analog, now defaults to newline=no and simbad=short
I thought, about time to try in the main space in a small way to start with to see if it turns up any issues.

Tried the template out in Solar analog. Worked okay but with two lines to each star in the references, the stars overwhelmed the reference list. It worked much better to have them all in one line and with it saying "at SIMBAD - Ids - Bibliography - ..." then it looked okay visually I thought.

So it now defaults to newline=no again, and simbad=short is the new default, so it all fits on one line easily.

So, now the CelestialRefEx sets simbad=long.

I've also made new templates CelestialRefExNoImages and CelestialRefAllNoImages for celestial objects which don't show up in Aladin e.g. distant pulsars. Robert Walker (talk) 11:43, 25 July 2013 (UTC)