Quill, a rich text editor for web browsers, powers the content creation for a wide range of applications. When integrated with NGINX, it becomes Ngx Quill, a powerful solution for dynamic, interactive text editing. Understanding the Ngx Quill format, how it structures data, and how to manipulate it is crucial for effectively using these tools.

Quill comes with its own data format, which it uses to represent text content. This format, known as Delta, is a series of operations that modify a base string. Understanding Delta format is key to working with Quill, as it's the language used to represent content in your application's database or backend service.

Delta Format Basics
Delta format is built around the concept of operations. Each operation is represented by a JSON object, which describes the insertion or deletion of a text fragment. An operation can also carry additional metadata, like formatting changes or inline elements.

A Delta format document is simply an array of these operations, applied in order to a base string. Here's a basic example:
[
{ "insert": "Hello" },
{ "attributes": { "bold": true }, "insert": " world" }
]
This Delta document, when applied to an empty string, results in: "Hello world", with "world" in bold.

Delta Operations
insert: The core operation, insert adds text to the document. It can be used alone to add new text or with other attributes.
delete: Used to remove a section of text from the document. It can also carry operations, allowing for more complex deletions.

Attributes and Formatting
Delta format supports a wide range of formatting changes, represented by attributes. These include text attributes like color, size, and style, as well as inline elements like images or links.
Attributes are applied to text by including them in an "attributes" object within an operation. Here's an example that inserts bold, red text with a blue link:

[
{
"attributes": { "bold": true, "color": "#FF0000" },
"insert": "This text is bold and red"
},
{
"attributes": { "link": "https://nginx.org" },
"insert": " and this is a link"
}
]
Working with Ngx Quill and Delta Format
Ngx Quill, being a wrapper for Quill, also uses Delta format. Therefore, understanding Delta is crucial for working with Ngx Quill. You can use Ngx Quill's API to convert text into Delta format and vice versa.







Here's a simple example using Ngx Quill to get Delta format:
this.ngQuill.getModule('format').setLength(0); // Reset formatting
const delta = this.ngQuill.get Delta(); // Get Delta format
Remember, Delta format is powerful and flexible, but it can also be complex. Mastering Delta is a key step in harnessing the full power of Quill and Ngx Quill in your applications. Now that you understand the basics, you're ready to dive deeper into working with Delta format for your specific use cases.