Template talk:EB1911 Shoulder Heading

From Wikisource
Latest comment: 6 years ago by PBS in topic Right- v. left-alignment in Main
Jump to navigation Jump to search

Font-based metric and italics

[edit]

I changed this template so it uses a font-based metric (em instead of px) for spacing and italic bold rather than just bold. The documentation is also now displayed at the template. The font-based metric is useful when shoulder headings are used in conjunction with fine print: the margins and width are scaled according to the size of the font. I added italics since this is what EB1911 uses for shoulder headings. Bob Burkhardt (talk) 16:16, 1 January 2009 (UTC)Reply

Right- v. left-alignment in Main

[edit]

I inquired as to why the shoulder heading is right-aligned in the Main at the Scriptorium recently (as opposed to left-aligned). Then I came across the following in the template page's history:

  • (cur | prev) 17:24, 15 December 2010‎ Spangineer (Talk | contribs)‎ (511 bytes) (automatically put all shoulder headings on the right side in the main namespace; if this is not seen as trivial feel free to rv and discuss on talk) (undo)

So I guess I'm taking Spangineer up on the suggestion to discuss it on the Talk page (unless Spangineer meant their talk page?), since I'm not sure whether it is actually trivial or not! :) Londonjackbooks (talk) 15:29, 7 November 2011 (UTC)Reply

@user:Spangineer I am reverting the change. I don't mind which side is the default is on--although I lean to placing it on the left--but at the moment it is not possible to alter it from the right-hand side to the left as an option. Previous to this change it defaulted to the left, but at least editors could alter it with the parameter align. I think it undesirable to have it right side only. What is the point of only having it alterable in the area where the pages to be transluded are kept? -- PBS (talk) 14:24, 2 January 2017 (UTC)Reply

What I have done is alter the default settings so that the box appears on the right (personally I don't think that is optimal), so that it addresses user:Spangineer wish for the boxes to appear on the right, but it can be overwritten by an editor if they so wish. -- PBS (talk) 14:33, 2 January 2017 (UTC)Reply

Seems reasonable; thanks! --Spangineer (háblame) 14:52, 2 January 2017 (UTC)Reply
I am altering the default to the left side because it is possible to link to a shoulder header as a section and I think it better that the section name be on the left side. The option to change it to the right side will still exist "align=right" if someone wishes to place it on the right. Please ping me if after this explanation this is still not your preferred option and we can talk about it further. -- PBS (talk) 11:09, 11 September 2018 (UTC)Reply

New optional parameters

[edit]

I have added to new optional parameters:

  1. section=y If the parameter section= is passed into the template, then the text of the shoulder heading becomes a linkable section name. See also EB1911 Style Manual § Linking within an article
  2. width=number Omitting this or setting to 10 will set the width of the shoulder heading to 10em. It can be changed with the width parameter, and for example the template {{EB1911 Shoulder HeadingSmall}} defaults to 6em.

section if set will allow links to the shoulder heading. This will be useful for editors of Wikipedia who want to link to a specific section in a Wikisource EB1911 article.

width is a simple change that has allowed me to rewrite {{EB1911 Shoulder HeadingSmall}} as a wrapper template (diff). This has the advantage that we no longer have to maintain two similar templates in parallel. Unless a new parameter is added, a change to this template will automatically appear as a change to the other.

-- PBS (talk) 16:08, 2 January 2017 (UTC)Reply

Thanks PBS, nice work! Will the section link work if the text contains a hyphen or <br> characters? (Sometimes these are included for formatting reasons). Or does the text of the section parameter become the link?— DivermanAU (talk) 21:10, 2 January 2017 (UTC)Reply
@DivermanAU. No it would not. Now it does:
  • It strips multiple spaces.
  • It removes <br> -- although this ought not to be used in the first place
  • It removes <br/>
  • It removes <br />
  • It handles dash (tested) and I presume ndash; and mdash;
  • It handles strait single quotes '
  • It handles double quotes of the straight type and double curly quotes (without change).
-- PBS (talk) 01:01, 6 January 2017 (UTC)Reply
Great work! I'll use the link feature in future Wikipedia edits where it's use will be handy. DivermanAU (talk) 02:41, 6 January 2017 (UTC)Reply
I have played around a little more and have documented how to deal with an equals in the string. I think this would be necessary even if there was no link intended. @DivermanAU to answer you question about passing in a sting via the section parameter, I think that is unnecessary and complicates the issue. If for any reason the text in the sholder is not wanted then use the template {{section}} instead. At the moment using the text in the shoulder means that another editor can guess at what the link text is using WYSIWYG. -- PBS (talk) 23:28, 6 January 2017 (UTC)Reply