This project page is move-protected.

Wikibooks:Reading room/Technical Assistance

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Replacement filing cabinet.svgArchivesWikibooks Discussion Rooms
Discussions Assistance Requests Announcements
General | Proposals | Projects | Featured books General | Technical | Administrative Deletion | Undeletion | Import | Permissions Bulletin Board

Welcome to the Technical Assistance reading room. Get assistance on questions related to MediaWiki markup, CSS, JavaScript, and such as they relate to Wikibooks. This is not a general-purpose technical support room.

To submit a bug notice or feature request for the MediaWiki software, visit Phabricator.

To get more information about the MediaWiki software, or to download your own copy, visit MediaWiki

There are also two IRC channels for technical help: #mediawiki for issues about the software, and #wikimedia-tech for WMF server or configuration issues.

Template:Infobox_scientist[edit source]

In this template:-

|caption    = <div style="padding-top:0.3em; line-height:1.2em;"><!--

In {{Infobox}} which is called.

 |data={{{image|{{{image1}}} }}}{{#if:{{{caption|{{{caption1|}}}}}}|<br /><span style="{{{captionstyle|}}}">{{{caption|{{{caption1}}}}}}</span>}}

This puts a DIV inside a span which is badly formed.

What should be done is to setup the relevant style on the caption span directly, with a possible display:block I can't change this as the Templates concerned are currently protected.

Can someone with interface administrator rights, look into this? ShakespeareFan00 (discusscontribs) 08:42, 27 March 2021 (UTC)[reply]

@ShakespeareFan00: What exactly should be done? And I don't think interface-admin is required to change a template (we do not use templateeditor), but if needed I can temporarily reduce the protection, but then you would have to be careful not to mess things up. Leaderboard (discusscontribs) 09:14, 27 March 2021 (UTC)[reply]
The change needed would be to change the {{infobox sicentist}} code to something like:-
|caption    = <span style="display:block; padding-top:0.3em; line-height:1.2em;">{{{caption|}}}</span>

Which doesn't lead to mal-formed HTML. Alternatively the caption code in {{infobox}} needs changing to a DIV. ShakespeareFan00 (discusscontribs) 09:21, 27 March 2021 (UTC)[reply]

@ShakespeareFan00: Done . --Jules (Mrjulesd) 01:16, 28 March 2021 (UTC)[reply]

Template:ORP[edit source]

This should be displaying an example of the template in use.

It isn't. And having spent a long time gong through the templates to determine why, I still can't figure where it's being told not to display.

My conclusion is that there is either a comment, or NOINCLUDE that is'nt properly balanced up, but the convoluted nature of some of the templates is making it hard to determine WHERE something is unterminated.

I've had enough, so I am asking someone else if they can run the relwvant templates through some kind of manual sanity check, before I loose mine. ShakespeareFan00 (discusscontribs) 09:54, 30 March 2021 (UTC)[reply]

I'm tempted to just revert every single change I've made to all the related templates, even though I am reasonably confident my "repairs" did not break the logic. ShakespeareFan00 (discusscontribs) 09:56, 30 March 2021 (UTC)[reply]

Refbegin and refend[edit source]

When used as indicated in the documentation, these attempt to wrap an OL or UL list using a DL {{refbegin}} .. {{refend}}. All the definition list here seems to be used for is to set-up text indentation. Why cannot this be done on the list items for references directly? ShakespeareFan00 (discusscontribs) 15:36, 30 March 2021 (UTC)[reply]

No idea. I agree that the dl is probably unneeded. The coding is clunky, but unproblematic. --Jules (Mrjulesd) 23:15, 30 March 2021 (UTC)[reply]

Closing a table inside a parser function (such as if)....[edit source]

In some template code I recently encountered the following situation.

{{!}}Some Content in a table..
{{#if:{{additional_data}}|{{!}}-|{{!}}}}} <!-- If there is additional data start a new row else end the table.

As you can see the brackets are not matched. Mediawiki it seem matches up the brackets to the nearest pair (which is reasonable), meaning that in this instance the use of {{!}}}, for a table end was potentially generating {{!}} and a loose } instead of the desired table closure.

I created {{!end}} to work around this problem, but would appreciate suggestions on a more elegant approach. ({{!start}}) would be the equivalent template for opening a table.

This is not something that the linter currently traps for, but an error like this eventually manifests as 'unpaired' tag situation, or fostered content.

ShakespeareFan00 (discusscontribs) 13:04, 31 March 2021 (UTC)[reply]

Sorry, but in which template did you find this? --Jules (Mrjulesd) 20:07, 31 March 2021 (UTC)[reply]
The repair was -
If there is a "better" solution for this, please feel free to implement it. ShakespeareFan00 (discusscontribs) 21:44, 31 March 2021 (UTC)[reply]
OK thanks for the explanation. While you are welcome to comment here on technical aspects of interest, please try to make it clear whether you need assistance or not. --Jules (Mrjulesd) 22:19, 31 March 2021 (UTC)[reply]

Searching for red links.[edit source]

Hi, is there an efficient search of a book for red links? The help search didn't help. Thx, ... PeterEasthope (discusscontribs) 18:29, 19 April 2021 (UTC)[reply]

I'm not aware of how you can do this. But I think it would be quite fast to visually scan at all the pages of a book for this, as books don't tend to have a huge number of pages. Do you have any book in mind particularly? --Jules (Mrjulesd) 01:34, 20 April 2021 (UTC)[reply]
Oberon. Currently 181 subpages; some occupying several desktop screens. Episodes of reorganization have left some red links.
Would AutoWikiBrowser help? Leaderboard (discusscontribs) 07:47, 20 April 2021 (UTC)[reply]
Unknown to me. Will look for it. Thx, ... PeterEasthope (discusscontribs) 21:32, 24 April 2021 (UTC)[reply]

Formatting assistance[edit source]

Hello - can you please help me to fix why this is coming up bold?

In contents - 1.3 Treatment of Somatic Dysfunction of the Cervical Spine appears bold. I would not like this bolded. Thank you. I have looked through the source and cannot determine why this is happening. — Preceding unsigned comment added by Powellle (talkcontribs)

@Powellle: I think I've fixed it, can you check? Leaderboard (discusscontribs) 07:28, 30 April 2021 (UTC)[reply]
Yes! Thank you! What did you do? :) 2601:88:8100:28C0:15EE:E43E:9FB6:D0A7 (discuss) 07:32, 30 April 2021 (UTC)[reply]
The title itself was bolded; I removed it. Leaderboard (discusscontribs) 18:52, 2 May 2021 (UTC)[reply]

Open tag[edit source]

Page information for Oberon/ETH_Oberon/2003-01-05/Native.Tool reports 1 missing end tag and 1 stripped tag. I haven't succeeded to find the tag which is opened and not closed. Someone please suggest an automated means to locate the opening tag. I don't know what is meant by "stripped tag"; it might be merely a consequence of the unclosed tag. Thx, ... PeterEasthope (discusscontribs) 18:49, 2 May 2021 (UTC)[reply]

I think a stripped tag is a closing tag without an opening tag. Now I've been looking at the page and I can't see any errors. Also I've tried markup validation (see w:Help:Markup validation) and it hasn't brought up anything. I think it might be a bug in the linter. Also if you replace the opening and closing span with an opening and closing div, the error ceases, but it also changes the formatting somewhat.
Overall I think it might be best to ignore this one. --Jules (Mrjulesd) 23:01, 2 May 2021 (UTC)[reply]
Some weeks back I tried changing the enclosing span to div and, yes, the format was damaged. I don't remember which page the test was applied to. Was contemplating the change for automated translation of any page.
I'd expect linter to show exactly which tag was open. Extension:Linter requires Parsoid. If the software is installed and configured, will it give something more specific than "open tag" or "1 open tag"? I'd rather not chase a possibility which won't help. Thx, ... PeterEasthope (discusscontribs) 00:35, 3 May 2021 (UTC)[reply]
I doubt it, the linter is pretty well the same on English Wikipedia. However there is a ton of linter like sites on the Internet; search for "markup validation" or "HTML validation" on Google. Also if you install Notepad++, and open a copy of the source with encoding as HTML, it matches highlighted tags, and also matches highlighted brackets. So it makes keeping track of stripped and missing tags and also bracketed markup, that much easier, and is very helpful. --Jules (Mrjulesd) 09:45, 3 May 2021 (UTC)[reply]
OK, thanks. The W3C Validator reports dozens of errors and warnings for a page in Wikimedia. The Dillo browser also lists errors. Debian Linux here. No Notepad but likely something can check matching of brackets, parentheses & etc. ... PeterEasthope (discusscontribs) 13:23, 3 May 2021 (UTC)[reply]
Another puzzling case. The betadocu page has page information reporting 5 errors. I haven't succeeded to find an error. For syntax highlighting, the Geany editor has been recommended. Regards ... PeterEasthope (discusscontribs) 17:53, 6 May 2021 (UTC).[reply]
@PeterEasthope: Yes, it's puzzling isn't it? No obvious errors in the wikitext; it brings up a lot of errors in HTML validation, which you can do nothing about. The validation errors are mainly due to the <dl><dd> coding that the Mediawiki software uses to indent text, which is strictly speaking syntactically incorrect. This can't be altered by the end-user. But no missing end tags are identified, which the linter says is the case.
I think it's just another case of the linter being buggy. Interesting about the Geany editor, presumably it does a similar job to Notepad++. I suppose you could ask somewhere like w:Wikipedia:Help desk or w:Wikipedia:Village pump (technical) in case I'm missing something, they might help; let me know if you crack it. --Jules (Mrjulesd) 01:15, 7 May 2021 (UTC)[reply]
LintHint can help editors track down these syntax errors. It occasionally shows two or more errors in the same location when there is really only a single problem to fix, but when it shows no more errors, you are usually done fixing things. Jonesey95 (discusscontribs) 15:48, 7 May 2021 (UTC)[reply]
Thanks for the tip. I can see things got sorted out at w:Wikipedia:Village pump (technical), it was that pesky apostrophe markup creating errors. --Jules (Mrjulesd) 15:57, 7 May 2021 (UTC)[reply]