Wiki source code of Documentation Style

Last modified by Eleni Cojocariu on 2026/11/25 11:30

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
5 Whenever you create or edit a documentation page, it is important to follow a consistent style. The rules below provide guidance on structure, formatting, and terminology.
6
7 == Content Writing Guidelines ==
8
9 === Syntax ===
10
11 * Pages must be written in xwiki/2.1 syntax.
12 * When you're not sure about how to use the syntax, please consult the [[XWiki Syntaxes Page>>xwiki:Documentation.UserGuide.Features.XWikiSyntax]].
13 * When [[converting a page from xwiki/2.0 to xwiki/2.1 syntax,>>xwiki:documentation.xs.user.page.view.change-syntax.WebHome]] you should look at the end result and check for [[conversion errors>>xwiki:documentation.xs.user.page.view.change-syntax.syntax-conversion.WebHome||anchor="HConversionErrors"]].
14 * Avoid using HTML code and use [[XWiki Syntax>>xwiki:Documentation.UserGuide.Features.XWikiSyntax]] instead.
15
16 === UI Elements ===
17
18 Whenever referring to a UI element in the documentation (such as buttons, menu items, tabs), you must use "quotes" to distinguish it from the rest of the text. For example: {{code language="none"}} Select the content Syntax you want to use from the "Page Syntax" section inside the "Page Information" Panel. {{/code}} or {{code language="none"}} Click the "Edit" button. {{/code}}
19
20 === XWiki Terminology ===
21
22 A word is considered "terminology" if it has a special meaning in XWiki, other than in the English dictionary (example: "Panel" when referring to the left or right Panel in XWiki, "Sheet" when referring to the XWiki Sheet etc.).
23
24 Whenever writing a word that is XWiki Terminology, you must write it in plain text and uppercase, until a proper [[Glossary>>design:Proposal.Diataxisforxwikiorg]] strategy is implemented. The [[Glossary Application>>extensions:Extension.Glossary.GlossaryApplication.WebHome]] on xwiki.org will later help automatically write and link to explanations for the terminology words.
25
26 ==== Glossary ====
27
28 All [[XWiki terminology>>||anchor="HXWikiTerminology"]] must be collected in the [[Glossary Terms>>dev:Drafts.Glossary.WebHome]] page until the [[Glossary Application>>extensions:Extension.Glossary.GlossaryApplication.WebHome]] is properly configured. All entries in the Glossary must have pages as [[Diataxis Explanation pages>>Community.DocGuide.ChooseRightLocation.PageTitlesNames.WebHome||anchor="HDiataxisReflectedinPageTitleandPageContent"]], located in the place where that explanation makes sense in the [[documentation hierarchy>>dev:Community.DocGuide.ChooseRightLocation.WebHome]].
29
30 === Literals / Computer Terms ===
31
32 It is recommended to use the ~#~#notation~#~# for literals and computer terms.
33
34 For example, instead of saying {{code language="none"}}This is the "age" xproperty{{/code}}, you'd write {{code language="none"}}This is the ##age## xproperty{{/code}}.
35
36 === Punctuation ===
37
38 Use the punctuation mark that the sentence actually needs. The em dash (##—##) is not a replacement for a comma, a period, a colon or parentheses, and a page in which most sentences contain one becomes tiring to read. Keep it for a sharp interruption or a genuine aside.
39
40 For example, instead of writing:
41
42 {{code language="none"}}
43 The export runs in the background — as a job — so the file may take a while to appear.
44 {{/code}}
45
46 you'd write:
47
48 {{code language="none"}}
49 The export runs in the background, as a job, so the file may take a while to appear.
50 {{/code}}
51
52 Inside a direct quote, punctuation stays exactly as the quoted source has it.
53
54 === No Styles ===
55
56 When creating or modifying page content, please don't use styles. The reason is that we want that pages only contain content and that they all look the same.
57
58 For example, don't write:
59
60 {{code language="none"}}
61 (% style="font-family:Georgia,serif; font-size:14px" %)From XWiki WebPreferences page: Global Administration → Look & Feel → Presentation → subsection Header → Title.(%%)
62 {{/code}}
63
64 but instead:
65
66 {{code language="none"}}
67 From XWiki WebPreferences page: Global Administration → Look & Feel → Presentation → subsection Header → Title.
68 {{/code}}
69
70 === Linking ===
71
72 * You must link XWiki concepts to their corresponding documentation pages whenever such documentation exists. If a page mentions an XWiki concept, feature, term, or functionality that has a dedicated documentation page, the concept should be linked directly to that page. The link should be applied to the relevant wording within the sentence, rather than added as a separate or generic link.
73 ** For example, if a page mentions exporting content as XARs, the wording referring to XAR export should link to the corresponding XWiki documentation page about exporting content in XAR format.
74 * You should use links to point to other useful resources outside the page.
75 * Don't use URLs for links to xwiki.org. If the URL format or the domain get changed, the links will be broken. You should use the [[link reference syntax>>xwiki:Documentation.UserGuide.Features.XWikiSyntax||anchor="HLinks"]] instead. To easily get the "id" of the page you are linking to, scroll to the bottom of that page, select the Information tab, and copy the value in the [[Page Reference>>xwiki:Documentation.UserGuide.Features.DocumentLifecycle.WebHome||anchor="HInformation"]] field.
76 ** If the link is meant to work only inside the same [[Wiki>>xwiki:documentation.xs.user.wikis.WebHome]], use reference displayed by default, which is relative to the current Wiki.
77 ** If the link needs to work across all Wikis, use the global (absolute) reference.
78 * More information about links, including differences between the different syntaxes, can be found by reading the [[XWiki Syntax page>>xwiki:Documentation.UserGuide.Features.XWikiSyntax||anchor="HLinks"]].
79 * If you wish to link to a file on GitHub, you must use the ##~{~{scm}}## macro ([[SCM Macro>>xwiki:documentation.extensions.user.documentation.documentation-xwiki-org.scm-macro.WebHome]]), provided by the Documentation Application. The rationale is that this lets us switch source control hosting without breaking all our URLs.
80
81 === List Items ===
82
83 When you need to enumerate items in the documentation pages, you should use bullet points rather than displaying multiple items on a single line. Bullets improve readability and make content easier to skim through. It's very frequent to have an item list and to have some images or tables to display inside a list item.
84
85 What **not** to do:
86
87 {{code language="none"}}
88 * Item 1
89 * Item 2
90
91 {{image reference="whatever.png"/}}
92
93 * Item 3
94 {{/code}}
95
96 The reason is that this breaks the list (by creating 2 lists) and the image will not be displayed inside the list item.
97
98 Instead, you should write:
99
100 {{code language="none"}}
101 * Item 1
102 * Item 2(((
103 {{image reference="whatever.png"/}}
104 )))
105 * Item 3
106 {{/code}}
107
108 === Avoid Duplicated Content ===
109
110 The same information must not be stated on two pages, however differently it is worded. If the same text, steps in a how-to, or images are repeated in two or more places, give that content a single home and link to it from the others.
111
112 * Prefer a **visible** page. Where the repeated content is meaningful on its own, restructure so that it becomes a page of the documentation tree: a navigation step that several how-tos open with becomes its own how-to that each procedure opens by linking to (for example [[Open the AntiSpam Application>>xwiki:documentation.extensions.admin.antispam.open-application.WebHome]]), and a page whose section is repeated elsewhere is split into two smaller pages, the shared one linked from both. A visible page is reachable from the navigation panel and from search, it answers a reader goal on its own, and a later author cannot duplicate it again by failing to notice that the content is shared.
113 * Otherwise, put the content in a content fragment, as described in the [[Macros>>||anchor="HMacros"]] section.
114
115 Repeated steps deserve particular attention, because a step carries its screenshot with it: the same image is attached to every page, and the copies are then free to drift apart as one of them is re-captured. Two comparisons find this without needing any judgement: line up the first step of the how-tos that share a parent page, and check that no attachment name is used by more than one page.
116
117 == Other Best Practices ==
118
119 === Macros ===
120
121 Macros can help you better visualize information within a page. You should use:
122
123 * Whenever you need to show code, file content, configuration, or similar text, use the [[code macro>>doc:xwiki:documentation.xs.user.content-edit.formatting.code-macro.WebHome]] instead of a screenshot. Make sure you always use the ##language## parameter as otherwise you're going to make it slower than it should be (the content will be analyzed to infer the language) and in a lot of cases the wrong language will be found leading to bad syntax coloring.
124 ** Using the code macro makes the content easier to maintain and update, as authors can edit the text directly. It also provides a better experience for readers, who can easily copy and paste code examples when needed.
125 * The [["Content Fragment" Macro>>xwiki:documentation.extensions.user.documentation.content-fragment-macro.WebHome]] to avoid duplicated content across pages, when no restructuring can give the repeated content a visible page of its own (see [[Avoid Duplicated Content>>||anchor="HAvoidDuplicatedContent"]]). Add the repeated content as a content fragment of the documentation page it belongs to, and display it on the other pages with the macro, following [[Reuse a Content Fragment on Several Pages>>xwiki:documentation.extensions.user.documentation.reuse-content-fragment.WebHome]]. Don't create a hidden page to hold it: hidden pages still show in the navigation and the search for users who display hidden pages. (For example: the "convert-syntax" content fragment of [[Change the Syntax>>xwiki:documentation.xs.user.page.view.change-syntax.WebHome]], also displayed on [[Change the Syntax when Editing>>xwiki:documentation.xs.user.content-edit.change-syntax.WebHome]]).
126 * The [[version macro>>Community.DocGuide.Versioning.WebHome]].
127 * The [[deprecated macro>>Community.DocGuide.Versioning.DeprecatedContent.WebHome]].

Get Connected