Overview
This document describes the options available for creating content for the site, along with some guidelines and conventions. We are thankful to you for thinking about contributing to our doc set!
Markdown
This site is built using propeitary documentation tooling that uses Markdown as it's authoring language. Learn more about Markdown:
The following sections provide information about different elements of a page. Use these as guidelines when you start authoring or editing a document.
Frontmatter
To ensure that each page can be correctly identified, we use the frontmatter. At the top of each docs page, include the following elements:
Variable | Description |
---|---|
id |
A brief string that uniquely identifies the page within its parent folder. |
title |
The main title of the page. |
sidebar_label |
This is what will appear in the left hand navigation tree for the page. |
description (optional) |
This is what appears when the page is referenced in a Google search result. |
When you are done, the document would look as follows:
---
id: overview-contributing
title: Overview
sidebar_label: Overview
description: Nightwatch Contribution Guidelines
---
Introduction
The first paragraph of the documentation is a window to setting expectation in terms of what the content on the page woudl help the user accomplish. As a guidelines, describe the benefits of the feature followed by an example of where they can use it.
Headers
Apart from the standard markdown guidelines of heirarchical headers, for example, H2 must be nested under H1, H3 must be nested under H2, etc., use the following guidelines:
- H1 header is used as title that appears as page header and on the left navigation pane. Use the
<div class="page-header"><h1>Adding custom assertions</h1></div>
format to differentiate a H1 header that will be used as the page title. - H1 header is used for SEO, so ensure that it is crafted concisely.
- Each page includes only one H1 header.
- H3 headers are included in the page's table of contents on the right. Use H3 headers to add actionable content. All H3 headers are underlined by default.
- H4 headers can be created using custom format
GeckoDriver
.
Markdown Code:
<div class="page-header"><h1>Adding custom assertions</h1></div>
H3 Header
<h3 id="install-geckodriver">GeckoDriver</h3>
Content
Staying true to the nature of Markdown, all content is rendered as a single paragraph. When you add an empty line, a new paragraph begins. As such, it is good practice for each line to be less than 120 characters long for readability, when possible.
Tabbed content
[Yet to write]
Inline Code
To refer to a single class or method name within a sentence, place single backticks around the name.
Markdown |
```
[element] )
```
```
`code`
```
```
```
|
Display |
This comment refers to the
|
Code Blocks
When you have code blocks, use the following format. Markdown highlights each language differently, so it is helpful to specify which language you are using, and it's a good idea to include a title with the code block as well.
Markdown |
|
Display |
your code goes here
|
Admonitions/Notes
There are two types of admonitions:
- info - Relevant information.
- Warning - A user might do something dangerous!
Markdown |
```
The below commands runs an example test which opens the search engine [Ecosia.org](https://www.ecosia.org/), types the term "nightwatch" into the search input field, then verifies if the results page contains the text "Nightwatch.js".
|
Display |
|
Linking to another page
Use the markdown syntax for linking to another page:
Markdown |
|
Display |