Skip to content

Commit 9cadff4

Browse files
[update] initialization guide + sidebar
1 parent 8580bbc commit 9cadff4

2 files changed

Lines changed: 35 additions & 47 deletions

File tree

docs/guides/initialization.md

Lines changed: 17 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,63 @@
11
---
22
sidebar_label: Initialization
33
title: Initialization
4-
description: This guide offers an explanation for initializing DHTMLX Rich Text Editor in three simple steps.
4+
description: You can learn about the initialization in the documentation of the DHTMLX JavaScript RichText library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX RichText.
55
---
66

77
# Initialization
88

9-
The current article will guide you through simple steps you need to take in order to insert a compact text editor into your application. All in all, you should complete just three steps:
9+
This guide will give you detailed instructions on how to create RichText on a page to enrich your application with features of the RichText editor. Take the following steps to get a ready-to-use component:
1010

1111
1. [Include the RichText source files on a page](#including-source-files).
1212
2. [Create a container for RichText](#creating-container).
1313
3. [Initialize RichText with the object constructor](#initializing-richtext).
1414

15-
~~~html
16-
<!DOCTYPE html>
17-
<html>
18-
<head>
19-
<title>How to Start with DHTMLX RichText</title>
20-
<script type="text/javascript" src="./codebase/richtext.js"></script>
21-
<link rel="stylesheet" href="./codebase/richtext.css">
22-
</head>
23-
<body>
24-
<div id="root"></div>
25-
<script>
26-
// creating DHTMLX RichText
27-
const editor = new richtext.Richtext("#root");
28-
</script>
29-
</body>
30-
</html>
31-
~~~
32-
3315
## Including source files
3416

3517
[Download the package](https://dhtmlx.com/docs/products/dhtmlxRichText/download.shtml) and unpack it into a folder of your project.
3618

37-
To create dhtmlxRichText, you need to include 2 source files on your page:
19+
To create RichText, you need to include 2 source files on your page:
3820

3921
- *richtext.js*
4022
- *richtext.css*
4123

42-
Make sure that you set correct relative paths to these files:
24+
Make sure that you set correct relative paths to the source files:
4325

4426
~~~html title="index.html"
4527
<script type="text/javascript" src="./codebase/richtext.js"></script>
4628
<link rel="stylesheet" href="./codebase/richtext.css">
4729
~~~
4830

49-
The structure of the RichText package is the following:
50-
51-
- **sources** - the source code files of the library; they are easy-to-read and are mostly intended for debugging;
52-
- **codebase** - the obfuscated code files of the library; they are much smaller and intended for use in production. **Include these files in your apps when they are ready**;
53-
- **samples** - the code samples.
54-
5531
## Creating container
5632

57-
Add a container for RichText and give it an id, for example "root":
33+
Add a container for RichText and give it an ID, for example *"root"*:
5834

59-
~~~html title="index.html"
35+
~~~jsx title="index.html"
6036
<div id="root"></div>
6137
~~~
6238

6339
## Initializing RichText
6440

65-
Initialize RichText with the `richtext.Richtext` object constructor. The constructor has two parameters:
41+
Initialize RichText with the `richtext.Richtext` constructor. The constructor takes two parameters:
6642

67-
- the HTML container for RichText. The one we have created at the previous step.
68-
- an object with configuration properties. [See the full list below](#configuration-properties).
43+
- an HTML container (the ID of the HTML container)
44+
- an object with configuration properties. [See the full list here](#configuration-properties)
6945

7046
~~~jsx title="index.html"
71-
// creating RichText
47+
// create RichText
7248
const editor = new richtext.Richtext("#root", {
7349
// configuration properties
7450
});
7551
~~~
7652

77-
### <span id="config">Configuration properties</span>
78-
79-
This is a list of properties that you can specify in the RichText configuration object:
53+
### Configuration properties
8054

81-
- [**mode**](guides/configuration.md#working-modes) - (string) the working mode of RichText. Can be either `default` or `document`
82-
- [**toolbarBlocks**](guides/configuration.md#toolbar) - (array) specifies blocks of buttons that will be shown in the RichText toolbar
83-
- [**customStats**](guides/configuration.md#custom-statistics-in-the-toolbar) - (array) defines the logic of displaying custom statistics
55+
:::note
56+
The full list of properties to configure **RichText** can be found [**here**](/category/richtext-properties/).
57+
:::
8458

85-
You can set configuration properties during initialization as the second parameter of the constructor:
59+
## Example
8660

87-
~~~jsx
88-
const editor = new richtext.Richtext("#root", {
89-
mode:"document"
90-
});
91-
~~~
61+
In this snippet you can see how to initialize **RichText** with the initial data:
9262

93-
**Related sample:** [Modes](https://snippet.dhtmlx.com/pdh5buvg)
63+
<iframe src="https://snippet.dhtmlx.com/tjryzka7?mode=js" frameborder="0" class="snippet_iframe" width="100%" height="500"></iframe>

sidebars.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,24 @@ module.exports = {
165165
}
166166
]
167167
},
168+
//start framework integration
169+
{
170+
type: "category",
171+
label: "Integration with frameworks",
172+
link: {
173+
type: "generated-index",
174+
title: "BIntegration with frameworks",
175+
keywords: ['frameworks integration'],
176+
image: "/img/docusaurus.png"
177+
},
178+
items: [
179+
"guides/integration_with_angular",
180+
"guides/integration_with_react",
181+
"guides/integration_with_vue",
182+
"guides/integration_with_svelte",
183+
]
184+
},
185+
// end framework integration
168186
{
169187
type: "category",
170188
label: "Guides",

0 commit comments

Comments
 (0)