< Wikibooks:Reading room
ArchivesWikibooks Discussion Rooms
DiscussionsAssistanceRequests
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

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 (discuss • contribs)

@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 (discuss • contribs)

Section numbers in Contents.

Hi, can section numbers be suppressed in Contents? My sandbox is an instance. Thanks, ... PeterEasthope (discuss • contribs) 18:48, 25 March 2020 (UTC)

@PeterEasthope: User:PeterEasthope/Sandbox doesn't exist. It would be helpful if you provided a link to what you mean. But I think what you're going for is having the table of contents just display "Introduction... History..." instead of "1. Introduction... 2. History..." correct? —Justin (koavf)❤T☮C☺M☯ 19:14, 25 March 2020 (UTC)
Justin, the sandbox is at User:PeterEasthope/sandbox and you are correct. --Jules (Mrjulesd) 20:03, 25 March 2020 (UTC)
Nice. Thanks, @Mrjulesd:. @PeterEasthope: If you put CSS on that page that includes class="tocnumber" and set display:none;, that should keep the numbers from appearing. If you need more help than that, let me know. Kind of a drive-by comment but something while I'm distracted. —Justin (koavf)❤T☮C☺M☯ 21:33, 25 March 2020 (UTC)
To do this selectively, a wrapper element can be placed around the TOC, as in <div class="noautonum">__TOC__</div> on the page, and .noautonum .tocnumber { display: none; } at MediaWiki:Common.css.
To do this you would have to edit MediaWiki:Common.css, only something an interface admin could do, so @Pi zero: for advice on feasibility. --Jules (Mrjulesd) 19:22, 25 March 2020 (UTC)
OK, I've added <div class="noautonum">__TOC__</div> at the top of the page. No effect. Something is snagged, ... PeterEasthope (discuss • contribs) 21:33, 25 March 2020 (UTC)
No it wont work unless MediaWiki:Common.css is edited, something I can't do. However you can try it out for youreslf:
(i) create User:PeterEasthope/vector.css with the following text: .noautonum .tocnumber { display: none; }
(ii) Add the line <div class="noautonum">__TOC__</div> to your sandbox.
You shouldn't see any numbers in your TOC (Table of Contents). However this will only work for yourself; for it to work with everybody MediaWiki:Common.css needs to be edited by an interface admin. Which is why I pinged Pi zero above. --Jules (Mrjulesd) 22:07, 25 March 2020 (UTC)
OK, for me it works as it should. If Pi zero can make the administrative change, good. Otherwise no great harm. I haven't checked a third party account yet but will. Sorry for the slow response; I indulged in some sleep last night. Regards, ... PeterEasthope (discuss • contribs) 15:39, 26 March 2020 (UTC)
It'll take me a while to clear some time, and some spare neurons, to grok this properly. --Pi zero (discuss • contribs) 19:45, 26 March 2020 (UTC)
OK thanks for looking into it Pi zero. If you want to test it first, create User:Pi zero/vector.css with the text .noautonum .tocnumber { display: none; } and then look at the TOC at User:PeterEasthope/sandbox. --Jules (Mrjulesd) 22:59, 26 March 2020 (UTC)
My sandbox has changed. The page in question now is BootManager but it's a low priority. No need to impose on Pi zero. Thanks, ... PeterEasthope (discuss • contribs) 16:30, 29 March 2020 (UTC)
@PeterEasthope: Btw, is this something that it would be reasonable to provide just to the one book? Iirc we're set up to provide book-specific css, which would avoid adding this to the load on all books, most of which won't use it. --Pi zero (discuss • contribs) 18:12, 29 March 2020 (UTC)
For my current work, the format of Contents discussed above is only required for the Oberon/BootManager page. It isn't needed elsewhere.
A related question: in another page the numbers should appear in the Contents and at the section headings. I might have seen something about that when reading help pages yesterday but can not find it now. How is that result achieved? Thanks, ... PeterEasthope (discuss • contribs) 15:49, 30 March 2020 (UTC)

Font-family

Another detail in a page I'm working on. Please have a glance at Oberon-2 and the source for it (click Edit). The body of the text is sans-serif whereas I want it to be serif. In Firefox the heading is serif, so the display isn't a browser artifact. The text is enclosed in <span style="font-family:serif; ... which doesn't yield the intended result. Ideas?
Incidentally, I wonder why the various Wikimedia projects have various documents about editing. There are so many cases where I hunt in the Wikibooks documentation until convincing myself that a question isn't answered. Then eventually find an answer under Wikipedia or MediaWiki. Appears much of the goose-chasing could be eliminated by replacing duplication with links to one central document. Just a thought.
Thanks again, ... PeterEasthope (discuss • contribs) 17:05, 29 March 2020 (UTC)

