Documentation/Style guide

From MediaWiki.org
Jump to navigation Jump to search

Overview[edit]

This page is a supplementary style guide for writing and editing technical documentation in MediaWiki and other technical spaces. It is intended to provide tips for writing clear, concise technical documentation in plain language, to highlight best practices and standards for a variety of technical documents used across projects, to share resources and knowledge about technical writing and editing in general.

"Good" technical documentation makes it easier for individuals to make technical contributions across Wikimedia projects. Whether you consider yourself a writer or not, your contributions are needed and appreciated.

English Wikipedia Manual of Style[edit]

The English Wikipedia's Manual of style covers certain topics in detail (like punctuation) and summarizes the key points of others. It can be a useful reference for anyone writing or editing technical documentation in English across Wikimedia projects when no more specific guidelines exist on the local wiki.

Additional guidelines for technical writing and editing[edit]

It is important to follow clear standards and style guidelines for writing and editing documentation, especially when many individuals contribute to it with varying levels of skills and experience. There are many style and usage rules for general writing – far too many to remember – and even more for technical writing. This page provides basic guidelines and tips to help get you started, as well as some specific information not covered in the Wikipedia Manual of Style.

Writing for technical audiences[edit]

Before you begin writing, it is important to think about the audience for your work.

  • Who do you imagine will be reading this technical documentation?
  • Where are they coming from?
  • What level of familiarity do they have with the concepts you are presenting?
  • What might they need to know in order to understand?

Once you have an understanding of your audience, you will have a better sense of what you need to convey and how to to convey it.

Tips:
  • If you know your audience is highly technical and familiar with the processes you are describing, then you do not need to explain basic concepts.
  • If you know your audience is learning or unfamiliar with the processes you are describing, then include explanations of basic concepts and links to additional information.

Writing with a purpose[edit]

What purpose will your technical documentation serve? There are many reasons to write documentation. It is helpful to know why you are writing and what your goal is before you begin.

  • Is it to teach someone, like a newcomer, about a process or concept?
  • Is it to show someone how to follow a process?
  • Is it meant to provide background and context for a concept or process?
  • Is it a reference intended to provide information?

Writing within a context[edit]

When deciding what to write and how to frame it for your reader, it can help to define a context or occasion for your writing. Your communication takes place in the context of a bigger situation. The context may be bounded by the era you are writing in, the type of technology available, your geographical location and culture, or the current culture and communication styles of the community you and your readers belong to. The occasion may be personal and arise from the situation that motivated you to create or improve a piece of documentation.

For example, if you are writing for technical documentation for Wikimedia projects, a context to consider is the culture that has been created by the individuals who volunteer, participate and interact across these projects. How could you best position your writing within the context of this community and its culture to create the most meaningful and useful technical documentation?

User testing and feedback[edit]

Ideally, technical documentation is created to communicate ideas and concepts to a real audience of users. Naturally, this audience should play a critical role in how the documentation is shaped and reshaped. Think about ways you can gather information about your users' experiences. Does your documentation include a mechanism for feedback? Can you engage in timely conversations with the audience to make improvements?

Deciding on a document type[edit]

Once you have identified your main audience, purpose, and context of your documentation, you should put some thought into the type of document you will create.

Example Audience Purpose[1] Context Potential Document Types Example
Newcomer interested in learning how to become a Toolforge user To learn Tutorial, FAQ, Getting Started guide Cloud VPS and Toolforge FAQ
Experienced technical contributor trying to work through a known problem To achieve a goal Walk-through, How-To guide My First Flask OAuth Tool
Individual trying to understand the history of ORES and how it evolved To understand Explanatory article, blog post Artificial intelligence service “ORES” gives Wikipedians X-ray specs to see through bad edits
A person looking for a definition of SSH keys To inform Reference guide, glossary Glossary

Clarity and consistency[edit]

Your goal is to make accessing, reading, and creating technical documentation for MediaWiki/Wikimedia easier and more intuitive by promoting clarity and consistency throughout. Technical documentation is written for a wide audience and edited by a variety of contributors.

