---
title: "@design.estate/dees-editor"
---
# @design.estate/dees-editor
an advanced editor for markdown documents based on monaco.

## Install
To install `@design.estate/dees-editor`, you need to run the following command using npm or Yarn. Make sure you have Node.js installed on your system before you proceed.

```bash
npm install @design.estate/dees-editor
# or if you prefer Yarn
yarn add @design.estate/dees-editor
```

## Usage
This guide walks you through the usage of `@design.estate/dees-editor`, an advanced editor for markdown documents based on Monaco Editor. This editor not only allows for high customization but also enhances your markdown editing with the robust features of Monaco Editor.

### Integrating `@design.estate/dees-editor` in Your Project
First, ensure you have installed `@design.estate/dees-editor` as described in the installation section.

#### Setting Up Your Project
Create a TypeScript file (e.g. `app.ts`) and import necessary functionalities using ESM syntax:

```typescript
import { DeesEditor, DeesTerminal, DeesEditorMarkdown, DeesEditorMarkdownOutlet } from '@design.estate/dees-editor';
```

### Displaying the Markdown Editor
To display the markdown editor in your web application, you will need to incorporate it into your HTML structure. Typically, you can use custom element tags provided by the library. Here's a simple example:

#### HTML Structure
Add the following HTML structure to your application's main HTML file (e.g., `index.html`):

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Markdown Editor</title>
    <script type="module" src="./app.ts"></script>
</head>
<body>
    <dees-editor></dees-editor>
</body>
</html>
```

#### Initializing the Editor
Within your `app.ts` file, initialize the markdown editor with desired options:

```typescript
const editorElement = document.querySelector('dees-editor');
if (editorElement) {
    editorElement.language = 'markdown'; // Set the language to markdown
    editorElement.content = '# Markdown Editor\n\nStart typing your markdown content here...'; // Initial content
}
```

### Advanced Usage
`@design.estate/dees-editor` offers an advanced markdown editor that leverages the Monaco Editor. This means you can utilize Monaco's extensive API for further customization and functionality enhancement.

#### Configuring the Editor
The editor can be tailored to meet your needs, such as theming, read-only mode, and more. Explore Monaco's [`IStandaloneEditorConstructionOptions`](https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.IStandaloneEditorConstructionOptions.html) for all available configurations.

Example - Setting Dark Theme and Read-Only Mode:
```typescript
(async () => {
    const editorInstance = await editorElement.editorDeferred.promise; // Wait for the editor to initialize
    editorInstance.updateOptions({
        theme: 'vs-dark', // Set theme to dark
        readOnly: true // Make the editor read-only
    });
})();
```

#### Integrating Terminal Emulator
`@design.estate/dees-editor` also includes a powerful terminal emulator, `DeesTerminal`, which can be embedded alongside your editor:

```html
<dees-terminal></dees-terminal>
```

And in your TypeScript file:
```typescript
const terminalElement = document.querySelector('dees-terminal');
if (terminalElement) {
    // Initialize terminal with options or use it directly
}
```

#### Creating a Live Markdown Preview
`@design.estate/dees-editor` facilitates creating live markdown previews. Utilize `DeesEditorMarkdown` for binding the editor with a live preview outlet.

```html
<dees-editormarkdown></dees-editormarkdown>
```

This component divides the viewport into an editor pane and a live preview pane. As you type in the editor, the markdown content automatically renders in the live preview.

### Conclusion
`@design.estate/dees-editor` is a feature-rich markdown editor built on top of Monaco Editor, offering extensive customizability and advanced features such as a terminal emulator and live markdown preview. Its integration into your project is straightforward, whether embedding the editor directly into your webpage or leveraging its components for advanced functionality. The versatility of Monaco Editor ensures that your markdown documentation needs are met with efficiency and style.

## License and Legal Information

This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. 

**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.

### Trademarks

This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.

### Company Information

Task Venture Capital GmbH  
Registered at District court Bremen HRB 35230 HB, Germany

For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.

By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
