Advanced Wiki Use

From CDOT Wiki
Jump to: navigation, search

Namespaces

  • MediaWiki supports the concept of namespaces for organizing content
  • Default namespaces include:
    • Main -- Main wiki content
    • Template - Used for template text that will be transcluded into other pages
    • User - User pages (generally account info, but additonal pages can be created)
    • Name of Wiki - Used for policy information, such as copyright/licensing policy, privacy policy, and so forth
    • MediaWiki - Used for special pages, such as the sidebar and configuration options
    • Special - Used for special pages generated on-the-fly from the database, such as the list of users, usage statistics, and system messages.
    • Each category also has a corresponding Talk page, which contains the Talk pages accessed through the Discussion tab
  • Pages within a namespace are accessed by prepending the namespace name to the page name: [[Namespace:Page]] If no namespace is given, the Main namespace is used.

Categories

  • Categories are collections of related pages.
  • Basic syntax (location on the page does not matter): [[Category:category-name]]
  • This has two effects:
    1. It puts a Category link at the bottom of the page
    2. It adds the page to the Category page (a type of Index)
      • The Category pages does not "exist" until you add some text to it, but it will still show pages in that category even before it "exists". It's a good idea to add introductory text -- even one line -- so the category links don't show in red. If you do this for all legitimate categories, you can spot mistyped category names easily (red links).
  • To link to an actual category page: [[:Category:category-name]]

Tips:

  • You can nest categories by placing a parent Category link in a Category page. Example:
    • Each CDOT Workstation could have it own page, with a [[Category:CDOT Workstations]] link.
    • The CDOT Workstations page would have a [[Category:CDOT]] link.
    • The CDOT category page would show CDOT Workstations as a subcategory.
  • You can place category tags in templates

Transclusion and Templates

  • Transclusion is pulling text into a page from another page (line #include in C++)
  • Basic syntax: {{Template}}
  • By default, transclusion will pull in pages from the Template namespace. Alternately, a namespace may be specified.
  • There are two tags available to control what text is transcluded:
    • <includeonly>''text''</includeonly> - The text applies only when transcluded. This is useful when you want to include a Category tag in a template, and you don't want the template itself to appear in the category index.
    • <noinclude>''text''</noinclude> - The text appears only when not transcluded. This is useful for including explanatory text on the actual template page, or when you have a page that may be viewed directly as well transcluded. For example, a page of upcoming lists could include introductory text as well as a bullet list of upcoming events; tagging the introductory text <noinclude> will allow just the bullet list to be transcluded.
  • Templates may accept arguments; these arguments may then be used within the template as text, filenames, pagenames, or for some other syntax. In the template, arguments are accessed using triple braces and the argument number: {{{1}}}. In the transclusion reference, arguments are delimited with the vertical-bar (pipe) character. Example: {{Admon/note|Unstable API!|This API is marked Unstable, and may change without warning. If you use this API, be prepared to revise your code frequently.}} -- which produces:
Note.png
Unstable API!
This API is marked Unstable, and may change without warning. If you use this API, be prepared to revise your code frequently.
  • Useful templates:
    • {{Draft}} - Marks a page as a Draft (warning users) and adds the page to the Drafts category.
    • Admonition templates. These templates accept two arguments, and produce a coloured text box containing an icon, a bold title, and some text.
      • Admon/note - used to mark items of particular note to users. Icon: notepad
      • Admon/tip - used to mark suggestions/tips/ideas for users. Icon: lightbulb
      • Admon/caution - used to mark items the users should be wary of. Icon: red circle with white horizontal bar ("Do Not Enter")
      • Admon/important - used to mark important warnings. Icon: exclaimation mark in yellow warning triangle

Interwiki Links and Scary Transclusion

  • Links between wikis are supported using InterWiki links. This involves placing a interwiki name in front of the page name (optionally, with a namespace), surrounded by colons: [[:fedora:Architectures/ARM]]
  • Our interwiki table includes entries for the Mozilla MDC/Education wikis and the Fedora wiki, as well as a number of standard wikis (such as Wikipedia and Wicktionary).
  • It is also possible to transclude interwiki text: {{:interwiki:Page}}

Page Naming

  • Good page names makes wiki navigation and gardening much easier.
  • Choose page names that reflect:
    • the fact that the wiki is used/shared between a many different projects
    • the (semi-)permanent nature of the wiki and include appropriate versioning.
  • You can use path-style namespace division -- for example: Project/Component/Topic
  • Pages which are personal versions of drafts/proposal/idea sketches should be placed the User namespace, using a path-style name starting with your name (example: User:Chris Tyler/Drafts/Fedora Arm - Support for armv7tej). Recommendation: use a template to mark all of your personal drafts as drafts and to include them in a personal draft category: {{Chris Tyler Draft}}

Examples:

Bad Title Better Title
Ideas for Next Summer Foo Project Ideas for Summer 2011
Notes on This Release Notes on Foo release 1.41
My Feature Ideas User:FrankSmith/Ideas/Foo-Features-1.5
Research Plan Foo Project/Summer 2010/Research Plan

Redirects

  • Used to redirect from one page name to another.
  • Useful in three situations:
    • As trampolines: a standard page name that can be redirected to different pages as circumstances change. Example: Foo Release Notes could redirect to Foo Release 1.41 Notes, and be updated as new releases are issued.
    • To make pages easier to find by linking a likely search term to the correct page for that term: SheevaPlug could redirect to Fedora ARM Secondary Architecture, and P.js could redirect to Processing.js Project.
    • To allow people to find a page after it is moved (this type of redirect is usually set up automatically).
  • Syntax: in the body of the page, place only: #REDIRECT [[Page]]

Tips

  • Create categories and templates as needed.
  • Place every page in one or more categories.
  • It can be easier/faster to type a template transclusion than a category tag: {{JS}} vs. [[Category:CDOT JavaScript Projects]]
  • Templates can be very short. For example, the Fedora project has a template which is simply the current release number.
  • Templates can hold any kind of text. They can be used to provide page names or media filenames, for example.