Note: You are currently viewing documentation for Moodle 3.7. Up-to-date documentation for the latest stable version of Moodle may be available here: Style guide.

MoodleDocs:Style guide

From MoodleDocs


Describing the location of items

  • A site admin setting may be referred to as, for example, the setting 'Maximum uploaded file size' in 'Site policies' in Site administration
  • In the Boost theme, we have a navigation drawer and a gear menu. In the Clean theme we have a 'Course administration'
  • In 3.2 we have a menu bar containing a notifications menu and a messages menu

Examples:

  • Grades in the navigation drawer
  • Groups from the gear menu on the Participants page
  • 'Add a new badge' from the More... link in the gear menu on the course page
  • Messages in the user menu

Categories

A category is an index of documentation pages.

  • A page can be added to a category by typing [[Category:Category name]], for example [[Category:Site administration]], at the bottom of the page. Many templates automatically categorise pages using the template, for example [[Template:Forum]] categorises pages into Category:Forum.
  • For linking to a category you have to add another colon like so: [[:Category:FAQ]] which will show as Category:FAQ.
  • Categories lists all Moodle Docs categories. This can be found in the Toolbox Special pages link.
  • For further information about categories and how they work in MediaWiki, please refer to the Wikipedia:Categorization.

Screenshots

  • You are encouraged to illustrate documentation with screenshots. Please use the official Moodle demo site, or any other site or course using one of the standard themes, and ensure that the screenshot is as small as possible.
  • Screenshots should be GIF, JPEG or PNG format, with 72ppi resolution, and maximum width 800px.
  • To fit more into a screenshot, select a smaller text size for the web page via the View > Text size menu in your web browser.
  • Screenshots can be uploaded using the toolbox Upload file link.
  • Please name screenshots descriptively to avoid confusion.
  • To include the screenshot in an article, use a link in the form [[File:Screenshot.png|thumb|alt text]].
  • Please do not apply effects such as borders, watermarks or drop shadows to screenshots. This will allow others to add or replace screenshots over time and still maintain a consistent look and feel to articles.
  • You can duplicate the look of the Mount Orange School used in many Moodle documentation pages by following these instructions.
  • For help on image placement and adding an image caption, please refer to the Wikipedia Picture tutorial.

Templates

  • In MediaWiki, a template is a page which can be inserted into another page. For example, the Moodle Docs help block on this page is a template.
  • A template may be added to a page by typing {{Name}} for Template:Name (template names are case sensitive).
  • All pages (Template namespace) lists all Moodle Docs templates.
  • Please refer to the MediaWiki Template help for further information.

Moodle Docs editing tags

  • Deletion - If you find any page requiring deletion, type {{Deletion}} at the top of the page. Use the page comments if necessary to state the reason for deletion.
  • Update - Features increase with each Moodle version. If you find a page requiring updating, type {{Update}} at the top of the page.
  • Stub - Developers and Moodle Docs administrators may add a new page with a {{Stub}} tag at the top, requesting help in adding content.
  • You can also use the edit summary to communicate the need for more editing. For example in the page history you might see: "Added section, needs more work, see page comments".

PHP syntax highlighting

  • To highlight PHP syntax, enclose the code in tags:
<code php>... Some PHP code here...</code>

That will be rendered as:

<?php require_once(dirname(__FILE__) . '/../../config.php');

$cmid = required_param('cmid', 0, PARAM_INT); if (!$cm = get_coursemodule_from_id('quiz', $id)) {

   print_error('invalidcoursemodule');

} ...

  • For long code examples you can even add line numbering like so:
<code php n>... A lot of PHP code here...</code>

That will be rendered as:

<?php require_once(dirname(__FILE__) . '/../../config.php');

$cmid = required_param('cmid', 0, PARAM_INT); if (!$cm = get_coursemodule_from_id('quiz', $id)) {

   print_error('invalidcoursemodule');

} ...

  • But beware, line numbering makes copying & pasting of code examples more cumbersome!
  • See also the documentation on Code syntax highlighting that uses the GeSHi (Generic Syntax Highlighter) filter.

CSS syntax highlighting

  • To highlight CSS syntax, enclose the code in tags:
<code css>... Some CSS code here...</code>
  • Example:

.que .info .grade { display: none; }