Difference between revisions of "Help:Introduction to Templates"
(→External links: +help page for templates) |
(→Registers: Add 18-bit versions) |
||
Line 72: | Line 72: | ||
They are: | They are: | ||
+ | * 18-bit ([[Template:18bit-header]] and [[Template:18bit-bitout]]). | ||
* 36-bit ([[Template:36bit-bitout]]), and also 36-bit half-word ([[Template: 36bithalf-bitout]]). | * 36-bit ([[Template:36bit-bitout]]), and also 36-bit half-word ([[Template: 36bithalf-bitout]]). | ||
* 32-bit, in both [[little-endian]] and [[big-endian]] ([[Template:32bitbig-bitout]] and [[Template:32bitlittle-bitout]]) bit-numbering forms (since there are machines of that [[word]] size for both) | * 32-bit, in both [[little-endian]] and [[big-endian]] ([[Template:32bitbig-bitout]] and [[Template:32bitlittle-bitout]]) bit-numbering forms (since there are machines of that [[word]] size for both) | ||
− | Finally, motivated by how nice the 36-bit ones looked, grouped into 3's by colour, versions of the 16-bit ones with | + | Finally, motivated by how nice the 36-bit ones looked, grouped into 3's by colour, versions of the 16-bit ones with similar blocks, for both hex and octal machines ([[Template:16bitoctal-bitout]] and [[Template:16bithex-bitout]]), were added. They produce output which looks like this: |
{{16bit-header}} | {{16bit-header}} | ||
| Unused || colspan=7 | Length || Trapped || Written || colspan=2 | Unused || Direction || colspan=3 | Access Control | | Unused || colspan=7 | Length || Trapped || Written || colspan=2 | Unused || Direction || colspan=3 | Access Control |
Revision as of 13:41, 28 November 2022
Templates are a way to include in an article blocks of MediaWiki source which have been given a name. They used in the Computer History Wiki to prevent the reduplication of work and help provide a uniform layout.
For example, we have the template {{stub}} to indicate a short, very incomplete article. Instead of having to include this text manually on every such article, placing the text {{stub}} in an article produces:
(If you want to see all the articles tagged as stubs, this link will show them all to you.) There is also a {{semi-stub}} variant, for pages that are more complete, but could still use some work; a list of those is available here.
We also have several series of templates which are used to provide information in standardized ways. In addition to these, described below, you can find a list of all the templates in the system here.
Infoboxes
Infoboxes allow the uniform display of information based on a template. Custom data can be fed into the template by entering it into the article, for example:
{{Infobox Machine | name = Apple I | manufacturer = [[Apple Computer]] | form factor = [[Personal Computer]] | year introduced = July 1976 | year discontinued = March 1977 | cpu = [[MOS 6502]] | clock speed = 1 MHz | ram = 4 KB standard | graphics = 40x24 character output | successor = [[Apple II]] }}
Apple I | |
Manufacturer: | Apple Computer |
---|---|
Year Introduced: | July 1976 |
Year Discontinued: | March 1977 |
Form Factor: | Personal Computer |
Clock Speed: | 1 MHz |
Memory Size: | 4 KB standard |
Graphics: | 40x24 character output |
CPU: | MOS 6502 |
Successor(s): | Apple II |
produces the box on the right of the screen here. The Infobox Machine template is the general template for most computer systems in this wiki. See Template:Infobox Machine for an overview of the values you can use with this template.
To avoid the insanity of a haphazard set of datasheets for a million different devices, we've got some basic templates in place which we really would like you to use:
- Template:Infobox Machine - for a system in general
- Template:Infobox Tape drive - for tape drives
- Template:Infobox Disk drive - for disk drives
- Template:Infobox Terminal - for terminals (both printing and video)
- Template:Infobox Software - for software, etc.
- Template:Infobox OS - for operating systems
- Template:Infobox App - for applications (similar to Software above)
If these are not sufficient, or you have any requests or comments, you can discuss it on the talk page of this article -- the people writing the infoboxes are watching these talk pages.
Registers
For showing the contents of registers (in CPUs and devices) we have a series of display templates.
To begin with, for 16-bit registers, there are Template:16bit-header and Template:16bit-bitout, which used thusly:
{{16bit-header}} | Unused || colspan=7 | Length || Trapped || Written || colspan=2 | Unused || Direction || colspan=3 | Access Control {{16bit-bitout}}
produces this:
Unused | Length | Trapped | Written | Unused | Direction | Access Control | |||||||||
15 | 14 | 13 | 12 | 11 | 10 | 09 | 08 | 07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 |
Following that, a number of similar register templates have been created. For each word length, there's one header template (like the one above), shared between all the versions, and then one or more footer ones, which produced differently-formatted output.
They are:
- 18-bit (Template:18bit-header and Template:18bit-bitout).
- 36-bit (Template:36bit-bitout), and also 36-bit half-word (Template: 36bithalf-bitout).
- 32-bit, in both little-endian and big-endian (Template:32bitbig-bitout and Template:32bitlittle-bitout) bit-numbering forms (since there are machines of that word size for both)
Finally, motivated by how nice the 36-bit ones looked, grouped into 3's by colour, versions of the 16-bit ones with similar blocks, for both hex and octal machines (Template:16bitoctal-bitout and Template:16bithex-bitout), were added. They produce output which looks like this:
Unused | Length | Trapped | Written | Unused | Direction | Access Control | |||||||||
15 | 14 | 13 | 12 | 11 | 10 | 09 | 08 | 07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 |
External links
- Help:Template - help page which explains the more complex syntax used for arguments, conditionals, etc