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
General | Proposals | Projects | Featured books General | Technical | Administrative Deletion | Undeletion | Import | Permissions

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.

Renaming Book Pages[edit]

How do I rename a Book Page? When I change the name of the Book Page, it seems that the link to the old page is broken and I have copy the old content to the new page that was created as a result of renaming. TIA!

--Rjbfigueroa (discusscontribs)

@Rjbfigueroa: Can you give an example of a page you wanted to move, and where you wanted to move it to, so we can see what happened?

Fwiw, here's how to move a page, if you're using Vector skin (in the desktop interface, rather than the mobile one): View the page you want to move (not its talk page). There should be a control bar at the top of the browser, and way over on the far right of it there should be a dropdown menu. The only option on that menu should be either "rename" or "move"; use that. — Preceding unsigned comment added by Pi zero (talkcontribs) 17:26, 19 February 2018 (UTC)

I would guess the OP is changing the name of the page in the link expecting it to change the actual name of the linked page. The result is a red link (of course). Moving the page, as described above, is the way to resolve it. QuiteUnusual (discusscontribs) 18:01, 29 January 2021 (UTC)

Centering in a cell in a table[edit]

Hi, tables can be used to create an illustration as in this section. Observe that in the middle row, first column, "Oberon MediaWiki.Markup command ... downarrow" is left justified in the cell. In my trial, "text-align: center" failed to center the content in the cell. Is this a limitation of MediaWiki translation of markup to HTML? Can anyone suggest how to center in this instance? Thanks ... PeterEasthope (discusscontribs) 17:57, 16 January 2021 (UTC)

@PeterEasthope: I've tried something; not sure if it's the effect you wanted. --Pi zero (discusscontribs) 18:50, 16 January 2021 (UTC)
Good! I should have thought of "align" rather than "text-align". Thanks! ... PeterEasthope (discusscontribs) 19:06, 16 January 2021 (UTC)

Hide title on main page[edit]

Hi! I’m working at Norwegian WB trying to revive the project. I have used a copy of your layout with some adjustments on the main page. Is the extention that enables the magic word NOTITLE enabled by default? I haven’t been able to make it go away. What can I do to hide the page title? — Abuluntu (talk) 10:42, 22 January 2021 (UTC)

I think this is done through CSS. At MediaWiki:Common.css it has the following: body.page-Main_Page #firstHeading {display: none;}. I think this switches off the title. You need to do the equivalent for yours. --Jules (Mrjulesd) 17:49, 22 January 2021 (UTC)
Great! Thanks! I haven’t been granted permissions yet by meta, but when they do I’ll try it. — Abuluntu (talk) 07:05, 23 January 2021 (UTC)

Importing Template ColorBox to Wikibooks[edit]

I found out that during my edit for Wikijunior:Asia, I found out that this template : https://commons.wikimedia.org/wiki/Template:Colorbox (to be used for catergorised each country to their specific regions) is not available for Wikibooks. Could admins import this template here? — Preceding unsigned comment added by Encik Tekateki (talkcontribs) 04:22, 13 February 2021 (UTC)