@PeterEasthope: Try adding after the section title <div style="font-family:serif; font-size:1rem; font-style:normal; ">; and then </div> at the end of the section. I've tested this in preview and it works. I could do this for you if you want me to show you. --Jules (Mrjulesd) 12:52, 30 March 2020 (UTC) Addendum: actually you can add this to the entire body text (a single open div at the start and close div at the end) and this still works. --Jules (Mrjulesd) 12:57, 30 March 2020 (UTC)
Thanks! I should have recognized that. ... PeterEasthope (discuss • contribs) 14:15, 30 March 2020 (UTC)

No offense intended but I'm baffled by the Help search. For example, suppose I want to know the general syntax for the TextBox template. I click on Help in the left margin and get a Help search dialogue. I observe that Help is checked. I uncheck Wikibooks. In the search bar I type "TextBox syntax". Then click on Search. The response is "Did you mean: textbook syntax" and a list of references. Of course I don't mean "textbook syntax". None of the references pertain to the syntax of a TextBox. Next try a search for "TextBox template". The result is "Did you mean: textbook templates" and another list of references. Again no help. I know the template is defined somewhere but finding the syntax is almost impossible. I don't mean this to be a harangue. Rather a report from a hapless user hoping that progress is possible. Regards, ... PeterEasthope (discuss • contribs) 19:13, 30 March 2020 (UTC)

@PeterEasthope: Well, I just tried searching for "TextBox", myself. The top match I got back was this thread. The second match was the Wikibooks sandbox. The third match, though, was a section of a general page, Wikibooks:Templates/General#Text boxes. --Pi zero (discuss • contribs) 19:53, 30 March 2020 (UTC)
Screenshot of different results here. http://easthope.ca/TextBoxHelpSearch.png Odd. Ideally the search would find Template:TextBox. ...
Did you mean Template:TextBox? It gives the options in the text below. Its basically a css div box, and you can read about them at https://www.w3schools.com/css/css_boxmodel.asp . --Jules (Mrjulesd) 22:23, 30 March 2020 (UTC)
Yes, Template:TextBox explains the syntax ... but the search didn't find it ... unless it was way down the list. Anyways, thanks, ... PeterEasthope (discuss • contribs) 23:41, 30 March 2020 (UTC)
Looking at your screenshot above: you searched in the help pages, and basically there isnt a help page to explain its use. Usually with templates, to explain their use, you need to look at their template documentation, which shows up when view the template page. Very often they aren't explained otherwise in the help page system. For example Template:Chapter navigation is explained in its documentation, but not on a help page. So if you search there it will not show up at all. --Jules (Mrjulesd) 23:58, 30 March 2020 (UTC)
For searches like that it's generally advisable to include project space (Wikibooks:) as well as help space. --Pi zero (discuss • contribs) 00:59, 31 March 2020 (UTC)
You mean I should leave the Wikibooks box checked in the Help search? OK but it still fails to report Template:TextBox. That is the best documentation to me. I just need to remember the URL https://en.wikibooks.org/wiki/Template:<templateName>. (Probably wishful thinking.) I'm afraid WikiMedia is falling into a common peril for software: experts want to improve by adding features whereas more features are more difficulty for non-experts. Simplify wherever possible. Of course you can never satisfy every requirement. This won't be my last submission to the Reading Room. =8~) Thanks for the help, ... PeterEasthope (discuss • contribs) 13:59, 31 March 2020 (UTC)

┌─────────────────────────────────┘
I agree that it is difficult remembering about templates. In fact I think its one of the toughest challenges of contributing to wikis, from a technical point of view. But I will make a few points:

  • Firstly be aware of Wikibooks:Templates. It is an index of common templates you can look up on. It's a useful resource, but isn't comprehensive; not all templates are listed. But still many are: for example for box type templates are listed at Wikibooks:Templates/General. If that doesn't work, try looking in Category:Templates, they should all listed there if you can find them.
  • If you search for templates, tick the Help:, Wikibooks:, but also the Template: namespaces, as template documentation is usually the best place to find info on templates.
  • You can always ask here for help if you get stuck! So continue asking stuff if you have any queries.

--Jules (Mrjulesd) 22:22, 31 March 2020 (UTC)

Good. I've made a few notes. Thanks, ... PeterEasthope (discuss • contribs) 02:13, 1 April 2020 (UTC)

Details of format and style