Voice, tone, grammar usage, style, and format should be consistent across technical documentation and similar content collections. This helps readers learn how to navigate information and makes it easier for contributors to understand how to edit and add new information.

Language[edit]

This section briefly mentions some topics worth exploring elsewhere in more detail. Always check your words and expressions against these criteria on Wiktionary: Wiktionary entries cover hundreds of languages, explicitly state the grammatical and lexical features of words and their declensions, provide detailed context labels (including about jargon, UK vs. USA English) and expose how translatable terms are in hundreds of other languages.

Plain English[edit]

Please remember: many visitors to these pages are not native English speakers.

For documentation written in English, Plain English works best. Clear writing is the most understandable by diverse audiences, and is also easiest to translate. There are a number of good tools for checking your writing, at m:Tech/News/Manual#Guidelines

Tips:

  • Avoid ambiguity, jargon, and vague or unnecessarily complex wording.
  • Use words your audience will understand, and use just enough words to convey your message.
  • Define terms that may not be obvious to individuals who are new to the subject matter you are writing about.
  • Keep paragraphs and sentences short and concise.
  • Use contractions or don't. Just be consistent.

Voice and tone[edit]

What kind of voice and tone should technical documentation have?

Given the nature of a wiki – a place where anyone can and should edit – it can be difficult to institute and maintain a consistent voice or tone throughout all technical documentation.

Consider incorporating the following elements in your writing:

Voice and Tone What this means Instead of this Try This
Friendly Technical documentation does not need to sound academic or dry. Write to your audience as if they are there in person.
Professional Technical documentation can be friendly, but should remain professional.
Positive Avoid using negative sentence constructions. Explain things in terms of what to do. It is harder to mentally parse a complex negative sentence! N won't happen, if you don't XYZ. To make N happen, do XYZ.
Active Try to use active voice, except when diplomacy calls for passive voice. The extension must be registered. You must register the extension.
Non-gendered Adopt gender-inclusive language. Assume your audience comprises all gender identities. When he clicks Save When the user clicks Save
Inclusive Use alternatives to common words or phrases that may unintentionally reinforce inappropriate stereotypes. This UI is crazy. This UI could be improved.
Free of colloquialisms It can be confusing to use colloquialisms, jokes, puns, or turns of phrase that non-native English speakers or individuals from other regions might not easily understand. Creating a user account is a piece of cake. It is easy to create a user account.

Note: This is not meant to be an exhaustive list or a strict set of rules

Point of view[edit]

  • Use second person ("You" or assumed "You") when addressing your audience.
  • Avoid first person ("I"), unless you are writing a FAQ with questions asked from the first person perspective.
  • Use an imperative mood for most documentation focused on goals or process.

Structuring pages[edit]

Overview[edit]

All pages should include an overview section that explains:

  1. Purpose of the page
  2. Audience of the page
  3. Prerequisites the reader will need to know before proceeding (Ex. a working knowledge of Python)
  4. Software or tools the reader will need to complete the processes or tasks outlined on the page (Ex. Java installed)
  5. (Optional) Use case, case study, a practical understanding of the product, service or tool in action.

Table of contents[edit]

  • Each page should include a table of contents, so information can be accessed easily.

Titles and Headers[edit]

  • Use sentence case for headers.
  • Keep header fonts consistent throughout documentation.
  • Optional use of anchors to link sections or subsections in the same page.

Information flow[edit]

Technical documentation pages should follow a consistent pattern across content collections.

An ideal pattern for each page might be:

  • Page Title
  • Introduction/Overview
  • Header
    • Content
      • Subhead if needed
        • Content

Formatting text[edit]

Basic text formatting[edit]

See Help:Formatting for information.

Formatting code examples and other technical elements[edit]

Many situations call for text to be formatted in a way that distinguishes code and other technical elements from regular text.

Purpose Wiki-Markup Result Situation
Code <code>code</code> code Use for short strings of code, including wikitext markup.

