Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add formatting.md #1359

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0129733
Create formatting.md
starlightknown Feb 20, 2023
5e528a3
add: code blocks
starlightknown Feb 20, 2023
705b144
Update docs/community/styleguide/formatting.md
starlightknown Feb 20, 2023
0d6ec42
Update formatting.md
starlightknown Feb 20, 2023
e252a13
Merge branch 'master' into formatting
quetzalliwrites Feb 22, 2023
517dfc7
Merge branch 'master' into formatting
starlightknown Apr 25, 2023
6433bfd
Merge branch 'master' into formatting
starlightknown Jun 6, 2023
518a3ee
Merge branch 'master' into formatting
quetzalliwrites Jun 7, 2023
dfce213
Update docs/community/styleguide/formatting.md
starlightknown Jun 11, 2023
bd03ef2
Update docs/community/styleguide/formatting.md
starlightknown Jun 11, 2023
73c720d
Update docs/community/styleguide/formatting.md
starlightknown Jun 11, 2023
5c4f62a
Update formatting.md
starlightknown Jun 11, 2023
ba19e1e
Merge branch 'master' into formatting
starlightknown Jun 11, 2023
4f3aeb9
Update formatting.md
starlightknown Jun 11, 2023
95d4651
Merge branch 'master' into formatting
quetzalliwrites Jun 14, 2023
ad81a63
Merge branch 'master' into formatting
quetzalliwrites Jun 16, 2023
7401a66
grammar fixes
quetzalliwrites Jun 16, 2023
f65e34a
Merge branch 'master' into formatting
starlightknown Jul 11, 2023
dfa1ec7
Rename docs/community/styleguide/formatting.md to pages/docs/communit…
starlightknown Jul 11, 2023
ff80d1e
Update formatting.md
starlightknown Jul 11, 2023
77b7e71
Added _section.md for styleguide
akshatnema Jul 11, 2023
75d2447
Merge branch 'master' into formatting
starlightknown Jul 12, 2023
91d7f5c
Merge branch 'master' into formatting
starlightknown Aug 22, 2023
758580f
Merge branch 'master' into formatting
starlightknown Nov 27, 2023
0b89fe4
fix title
quetzalliwrites Nov 28, 2023
52d6653
Merge branch 'master' into formatting
quetzalliwrites Mar 7, 2024
8151476
Update formatting.md
starlightknown Mar 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pages/docs/community/styleguide/_section.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: 'Style Guide'
weight: 10
---
91 changes: 91 additions & 0 deletions pages/docs/community/styleguide/formatting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
title: Formatting
description: This guide illustrates the standards for formatting and writing our documentation.
weight: 11
quetzalliwrites marked this conversation as resolved.
Show resolved Hide resolved
---
## Documentation formatting

Documentation formatting refers to how the document appears on the page and how the content is organized, which includes font selection, font size and presentation (such as bold or italics), spacing, margins, alignment, columns, indentation, and lists. Formatting is crucial because it helps the reader perceive the information and makes it more accessible.

### Notes and warning blocks

Notes and warning blocks are used to draw attention to important information. Use the following markdown features when necessary:

- Use a clear and concise heading to introduce the note or warning.
- Use short paragraphs or bullet points to convey the information.
- Keep the language simple and direct.
- Use an `>` in markdown to indicate the nature of the note or warning.
- Use the following syntax to apply a style. Currently our documentation supports **Remember** `<Remember>`:
* Surround the text you want to style with an opening <Remember> tag and a closing </Remember> tag.
* Note that the word 'Remember' does not need to be included within the tags, as it automatically provides the necessary styling.
* Use the following syntax to apply a style:
` <Remember>
No need to add a prefix; the tag automatically provides one
</Remember>`

The output:
<Remember>
No need to add a prefix; the tag automatically provides one
</Remember>

## Code blocks

Code blocks are used to display code examples or snippets.

- In a Markdown document, use the `<CodeBlock>` tag and specify the language.
Use the following syntax to apply a code block:
```
<CodeBlock language="bash">
{`npm start`}
</CodeBlock>
```

The output:

<CodeBlock language="bash">
{`npm start`}
</CodeBlock>

- Use code style for filenames, directories, and paths. For example: Go to the `/docs/tutorials` directory.
- Choose a consistent number of spaces for indentation, such as 2 or 4 spaces, and use it consistently throughout the document.
- Indent the code properly to show the structure and hierarchy of the code. Each level of indentation should align with the appropriate scope.
- Avoid using tabs for indentation, as they may not render consistently across different platforms or text editors.
For example, when writing code in Markdown, use four spaces for each level of indentation:
```
function myFunction() {
if (condition) {
console.log("Condition is true.");
} else {
console.log("Condition is false.");
}
}
```
- Use single backticks to enclose inline code. For example, `asyncapi new --example=tutorial.yml --no-tty`
- Remove any trailing spaces in the code. Trailing spaces can disrupt the readability and formatting of the code, so ensure they are removed.
- Use triple backticks to enclose YAML code blocks. Specify the language as "yaml" within the backticks. This syntax is specifically for displaying code blocks that contain YAML content.
* Use this syntax:
` ```yaml
asyncapi: '2.5.0'
info:
title: Account Service
version: 1.0.0
``` `

* The output:
```yaml
asyncapi: '2.5.0'
info:
title: Account Service
version: 1.0.0
```
## Spacing

Line spacing, or the vertical space between lines of text in a paragraph, can aid or hinder reading. Adequate line spacing aids readers in navigating from the end of one line to the start of the next.

- Leave a blank line between paragraphs to visually separate them. This helps readers distinguish between different sections of content.
- For headings and subheadings, leave a single blank line before and after them to provide clear visual separation.
- Leave a single line spacing after bullet points or numbered lists to enhance readability.
- Use consistent indentation to show the hierarchy of the content.
- Indentation can be achieved with either 2 or 4 spaces, depending on your preference or the coding style guidelines of your project. Choose one and use it consistently throughout the document.
- Use indentation to show nested content, such as code blocks, lists, or paragraphs within a list item.
- Indent code blocks by an additional level of indentation to differentiate them from regular text.
Loading