Jump to content

Wb/lad/Editing Wikitext/Headings

From Wikimedia Incubator
< Wb | lad

Template loop detected: Template:Wb/lad/Editing Wikitext

 


Editing Wikitext

Text formatting

Adding Images

Tables

Templates and Styles

Work in Progress



 

Introduction to Wikitext

  • This page introduces Wikitext. Wikitext is used to write all of the pages in Wikibooks and is the markup language used for all of the sister projects as well. Wikitext is intended to be simpler to use than other alternatives. This simple markup script is translated into the web's HTML language by the software before sending it to each browser.
  • Wikitext can be mixed with HTML, and users can add CSS in-line styles, as well as the usual complement of images, tables and other structures.
  • Templates can be produced to make the work easier, and there is a large store of these already available. Templates described in these pages work only within Wikibooks pages; the template set for Wikipedia does not necessarily include these features.
  • Work is credited to users in their user-names, and log-in names can be chosen with the link at the top-right of any Wikibooks page.
  • Wikibooks is an open system. It is used free of charge. Any user can edit pages in Wikibooks, and its mandate is to encourage collaboration in producing written work. This arrangement does not suit everyone, so the matter needs consideration before making a heavy work commitment. Some core texts are protected against editing, though these are comparatively few.
  • Stable good-quality versions of some pages are presented to casual surfers, while other versions of each, to edit, are available to logged-on users. Reviewers patrol the edits from day to day and update the stable copies of such pages after approving them. Many pages however, can be edited directly, without review.

How a Page is Made

  • The general method in editing a page is fairly simple. In summary, the user signs on with a free password and user name, then, on the page of interest, selects the edit this page tab. The user is then presented with an editing window that resembles a fairly ordinary word processor. The text is edited to change the wording, to add images or tables, and at times to introduce additional styles for text and layout.
  • The method for making a new page is also simple. A summary of the methods to use for starting a new page can be found at Help Pages.
  • The work can be checked for its appearance by selecting Show preview. The preview page is then redrawn with an up-to-date version for the user's approval. When the work is to the user's satisfaction, the new page is saved by pressing Save page. If more than one user is changing the same parts of the page, screens are presented to allow the conflict to be resolved.
  • Saved versions of the page are stored and can be viewed via the history tab on each page. Previous versions may be restored from these lists. In addition, there are various pages dedicated to each user for notes, preferences, and so on.

More General Points

  • There is a house style. At the most general level, there are guidelines on writing style. The web-page styles however, are provided by Wiki's style sheets, of which there are several. Within these are to be found the style rules for all Wiki work. The user cannot modify these, since changes would affect everybody, but on an optional basis, each user can have a style sheet of their own that affects only their own browsers. Most find no need for it. Although the house style sheets cannot be user-modified, in-line styles can still be applied within the Wikitext itself.
  • There is no house font. as such Pages are displayed with entirely relative font-sizing, and a sans-serif font. As such, pages can be scaled with browser zoom and font settings.
  • There is an automatically made table of contents (TOC). Each page has a table of contents (TOC) that is updated automatically using the typed section headings. The markup code is used to identify certain text as headings, and the software does the rest. The TOC also lists headings created with HTML code, though its use is optional. An example of listed headings can be seen on this page.
  • The white-space around words and punctuation is parsed. This means that it is filtered so that it conforms with the browsers' rules. At a practical level, it makes sure that there is never more that one space following a comma or a full stop. It ignores a single carriage return, requiring two of these to signify a new paragraph. The software will do all of the wrapping of text on the page. This is called un-formatted text.
  • There are HTML-like tags that preserve white-space. Text that benefits from their use is called pre-formatted text and is fairly heavily set with spacing and line breaks. Examples are lyrics, poetry, and code listings. The aptly named poem tags or the pre tags can be used to display text exactly as it is typed. To display a pre-formatted code module, there are source tags that also color the code.
  • Refer to the links in the top panel for the various Editing Wikitext pages.
  • Refer to the links below for additional sources on editing.

Further reading

[[Category:Template:BOOKNAME|Template:FULLCHAPTERNAME]]


Template:Wb/lad/Alphabetical
 

Text Headings

Formal heading styles are used in nearly all WikiBooks pages and for that matter, for all of the sister projects' pages as well. They clearly show a degree of organization in the work, and they are absolutely essential if the user intends to take advantage of the automatically generated table of contents, (TOC).

The following notes explain how to make wiki headings, and introduces the table of contents. Notes are provided on moving the TOC around, and constraining its behavior. For those who intend to put the TOC into a table cell at the top of a page, refer to Images in Containers, and Templates Ready to Use.

 

Heading levels

There are six levels of heading styles and all of them are made by surrounding the heading text with an appropriate number of equals signs. The HTML heading styles are equivalent and so optionally, the heading text can be surrounded by the HTML tags instead. As an example; to make a level two heading, the largest practical heading, write either of the following at the left margin:

==Heading Text==

or;

<h2>Heading Text</h2>


To make smaller headings just increase the number of equals signs, or use larger numbers in the HTML tags. It was stated above that there are six levels but the first level is usually reserved for the page heading, and making a table of contents with more that three levels can be messy. As a result it is most common to stick to levels two, three and four, or to use the HTML equivalent, h2, h3 and h4. By insuring that smaller headings come below larger headings in the text, the TOC will indent the sub-levels accordingly, and automatically insert the required links.

