Skip to content

How to Write Text Documents


Text documents are written in Markdown format. Markdown is a lightweight markup language with simple and clear syntax, easy to learn and use, making it very suitable for writing various types of documents. This article will introduce how to use Markdown for document writing through specific examples.

Headings

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

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

The effect is as follows:

Text

Markdown supports various text styles, including bold, italic, strikethrough, and underline, and these styles can be used in combination.

*Italic text*
**Bold text**
***Bold and italic text***
~~Strikethrough text~~ 
~~**Bold and strikethrough text**~~ 
~~*Italic and strikethrough text*~~ 
<u>Underlined text</u>

The effect is as follows:

Dividers

A divider can be created by entering three or more asterisks *** or hyphens ---.

***
---

The effect is as follows:

Code

Use backticks ``` to mark code. Single-line code is wrapped with a single backtick, while multi-line code blocks are wrapped with three backticks.

Single-line code: printf("Hello, World!");

Multi-line code block:

// 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 effect is as follows:

Tables

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

|Default format  | Left-aligned | Centered | Right-aligned |
| --- | :--- | :---: | ---: |
| Table content  | Table content | Table content | Table content |
| Table content  | Table content | Table content | Table content |

The effect is as follows:

Hyperlinks can be added using the format [description text](link address), and the raw URL can be displayed directly using <link address>.

Visit [TrueWatch](https://console.truewatch.com/) for more information.

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

Images

Images can be inserted into the document using the syntax ![alt text](image link).

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