@Encik Tekateki: To me, it looks as if the en.wp version is somewhat neater than the Commons version (which was forked from en.wp in 2011); shall we go with the en.wp version, or do you have some reason to prefer the one from Commons? --Pi zero (discusscontribs) 13:41, 13 February 2021 (UTC)
@Pi zero: It is ok too, as long as Wikibooks have this templates . Cant wait for it to be implemented in Wikibooks. Thanks Pi Zero
Eagerly awaited by Encik Tekateki (discusscontribs) 15:59, 14 February 2021 (UTC)
@Encik Tekateki: Done Template:Color_box Leaderboard (discusscontribs) 16:45, 14 February 2021 (UTC)
Hi @Leaderboard: , thank you for import but I highly believed that the Colorbox are strongly dependent on other libraries too. I tested in my sandbox , there are no colour coming out. Also when importing documentations, this hold true as well. Perhaps, we might need to import all of relevant libraries too/see documentations. Sorry for inconveniences caused . Encik Tekateki (discusscontribs) 04:59, 16 February 2021 (UTC)
Can confirm that Colorbox failed to render color for me as well. I had thought I was just misusing it. {{color box|#33b4e4|''Test''|#bebebe}} --Mbrickn (discusscontribs) 14:46, 16 February 2021 (UTC)
@Pi zero: I've imported a bunch of en.wiki templates but am stuck with script errors that I'm not sure how to resolve. Leaderboard (discusscontribs) 17:48, 16 February 2021 (UTC)

┌────────────────┘
You need to import w:Module:Color contrast (including subpages, in particular w:Module:Color contrast/colors). I think that this is key to getting this to work. I can't see this done at Special:Log/import yet. Also w:Template:Legend/styles.css would be nice. --Jules (Mrjulesd) 19:25, 16 February 2021 (UTC)

Lua error in package.lua at line 80: module 'Module:Color contrast/colors' not found. Hmm, I had already imported that module? Leaderboard (discusscontribs) 20:42, 16 February 2021 (UTC)
 Test - @Encik Tekateki: does it work now? Make sure to purge your cache! Leaderboard (discusscontribs) 20:45, 16 February 2021 (UTC)
@Leaderboard: , it is working now . Thanks again ! Encik Tekateki (discusscontribs) 00:05, 17 February 2021 (UTC)

Technical maintenance planed‬[edit]

CSS tab-size[edit]

In the sandbox I've added style parameters -moz-tab-size and tab-size to the style section at the top of the markup with intention to control the width of tabs. No effect is evident. Can anyone explain or tell how the style should be corrected? Thanks, ... PeterEasthope (discusscontribs) 03:31, 19 February 2021 (UTC)

Hi, I'll make the following points:
  • The CSS tab-size property only works if you include tab characters. But looking at your sandbox it seems to mainly consists of space characters. It will therefore have no effect.
  • The best thing to do might be to use a pre tag (or div tag) in combination with margin-left (or padding-left). I would avoid span tags as they should only be used for inline elements. Consider the code below:
Example text
See the wikitext for what I've done. Is this the sort of effect you're after? --Jules (Mrjulesd) 12:50, 19 February 2021 (UTC)
Thanks. Blanks where tabs should have been was a blunder after a confusing series of tests.
I haven't used -moz-tab-size and tab-size properties until now. tab-size alone has no effect in Firefox. Appears that -moz-tab-size is for Firefox and tab-size is for other browsers. The MediaWiki markup will be done by software and a recent revision needs more work. I'm making progress; slowly. Thanks for the help, ... PeterEasthope (discusscontribs) 16:42, 19 February 2021 (UTC)
I've made some small revisions in the MediaWiki module and it produced the current sandbox. tab-size properties now give the intended result. <pre> is invoked by the blank at the left margin. <span> is used to specify font attributes and character vertical offset. The remaining concern: is the present use of span inappropriate? Thanks, ... PeterEasthope (discusscontribs) 21:51, 19 February 2021 (UTC)

┌─────────┘

  • Well strictly speaking you're meant to use the div tag for "block elements", which is anything from a paragraph and greater. For elements less than a pragraph you're meant to use span. Whether it matters too much is an interesting question, and not one I'm sure about.
  • With pre you can avoid margins by using padding instead, like this example:
Example text with pre style="padding-left: 10em;"
  • Yes I've just tested tab-size, you definitely need -moz-tab-size for it to work on my Firefox browser.
		Example text with 2 tabs, with pre
		Example text with 2 tabs, and pre style="-moz-tab-size: 16; tab-size: 16;"

--Jules (Mrjulesd) 11:50, 20 February 2021 (UTC)

  • With a few small changes in my MediaWiki module, the outer <span ...> is changed to <div ...>. An odd result is that font-family: 'Times New Roman' in <div ...> is not respected; the content is rendered san-serif. See the current sandbox. Times-New-Roman in the global span was respected. I don't recognize this as a feature of CSS or a feature of MediaWiki or an obscure interaction between the two. Definitely a means to specify a serif typeface is required. Keeping the global enclosure as a span rather than div is a means.
  • Regarding the distinction of div and span: In a sense, a span encloses sequence of content; whereas a div is a span bounded in some way. A paragraph, for example, is a sequence of content which might be separated from surrounding content by empty lines. In this sense, a div is a specific case of a span.
Considering the above two factors, I'm tempted to keep the global span; not make it a div.
Thanks for following my tedious ramblings, ... PeterEasthope (discusscontribs) 17:59, 20 February 2021 (UTC)
Ah I tell you the why you've got problems: invisible pre tags! When the text has spaces in front of it, invisible pre tags (not in the wikicode but in the HTML code of the page) are inserted. Its an annoying feature of the software, and it means your div tags wont work, as the pre styling takes over. For some reason span works, which I don't really understand why.
A workaround to doing it is to use TemplateStyles. I have created a style similar to yours at Template:TemplateStyles/Example/styles.css. If you insert the wikicode <templatestyles src="TemplateStyles/Example/styles.css" /> it will alter the style to how you like it. Note that you can't include "-moz-tab-size" for some reason, so you have to use space characters instead of tabs.
Another way of doing so is to edit the pre tag in Template:TemplateStyles/Oberon/styles.css and alter that instead, and then include that on your page with <templatestyles src="TemplateStyles/Oberon/styles.css" />. --Jules (Mrjulesd) 02:07, 21 February 2021 (UTC)
@PeterEasthope: I've created a sandbox at User:Mrjulesd/sandbox/2 of what I think you're probably trying to achieve, based on the current contents of your sandbox. It uses the code <templatestyles src="TemplateStyles/Example/styles.css" /><div style = "-moz-tab-size: 16; tab-size: 16;"> to provide styling. Please let me know if this is satisfactory. --Jules (Mrjulesd) 14:22, 21 February 2021 (UTC)
Actually I've just realized that you can do the same as above with
<pre style="font-family: 'Times New Roman', serif; font-size: 0.90rem; font-weight: normal; font-style: normal; color: #000000; position: relative; top: 0%; -moz-tab-size: 16; tab-size: 16;" >
--Jules (Mrjulesd) 15:16, 21 February 2021 (UTC)
A global pre tag is an interesting alternative to span or div with a blank beginning each line. I'll evaluate the pre alternative more after the four remaining sources are in the book. My current MediaWiki module also handles a flowed page; it isn't restricted to pre format. The tab-size attributes are a valuable improvement. The span tag with tab-size attributes produces correct results. Thanks for the help, ... PeterEasthope (discusscontribs) 17:02, 21 February 2021 (UTC)