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. --Pi zero (discusscontribs)

Numbered description list?[edit]

Can the items of a description list be numbered automatically? The help document claims that list styles can be nested but I failed to make a description inside a numbered list. My failure is here. The intended format is here. Thanks, ... PeterEasthope (discusscontribs) 16:26, 14 August 2020 (UTC)

I'm unsure quite what you're trying to do. Here's something one can do, that might or might not be in the ballpark:
  1. foo
  2. bar
  3. quux
--Pi zero (discusscontribs) 16:38, 14 August 2020 (UTC)
OK, thanks. My description lists are better now.
Next problem: insert code examples into the descriptions in the usual monospaced style. My current best is this section. Can a code block be indented by WikiMedia syntax rather than by including non-breaking spaces ( )? WikiMedia syntax? Ideally align the code block with "A:". Thanks, ... PeterEasthope (discusscontribs) 16:08, 20 August 2020 (UTC)
There are a few ways I can think of that one might try to achieve this, at least one of which almost works.
  • Here's the one I know almost works, but has a couple of flaws. Embed the code block in a wiki table, and prefix the open-table line with a series of colons. One flaw is that, although it seems this works, the prefix has to be colons-only, so this can't be combined with the trick to keep an enumerated list from losing count of its items. A small second flaw, at least within my level of skill at these things, is that the code block cannot be the first line of its cell in the table (because of the way the wiki syntax for the code block interacts with the wiki syntax for a cell of a table); so either the preceding "A:" is separated from the table by some extra vertical space, or you put the "A:" inside the cell, slightly reducing the vertical space, and the "A:" is indented by an extra pixel or so. It may be possible to get rid of that extra pixel-or-so of indentation by means of table style (or cell style?) that zeros out the one pixel's worth of padding, or margin, or whatever that is, but, as noted actually achieving that is beyond my level of skill. Here's an example of what it might look like (this is the second version, with less vertical space but the extra horizontal pixel-or-so):
 foo bar
  • I'm uncertain whether the wiki may allow a template to contain table syntax that can then be invoked with mixed-prefix indentation. If so, it'd be a way to get around the colons-only limitation; but it may well be subject to the same colons-only limitation.
  • Is there a way to force fixed-width text within a line? I'm a bit foggy on this point; at any rate, if that can be done, one could, somewhat painfully, produce the code block one-line-at-a-time.
  • Possibly there may be some sort of trick one could use involving book-specific style files, which are supported on Wikibooks; you'd need an "interface admin" to help with that. The policy position we settled on, when the interface-admin group was decreed by the Foundation, was, as I recall, that any admin that feels they have a need for the interface bit should be given it (which afaik respects the spirit of the separate bit, to prevent the interface privs from being needlessly spread to all admins).
--Pi zero (discusscontribs) 22:43, 20 August 2020 (UTC)
Thanks Pi zero. I'll study and try the techniques, ... PeterEasthope (discusscontribs) 15:54, 22 August 2020 (UTC)


Another way of indenting pre blocks (other than the table used above) by using the CSS margin-left property. Take a look at the coding for the below:


However there is a problem in doing so on your page: I think it is because of your non-standard combination of ordered lists and description lists. Using whitespace may be your best option, as the table syntax didn't work too. Jules (Mrjulesd) 15:05, 21 August 2020 (UTC)

Thanks Jules. Unfortunately I've descended into hours of trial and error, the last desperate technique of programming. By "non-standard combination" do you mean that a revised combination should be tried; or do you mean I am attempting something beyond the intended capabilities of MediaWiki? If the first case, can a revision be suggested? In the second, I should consider abandoning attempts to impose format and accept the automatic format of MediaWiki? Thanks, ... PeterEasthope (discusscontribs) 15:54, 22 August 2020 (UTC)

What I mean can be demonstrated by looking at your coding, a snippet being posted here:

#; <span id="compvar"></span>How to compare procedure variables. Oberon only allows comparison of a procedure variable to NIL.
#: '''A''': Procedure variables can be compared in this manner:

Now what you're doing is combining an ordered list (with the first # symbol) with a description list (the following ; character). These are not normally combined in this fashion. Now I can see why you've done it, and it works to some degree, but for some reason it creates a problem when adding CSS to the pre block that follows. I don't really have a good explanation for this. One workaround would be to change your coding combining the two list types; another would be simply to insert white space in your pre block. If you wanted to change your coding, you could do something like this (look at the source):

6. How to compare procedure variables. Oberon only allows comparison of a procedure variable to NIL.
A: Procedure variables can be compared in this manner:
    MODULE Temp; 
      VAR p, q: PROCEDURE;
      END P;
      p := P; q := P;
      (*IF p = P THEN END;*)  (* does not compile *)
      IF p = q THEN END  (* but this works *)
    END Temp.

This looks quite similar to User:PeterEasthope/sandbox#compvar, but is differently coded. Or else just use whitespace to shift the coding in the pre block. Jules (Mrjulesd) 17:20, 22 August 2020 (UTC)

I'm changing the coding as you describe. Automation is good but in this circumstance, it's too devious. Better to make the result directly. Finishing the page will take a few more days. Thanks, ... PeterEasthope (discusscontribs) 15:07, 23 August 2020 (UTC)
P.s. Appears the last resort is to use HTML5 tags; <ol> </ol>, <dt> </dt>, <dd> </dd> and etc. I'm working on a section in my sandbox. Closing and nesting all the tags properly requires non-trivial effort but it works. Regards, ... PeterEasthope (discusscontribs) 16:01, 7 September 2020 (UTC)

DISPLAYTITLE template[edit]

Hello, does the DISPLAYTITLE template work only on the title page of a book. It doesn't center the heading in the Oberon/bootman page. Thanks, ... PeterEasthope (discusscontribs) 14:47, 9 October 2020 (UTC)

DISPLAYTITLE is actually a "magic word": see mw:Help:Magic words#Technical metadata. It just doesn't allow much customization; for example you can't radically alter the displayed title. I think also that it doesn't accept all CSS, and "text-align:center;" simply doesn't work. And I doubt there is a workaround.
My advice is to ignore DISPLAYTITLE, and instead use the template {{book title}} underneath it, which will be centered. --Jules (Mrjulesd) 20:53, 9 October 2020 (UTC)
The page is just one in a book. Therefore "book title" seems illogical; no offense intended. An appropriate visual appearance can be achieved with a div tag. Is that objectionable? Thanks, ... PeterEasthope (discusscontribs) 18:02, 10 October 2020 (UTC)
No not at all, it does exactly the same thing. All the template does is add a div tag and little CSS, so it makes no difference. Take a look at its source. --Jules (Mrjulesd) 18:10, 10 October 2020 (UTC)