How to contribute to the Rhize docs.
To create a new page, run this command:
hugo new content/<PATH>/<TO>/<PAGE>.md
Each page has the following frontmatter:
title
: The name of the page as it appears in the H1description
: The text that is displayed in social media previewsweight
: The page's relative position in the menu. Heavier weights "sink" to lower on the page.categories
: (Optional) Meta-data about the topicaliases
: URIs from old pages. Configure redirects here.hidden
: Iftrue
page does not display in sidebar. Works only on leaf pages.og_image
(Optional) path to og:image. Default is Rhize logo). Default is Rhize logomenu.main
: An object that configures the sidebar main menu propertiesname
: (Optional) The title of the page as it appears in the sidebar. Default istitle
identifier
: How to reference the page in menu configs, and relrefs and other shortcodesparent
: The parent page (use itsidentifier
)
Example config:
title: GraphQL types and filters
description: A reference of the data types in the Rhize API and of the filters available for each type.
categories: ["reference"]
weight: 930
aliases:
- "/old/page/" # use trailing slash
menu:
main:
name: GQL types and filters
identifier: gql-filters
parent: reference
Hugo evaluates links relative to the published site, which can create some confusion when linking images.
To avoid worrying about relative positions, put all images in /static/images/<SUB_DIRECTORY>
.
Then Reference the image as if static
did not exist.
src="/images/bpmn/screenshot-rhize-bpmn-error-handling-custom-response.png"
Images filepaths provide info for humans and crawlers, so adopt standardized conventions:
Each image should have this structure
<TYPE>-rhize-<DESCRIPTION>.<EXTENSION>
Type should be one of screenshot
, graphic
, or diagram
.
The docs follow the Google Developer's Style Guide, a widely used standard for developer docs.
The Vale CI checker also has a spellchecker for our specific special terms. Check github/workflows/Vocabularies
.
Shortcodes are built in functions that you call in the markdown file. Hugo processes their instructions to render something on the page.
Common use cases are for style, as with notices, and for templating.
The abbreviation provides tooltips, using definitions given in data/termbase.yaml
.
The abbr
syntax is as follows:
{{< abbr "<TERM>" >}}
For example:
These pages describe the elements to make a Rhize {{< abbr "bpmn" >}} workflow,
Renders as:
Center images and have them open in a new tab.
Optional parameters for width
and caption
.
{{< bigFigure
width="65%"
alt="Diagram simplifying flows depicted in part 1 of ISA-95"
src="/images/arch/diagram-rhize-l3-l4-information-flows.png"
caption="A simplified view of how information might exchange between level 3 and 4 systems in a point-to-point topology."
>}}
Puts a warning about breaking changes.
{{< breaking >}}
List the compatible versions of a third party software for a specified version of Rhize.
To use:
- Update
data/versionCompat.yaml
with the version and tested compatibility. - Call the compatibility shortcode using the Rhize version as an argument.
{{< compatible "1" >}}
Renders as:
Hide extensive details in an accordion:
{{< expandable title="Click for more details" >}}
This text should be hidden initially.
Put markdown here
{{< /expandable >}}
Use notices with {{% notice $TYPE %}}
:
For example:
{{% notice note %}}
Just keep this in mind.
{{% /notice %}}
Rhize docs have three types of notices:
- Note. For side information
- Caution. To tell people to be careful or understand limitations
- Warning. When an action is irreversible.
For example:
is rendered from:
{{% notice note %}}
Just keep this in mind.
{{% /notice %}}
{{% notice caution %}}
Be careful, this library could change.
{{% /notice %}}
{{% notice warning %}}
This action is irreversible.
{{% /notice %}}
Insert a text snippet to use in multiple places.
To create a snippet, add it to an HTML or MD file in layouts/shortcodes/reusable
.
Call it with {{% reusable/<FILE_NAME> %}}
.
Add a banner that links to a video.
Requires two params:
text
: The link textsrc
: The video URL
{{< watch text="Add manufacturing data through GraphQL" src="https://www.youtube.com/watch?v=zQ5X0mg3i_w&t=217s"
}}
Each document should have a specific purpose:
At the time of writing, the templated types are concepts
, how-to
, reference
, and releases
.
To decide which topic you want to write, consult this Diagram
Each general purpose has template defined in the archetypes
directory.
For your convenience, use the archetypes
to avoid writing bolerplate properties:
- Navigate to the root of this repository.
- Run
hugo new content/<type>/<name-of-document>.md
Topics are clustered in groups of the sidebar, corresponding to directories of the same name.
If you want to make a type in a different content directory, use the --kind
flag:
hugo new content --kind reference get-started/fake-reference-page.md
To learn how to update templates, read the Hugo Archetypes documentation.