At times a heading is needed for text in a table. Wikitext heading codes can have an adverse effect on tables and templates. When this happens, changing to the HTML versions of the heading will often solve the problem.

The level two heading style inserts a line across the page whether it is needed or not, but to add a similar line with the other headings, just type four hyphens at the left margin as follows:

----


 

Summary of Headings

The following table contains a summary of the headings that can be made.

Summary of Wikitext and HTML Heading Codes
Wikitext Result HTML Description
=Text= Text <h1>Text</h1> h1 is mostly for page headings
==Text== Text <h2>Text</h2> h2 heads a section
===Text=== Text <h3>Text</h3> h3 heads a subsection of h2
====Text==== Text <h4>Text</h4> h4 heads a subsection of h3
=====Text===== Text <h5>Text</h5> h5 is rarely used
======Text====== Text <h6>Text</h6> h6 is rarely used



Hiding Headings

As was mentioned above, the headings are used to make the table of contents, (TOC). Sometimes, when the TOC is looking a bit full, or when a heading does not seem to warrant listing, it would be useful to have the benefits of the heading's formats, but to miss it out on the TOC.

A set of templates has been made to do this. They are the six templates Hiddenh1 through Hiddenh6. The way to use say, a level three heading style without a TOC listing is just:

{{hiddenh3|Hidden Heading Here}}

Just choose a different template for other heading sizes.


Numbered Headings

Numbered headings are made only by typing them yourself, and the nested heading sizes are made in usual way.

The conventional numbering method is to assign a separate number sequence to each level of heading. Although an automatic method purports to exist in the user's preferences, it affects only the local view and will not be seen by others. A fairly standard approach for numbered headings is seen below, but the indentation that is preferred for numbered sub-sections cannot be obtained with a simple use of tags or wiki code. Templates could be made to indent the sub-sections properly, setting left margins for the paragraphs accordingly, and for those who might attempt it, the existing CSS styles for headings have been provided below.

1 Some Flowering Plants
1.1 Monocots
1.1.1 Orchids
1.1.2 Onions
2 Trees

etc.


Drop Capitals

Drop capitals are used for work where heading styles are intrusive, though the rules for their use are by no means clear.

T

here is no drop capital code in Wikitext at this time, but a template exists. The drop capital at the start of this paragraph was added using the Drop template. Users who need a different drop capital can find the basic coding on the template's editing window. The code used to call this template into use was just:

{{Drop|T}}here is no drop capital...

Notice that only the first character of the paragraph was included within the double curly brackets, and that the remainder of the text was dressed tightly to the left.


 

The Table of Contents

The table of contents habitually resides at the top-left of the page. In fact, it will position itself at the left margin and just above the first heading that is made. The TOC lists all of the headings and makes links to their positions in the page. Selecting a link causes the page to shift so that the selected heading is at the top of the screen. A table of contents will not be generated unless at least four headings are made.

The width and length of the TOC adjusts as more heading text is added. The width adjusts to the longest heading and the box extends downward as more headings are added. At some point the text is wrapped rather than continuously widening the box. The automatic behavior of the TOC is not always welcome, and various methods to constrain it have been devised. See the comments below.

It is possible to remove the TOC by typing;

__NOTOC__

anywhere on the page. (Note that there are two underscores on each side). The usual Wiki page includes a table of contents, but it is unclear how strict the convention is. Note the section above on Hiding Headings to avoid headings being added to the TOC.

To include the TOC in a place that it would not normally appear, for example, in a table cell at say the top of the page, just type the following code in the cell as if it were text;

__TOC__

Such a method can be used to position the TOC with some accuracy, as well as running text or images level with it in the top section. The __TOC__ word overrides a previous __NOTOC__ instruction though only one TOC can appear on a page.

The template Tocright can be used to place a table of contents at the right side of the WikiBooks page. The TOC will appear adjacent to the position on the page that the template is called. To call the template into use just type;

{{tocright}}

Other templates , that display the TOC with images and text at the top of a page include Imageontop, Textontop, and a number of similar templates. Another table-based template for top-sections is Thetop, and the table of contents is easily be added to it, as can be seen in the top section of this page.

The colors of the TOC are fixed; in fact they are set by the Toccolours class. So far, the TOC itself has resisted any modification.


 

CSS Heading Styles

At times, for example for templates, users need to know the details of certain wiki styles. These can be found in the wikibooks style sheets. An example of these styles for the main wiki headings can be found in the drop-box below.

Heading style extract
CSS Heading Styles from main.css
h1, h2, h3, h4, h5, h6 {
	color: black;
	background: none;
	font-weight: normal;
	margin: 0;
	padding-top: .5em;
	padding-bottom: .17em;
	border-bottom: 1px solid #aaa;
}
h1 { font-size: 188%; }
h1 .editsection { font-size: 53%; }
h2 { font-size: 150%; }
h2 .editsection { font-size: 67%; }
h3, h4, h5, h6 {
	border-bottom: none;
	font-weight: bold;
}
h3 { font-size: 132%; }
h3 .editsection { font-size: 76%; font-weight: normal; }
h4 { font-size: 116%; }
h4 .editsection { font-size: 86%; font-weight: normal; }
h5 { font-size: 100%; }
h5 .editsection { font-weight: normal; }
h6 { font-size: 80%;  }
h6 .editsection { font-size: 125%; font-weight: normal; }