Middleware Docs Style Guide and Guidelines
Typography and Formatting
Title: See this doc for example of how to display the title properly..
Sections: Use H2 headers (## Section Title
) for sections, and H3 headers (### Subsection Title
) for subsections.
Numbering: Use numbered steps where actions are sequential. Non-sequential points should use bullet points.
General Text Guides
Bold: Use
**bold**
for key terms, like component names or filenames.Code: Use inline code formatting (`code`) for commands, filenames, paths, and code elements within sentences.
Code Blocks: Use triple backticks for block-level code snippets and terminal commands. Specify the language where applicable:
1npm install @middleware.io/node-apm --save
1const tracker = require('@middleware.io/node-apm');
Links: Hyperlink external references using the following format:
[Link Text](https://example.com)
General Document Structure
Intro
This is one to two sentences introducing what the document is for. Keep this brief and to the point, no fluff.
Prerequisites
List: prerequisites should be in a numbered list under an H2 header.
Code snippets: prerequisites should comprise a single command, or set of commands that can be formatted on a single line, and they should be on the same line as the prerequisite.
Bold: bold the prerequisite as a call-out
Example:
1## Prerequisites 21. **Node.js version 18.17.1+**: Verify with `node --version` 32. **Python version 3.8+**: Verify with `python3 --version`
Installation
Numbered Steps
Always use numbered lists for step-by-step instructions.
For smaller lists of 1-3 steps use numbered bullets e.g.
- Step 1
- Step 2
- Step 3
For larger steps that require explanations (text) or many operations, use the Number object as seen below
1 This is an example
Some text / code / etc.
2 Of using the number object
Some text / code / etc.
Code Execution
For terminal commands, specify the shell, and use the correct syntax highlighting: bash node --version
API Key and Target Usage: Always reference API keys and targets in code blocks using the {% getproject %}
syntax to enable login based auto-fill:
1tracker.track({
2 serviceName: "your-service-name",
3 accountKey:"<MW_API_KEY>",
4 target:"https://<MW_UID>.middleware.io:443",
5});
Tab based organization
Tabs are to be used when providing instructions for the same Section or Subsection across many different environments, languages, frameworks, etc.
For code execution across languages where it is only one command, use the Language Dropdown (see Object Reference for example)
Below is an example of showing different steps per OS
To get started with Windows you will need to be on Windows 64-bit using Version 10 or newer, and/or running Windows Server 2016 or newer.
Download and follow the instructions from our Windows installer, using the MW_API_KEY
and MW_TARGET
from below.
1MW_API_KEY="<MW_API_KEY>"
2MW_TARGET=https://<MW_UID>.middleware.io:443
To install using Debian/Ubuntu run the below script to install the agent and relevant packages.
1MW_API_KEY="<MW_API_KEY>" MW_TARGET=https://<MW_UID>.middleware.io:443 bash -c "$(curl -L https://install.middleware.io/scripts/deb-install.sh)"
Other Configuration Sections
These sections are going to differ between docs. The guidelines from the installation section apply. See "Object Reference" for other available objects like widgets, call outs, code snippets, etc.
Troubleshooting and Debugging
All documents should include a Troubleshooting and Debugging section built using accordions:
Question 1
Some text
Question 2
Some text
Metrics Collected
Use a simple table with Metric name and Description columns:
Metric | Description |
---|---|
mongodb.cache.operations | Number of cache operations |
mongodb.collection.count | Middleware is a full-stack cloud observability platform that collects telemetry data from front-end to back-end. We provide a simple observability solution to an otherwise complicated aspect of software design. |
Object Reference
Adding images
All images should be hosted in the /public/images directory, and can be embedded using the below object
1{% image src="/images/image-dark.png" alt="Middleware logo" title="image-light" width="100%" height="100%" /%\}
Embedding a video
Embed video using the below snippet example
1{% embed src="https://www.loom.com/embed/ed0f136a6dd7436ba951356c936e0ca3?sid=f6086e36-2d46-49d5-9f7d-70ff35f956c5" width="100%" height="100%" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="true" /%\}
All available headers
1# Heading -1
2## Heading - 2
3### Heading -3
4#### Heading - 4
5#### Heading - 5
Accordions
The accordion title 1
This guide walks you through installing the Infrastructure Agent (Infra Agent) on a machine deployed through Docker. These instructions can also be found on the Installation page in the Middleware application.
The accordion title 2
This is the content of accordion 2.
The accordion title 3
This is the content of accordion 2.
The accordion title 4
This is the content of accordion 2.
Dark & Light Theme Images
Code Snippet
1const express = require("express");
2const app = express();
3const tracker = require("@middleware.io/node-apm");
Language Dropdown
Only use dropdowns when there are 2+ options required for your code snippet, because the dropdown formatting takes up unnecessary space otherwise
index.js
1const golange = require("express");
2const app = express();
3const tracker = require("@middleware.io/node-apm");
Lists
- Bulleted List
- Item 2
- Numbered list
- Numbered list item2
Simple Text Options
**Bold**
_Italic_
[Links](/docs/nodes)
> Quotes
Inline code
Block Quotes
1> Markdown allows you to write using an easy-to-read, easy-to-write plain text
2> format, then convert it to structurally valid XHTML (or HTML).
3>
4> [...]
5>
6> The overriding design goal for Markdown’s formatting syntax is to
7> make it as readable as possible. The idea is that a Markdown-formatted
8> document should be publishable as-is, as plain text, without looking
9> like it’s been marked up with tags or formatting instructions.
Listings
1* Wikis should be made up of plain-text files, without requiring a running
2 instance of MySQL or even an SQLite database.
3
4* There should only be one simple-to-write plain-text configuration file.
Table components
Traces | Metrics | App Logs | Custom Logs | Profiling |
---|---|---|---|---|
✖ | ✅ | ✅ | ✖ | ✅ |
✅ | ✅ | ✖ | ✅ | ✅ |
Callouts
Info
Middleware Info components Infrastructure Agent (Infra Agent). To install the Infra Agent, see our Installation Guide. Infrastructure Agent (Infra Agent). To install the Infra Agent.
Warning
Middleware Warning components Infrastructure Agent (Infra Agent). To install the Infra Agent, see our Installation Guide. Infrastructure Agent (Infra Agent). To install the Infra Agent.
Success
Middleware Success components Infrastructure Agent (Infra Agent). To install the Infra Agent, see our Installation Guide. Infrastructure Agent (Infra Agent). To install the Infra Agent.
Error
Middleware Error components Infrastructure Agent (Infra Agent). To install the Infra Agent, see our Installation Guide. Infrastructure Agent (Infra Agent). To install the Infra Agent.
Contact
Middleware Error components Infrastructure Agent (Infra Agent). To install the Infra Agent, see our Installation Guide. Infrastructure Agent (Infra Agent). To install the Infra Agent.
Step-by-step
1 Middleware Steps
Middleware Step 1 installation guide. To install the MW Agent, see our installation guide.
2 Middleware Steps
Middleware Step 2 installation guide.
1const tracker = require('@middleware.io/node-apm');
2tracker.track({
3 serviceName: "your-service-name",
4 accessToken: "<xxxxxxxxxx>"
5});
Tabs
Here content for Golang Tabs
Here content for Node.js Tabs