Hello again, here are more questions for the experts. The old document for the Oberon-2 language is linked in this footnote. https://en.wikibooks.org/wiki/Oberon#cite_note-5 My current editing is in my sandbox. Here are some questions.

  1. In the sandbox the section numbers should remain as they are in the Contents. Can they be included on the section headings throughout the document?
  2. I've used table markup to mimic the format under "Vocabulary and representation". Can the whole table be indented as in the original document?
  3. Can style="vertical-align:top; border:none" be specified more efficiently? Ie. specified once rather than on every cell of the table.
  4. In the original document, "$ ident ..." and "x scan ..." are in monospaced font; probably Courier. How can this be invoked in the MediaWiki representation?

In case you are interested to edit the sandbox, that's OK by me. Assuming you don't make it worse of course.
Thanks! ... PeterEasthope (discuss • contribs) 16:56, 31 March 2020 (UTC)

@PeterEasthope:
  1. Without access to the Mediawiki namespace this is tricky. But I have experimented a bit with templatestyles, and I believe now this is possible. My I edit your sandbox to add the necessary code, as it is a bit complicated to describe?
  2. Indenting tables is easy. If you add colons before the open table markup, it will indent. e.g. use the code ::{| class="wikitable" style="background:#ffffff; border:none" to indent the table twice.
  3. Without ready access to style sheets it is simplest just to repeat the inline css as necessary.
  4. Try using the css font-family: monospace, monospace;, e.g. <span style="font-family: monospace, monospace;"> Example</span> will produce Example. Or else the <code> tag, look at this comments source to see how.
--Jules (Mrjulesd) 19:51, 1 April 2020 (UTC)
  1. Yes; certainly edit the sandbox.
  2. OK.
  3. OK; I missed another obvious notation.
  4. Clever. I wouldn't think to give the name twice.
Thanks, ... PeterEasthope (discuss • contribs) 21:27, 1 April 2020 (UTC)
Point 4: repeating the name apparently helps with browser compatibility. See https://stackoverflow.com/questions/38781089/font-family-monospace-monospace . I shall action point 1 soon. --Jules (Mrjulesd) 21:33, 1 April 2020 (UTC)
Nice detail. Thanks, ... PeterEasthope (discuss • contribs) 17:29, 2 April 2020 (UTC)

Background color in pre-formatted block

What is a good markup for a block of text monospaced, preformatted and transparent or white background. The background color would be #FFFFFF. Something like this.

111111111
222222222

Or this.

111111111
222222222

But without the background blue tint. If the padding and margin can be adjusted, that would help too. Thanks, ... PeterEasthope (discuss • contribs) 04:44, 1 April 2020 (UTC)

Use css to do so. For example:
111111111
222222222
Look at the source to see how its done. You can also get rid of the border with css, and also set margins and so forth. Really you should read https://www.w3schools.com/css/css_boxmodel.asp, or on Wikiboooks see Cascading Style Sheets/Box Model, you need to understand that really. --Jules (Mrjulesd) 19:58, 1 April 2020 (UTC)
OK, I've studied CSS and the box model in the past and understand the more general aspects. I understand your examples above. Probably my biggest difficulty is the relationship between MediaWiki and HTML5. Appears there are precedence rules. MediaWiki markup can be enclosed in HTML5 markup and vice versa. In some cases it works but not always. An explanation of this relationship would be helpful. It might exist already. I don't recall seeing it. Thanks, ... PeterEasthope (discuss • contribs) 18:15, 3 April 2020 (UTC)
@PeterEasthope: no there probably isn't one here (not that I know of anyway). But on en.wp there is w:Help:HTML in wikitext which I think describes this all, it should all apply here really. --Jules (Mrjulesd) 23:43, 3 April 2020 (UTC)
That page is very helpful. Thanks. It reinforces my conviction that the manual for MediaWiki markup should be consolidated. Elimination of some of the multiplicities would also help. For example <br> and <br /> are said to be legal whereas <br> should be avoided. I'd rather strictly allow only <br />. Allowing both has no significant benefit. It confuses non-experts and complicates parsing and documentation.
Thanks for the help, ... PeterEasthope (discuss • contribs) 16:37, 4 April 2020 (UTC)

Display size

Resolved

Everything seems to be a lot larger on Wikibooks. It's disorientating. I'd like the font size to be consistent between projects. Any idea how I can do this? Regards, —guywan (talk • contribs) 19:15, 3 April 2020 (UTC)

Silly me. I zoomed in on my browser without realizing it. Problem solved! —guywan (talk • contribs) 19:16, 3 April 2020 (UTC)

Horizontal line

Wikipedia has the {{rule}} template which doesn't work here. Can a horizontal line be drawn? Thanks, ... PeterEasthope (discuss • contribs) 16:15, 6 April 2020 (UTC)

Afaik the wiki markup for this is four hyphens at the start of a line.

--Pi zero (discuss • contribs) 20:12, 6 April 2020 (UTC)
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.