docs/versioned_docs/version-2.68.0/contributing-guide/documentation-guidelines/style-guide.md
Welcome to the ToolJet's Style Guide for creating clear, consistent, and accessible documentation. In this guide, you will find recommendations on text formatting, proper use of headers, code snippet styling, accessibility practices, and much more.
Different elements in your projects should be formatted consistently for clarity. Here are some recommendations:
a. Italics are used for names given to Queries, Database Tables, and Components.
Examples:
b. Bold is applied for Workspace Constants, Clickable Buttons, fx, Data Sources, and Components.
Examples:
c. Use Single Ticks for Inline Code and Triple Ticks for Multi-Line Code.
Examples:
{{queries.getData.isLoading === true}} to show the loader while the getData query is running.// this code is wrapped in triple ticks
const fetchData = async () => {
const response = await api.get('/users');
console.log(response.data);
};
Additional Items:
GET /api/v1/resources).Proper use of headers is crucial for organizing content and improving readability. Use the following guidelines to determine which header level to apply:
#) for the main topic of the document or section. This should be used once per document for the main header.##) for subtopics or main sections within a major section. This level of header should organize content under the main header.###) for more detailed points or subsections under a secondary header. This header is useful for going deeper into specifics within a section.####) for even more granular details within a tertiary section. This header is rarely needed but can be useful in complex documentation.To efficiently present extensive and repetitive information about features, such as the properties of a component, use markdown tables. This format helps organize and display the data clearly and concisely.
Ensure all tables are left-aligned for consistency. This aids in readability and ensures that the content is easy to scan.
Example:
| <div style={{ width:"100px"}}> Variable </div> | <div style={{ width:"200px"}}> Description </div> | <div style={{width: "200px"}}> How To Access </div> |
|---|---|---|
| chartTitle | Holds the title of the chart component. | Accessible dynamically with JS (for e.g., {{components.chart1.chartTitle}}). |
| xAxisTitle | Contains the title for the X-axis of the chart. | Accessible dynamically with JS (for e.g., {{components.chart1.xAxisTitle}}). |
| yAxisTitle | Contains the title for the Y-axis of the chart. | Accessible dynamically with JS (for e.g., {{components.chart1.yAxisTitle}}). |
| clickedDataPoints | Stores details about the data points that were clicked. | Accessible dynamically with JS (for e.g., {{components.chart1.clickedDataPoints}}). Each data point includes xAxisLabel, yAxisLabel, dataLabel, dataValue, and dataPercent. |
Admonitions are blocks of content that are designed to draw attention to specific points in your documentation. Use them sparingly to avoid overwhelming the user. Reserve admonitions for critical or cautionary information only.
warning type admonitions for high-risk actions or irreversible changes. This type of admonition should alert users to potential dangers or critical issues.Example: :::warning Ensure you back up your data before upgrading to the latest version. :::
info type admonitions to offer useful hints or best practices. These are generally positive and provide additional value to the user.Example: :::info Preview the changes before pushing them. :::
Overuse can dilute their impact. Use italics instead of admonitions whenever possible to emphasize important information instead of admonitions. This is a less intrusive way to draw attention to key details.
Include images that closely align with real-world use cases. This makes the documentation more practical and relatable for the user.
create-get-query.jpeg. This helps maintain an organized file structure and makes it easier to locate specific images.WEBP or PNG formats for web images due to their balance between quality and file size.SVG for logos or icons to ensure scalability without loss of quality.Maintaining a clear and consistent tone throughout your documentation is crucial for effective communication. The goal is to be concise, informative, and user-friendly.
Use bullet points to break down steps or lists for clarity. This makes the content easier to scan and understand.
Use the below language guidelines to ensure clarity and consistency.
First-Letter-Capitalized. This follows the standard convention and makes the headers easier to distinguish.
Example:Content-Type: application/json
Authorization: Bearer <token>
cURL commands. This means including all necessary components like headers, body, and method. Example:curl -X POST https://api.example.com/resource \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{"key": "value"}'
;). While JavaScript can often infer semicolons, explicitly including them prevents potential issues, especially in complex code. Example:const name = 'John';
console.log(name);
const greeting = 'Hello, world!';
{
"name": "John Doe",
"age": 30,
"city": "New York"
}
&& for readability. For multi-line commands, use \ to break lines. Example:sudo apt-get update && \
sudo apt-get install -y curl
# to explain the command's purpose.
Example:# This command installs Node.js
sudo apt-get install -y nodejs
SELECT name, age, city
FROM users
WHERE age > 30
ORDER BY name ASC;
/schema/postgres/tables.mdx) instead of relative links to avoid broken links during file moves. This practice ensures that links remain functional even if files are moved within the directory structure. Example:[Postgres tables](/schema/postgres/tables.mdx) links to the Postgres tables page.
ToolJet supports [multiple environments,](https://docs.tooljet.com/docs/#multiple-environments) takes the user directly to the specific section.
MyVariable and myvariable are not the same."By following these guidelines, you can ensure that your documentation is clear, consistent, and easy to use for a wide range of audiences.