Within <code>...</code>, use ''italics'' to indicate variables and sample names so users know what to replace.

Syntax highlight
<source lang="css">
.citation {
    margin: 0;
}
</source>

Text before <source lang="css" inline>.foo {margin: 0;}</source> text after.

.citation {
    margin: 0;
}

Text before .foo {margin: 0;} text after.

Use the <source lang="...">...</source> tag to document a few lines of code, and preserve whitespace and linebreaks. The inline attribute allows using it within an existing paragraph.

Note you cannot use italic in the middle of a <source lang="foo">...</source> block, so you have to fall back to YOURPASSWORD or The_page_title to indicate variables.

See Extension:SyntaxHighlight for more details.

Preformatted <pre>preformatted text

      with indent</pre>

preformatted text
      with indent
Same as above (preserve whitespace and linebreaks), but without coloring.
Keyboard input <kbd>keyboard 123</kbd> (vs keyboard 123) keyboard 123 (vs keyboard 123) Use <kbd>...</kbd> for actual keyboard input - the text a user types into an input field or at a terminal command line. It displays in plain monospace.
Variables <var>variable</var>

''italics''

variable

italics

Use italics for variables like message-key-name and sample names like My page title.

Do not use punctuation such as <YOURPASSWORD>, because readers don't know the angle brackets are noise and will type them.

Bold '''bold''' bold Generally only used for the first instance of the page-title, and for rare emphasis of keywords to enable easier skimming of lists or paragraphs.

Note: Sometimes bold is overused for emphasis. You may consider using a template instead, e.g. {{Caution}}, {{Note}}, or {{Warning}}.

Quotations "quotation marks"

Text before

<blockquote>blockquote</blockquote>

Text after

"quotation marks" Text before

blockquote

Text after
Use quotation marks for brief pieces of content quoted from other sources.

Use blockquote for longer pieces of content.

Abbreviations JavaScript (JS)

<abbr title="JavaScript">JS</abbr>

JavaScript (JS)

JS

You should define abbreviations the first time they are used. Use either plain text and parentheses, or the HTML abbr tag.
Keypress {{key press|Ctrl|Shift|I}} Ctrl+ Shift+I Showing specific keyboard presses or combinations. Extensive examples in VisualEditor/Portal/Keyboard shortcuts.

Note: This template might not exist on other wikis.

Button {{Button|{{int:showpreview}}}} Show preview Showing UI buttons that need to be clicked on.

Note: This template might not exist on other wikis.

Links Links to internal and external and interwiki pages.

See #Links below

Links[edit]

Purpose Type How to implement Example
Full
Piped
Local
  • [[Foo]]
  • [[Foo|Bar]]
Translated Target [[Special:MyLanguage/Foo|Foo]]
Interwiki
  • [[phab:T2001]] for tasks and project tags
  • [[mail:wikitech-l]] for mailing lists
  • [[w:en:foobar]] to English Wikipedia articles
  • [[wikitech:foobar]] for details about the WMF cluster.
External [https://www.example.org Example.org]

Useful templates[edit]

Templates are often used on Mediawiki.org pages. Templates can help to maintain consistency and can make it easier to translate information.

Below are some common templates:

See Documentation/Style guide/templates for examples of some of these.

Internationalization and localization[edit]

All pages on mediawiki.org are candidates for translation into multiple languages. MediaWiki.org is a multilingual wiki, it uses the Translate extension to present alternative translations and manage the translation of pages.

Tips:

  • If a page has been translated, then click 'Edit source' to edit the entire page. Wrongly placed translation tag markers around section headings can confuse section editing, and As of July 2015 VisualEditor does not understand the <languages>, <translate>, and <tvar> tags.
  • Do not copy and paste existing markup. If in doubt, just focus on writing a good text and let someone else handle the Translate markup.

See also[edit]

Other technical documentation style guides[edit]

Below is a list of other technical documentation style guides:

Footnotes[edit]