Skip to content

How to Write Text Documents


Text documents are written in Markdown format. Markdown is a lightweight markup language with concise and clear syntax that is easy to learn and use, making it well-suited for writing various types of documents. This article uses concrete examples to introduce how to write documents with Markdown.

Headings

Markdown supports six levels of headings, indicated by adding 1 to 6 # characters at the beginning of a line.

# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6

The result is as follows:

Text

Markdown supports multiple text styles, including bold, italic, strikethrough, and underline, and these styles can be combined.

*Italic text*
**Bold text**
***Bold italic text***
~~Deleted text~~ 
~~**Bold deleted text**~~ 
~~*Italic deleted text*~~ 
<u>Underlined text</u>

The result is as follows:

Divider

You can create a horizontal rule by entering three or more asterisks *** or hyphens --- in a row.

***
---

The result is as follows:

Code

Backticks ``` can be used to mark code. Wrap inline code with a single backtick, and wrap multi-line code blocks with three backticks.

Inline code: printf("Hello, World!");

Multi-line code blocks:

// C code example
#include <stdio.h>
int main() {
    printf("Hello, World!");
    return 0;
}
// Java code example
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
# Python code example
print("Hello, World!")

The result is as follows:

Tables

Tables use vertical bars | to separate columns, hyphens - to define the separator line between the header and the table content, and colons : to set alignment.

| Default Format | Left Align | Center | Right Align |
| --- | :--- | :---: | ---: |
| Table content | Table content | Table content | Table content |
| Table content | Table content | Table content | Table content |

The result is as follows:

Hyperlinks can be added using the format [description text](link address). You can also use <link address> to display the raw URL directly.

Visit [Guance](https://console.guance.com/) for more information.

Or open directly: <https://console.guance.com/>

Images

Use the syntax ![alt text](image link) to insert an image into a document.

![avatar](https://static.guance.com/dataflux-icon/official/community-code.png" width="60%" >

Feedback

Is this page helpful?