Skip to content

Commit cd7e145

Browse files
committed
Improve documentation structure
1 parent bd669ed commit cd7e145

24 files changed

+74
-74
lines changed

docs/ts-graphviz/11-advanced-usage/02-extending-ts-graphviz.md renamed to docs/ts-graphviz/03-guides/03-extending-ts-graphviz.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
description: How to extend ts-graphviz with custom classes.
2+
description: How to extend ts-graphviz for advanced use cases.
33
---
44
# Extending ts-graphviz
55

6-
`ts-graphviz` is designed to be extensible, allowing advanced users to customize and enhance the library's functionality to meet specific needs. This section covers how to extend the type system and create custom implementations.
6+
`ts-graphviz` is designed to be extensible, allowing intermediate users to customize and enhance the library's functionality to meet specific needs. This section covers how to extend the type system and create custom implementations.
77

88
## Creating Custom Classes
99

@@ -172,3 +172,49 @@ console.log(
172172
),
173173
);
174174
```
175+
176+
---
177+
178+
179+
## Internal Package Overview
180+
181+
For users interested in extending or customizing `ts-graphviz`, understanding the internal packages can be valuable. Below is an overview of the internal packages and how they can be used in advanced scenarios.
182+
183+
184+
### `@ts-graphviz/adapter`
185+
186+
**Purpose**: Provides interfaces to execute Graphviz commands and convert DOT language strings into various output formats.
187+
188+
**Usage**:
189+
190+
- Convert DOT strings to streams or files.
191+
- Use in environments where you need to render graphs to images or other formats.
192+
193+
### `@ts-graphviz/ast`
194+
195+
**Purpose**: Allows manipulation of the DOT language at the Abstract Syntax Tree (AST) level.
196+
197+
**Usage**:
198+
199+
- Parse DOT strings into AST nodes.
200+
- Manipulate and transform the AST programmatically.
201+
- Useful for advanced analysis or transformations of existing DOT code.
202+
203+
### `@ts-graphviz/common`
204+
205+
**Purpose**: Centralizes Graphviz domain knowledge, providing type definitions, constants, and utilities. It is designed to handle use cases such as extending types.
206+
207+
**Usage**:
208+
209+
- Extend or customize types and attributes.
210+
- Ensure type safety when working with custom attributes.
211+
- Aggregate domain knowledge of Graphviz for consistent usage across packages.
212+
213+
### `@ts-graphviz/core`
214+
215+
**Purpose**: Contains the core implementations of the models and functions provided to users.
216+
217+
**Usage**:
218+
219+
- Use object-oriented APIs for fine-grained control over graph elements.
220+
- Extend classes for custom behaviors or attributes.

docs/ts-graphviz/11-advanced-usage/03-using-ast.md renamed to docs/ts-graphviz/03-guides/04-using-ast.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ description: Manipulate DOT graphs at the AST level with @ts-graphviz/ast.
33
---
44
# Using Abstract Syntax Tree (AST)
55

6-
For advanced use cases, `@ts-graphviz/ast` provides an API to handle Abstract Syntax Trees (ASTs) of DOT language graphs.
6+
For advanced use cases, `ts-graphviz/ast` module provides an API to handle Abstract Syntax Trees (ASTs) of DOT language graphs.
77

88
## Available Functions
99

10-
1110
The following functions are provided:
1211

1312
- `fromModel`: Converts a **Model** to an **AST**.
@@ -27,7 +26,7 @@ The `toDot` function provided by the `ts-graphviz` package is a composition of `
2726

2827

2928
```typescript
30-
import { parse } from '@ts-graphviz/ast';
29+
import { parse } from 'ts-graphviz/ast';
3130

3231
const ast = parse(`
3332
digraph example {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"label": "Guides",
3+
"link": {
4+
"type": "generated-index",
5+
"description": "Guides to help you understand ts-graphviz."
6+
}
7+
}

docs/ts-graphviz/04-intermediate-topics/_category_.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/ts-graphviz/12-architecture-and-design-principles/01-design-principles.md renamed to docs/ts-graphviz/11-advanced-topics/01-design-principles.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
description: Design principles of ts-graphviz.
3+
---
14
# Design Principles
25

36
**ts-graphviz** is built around several key concepts that make it modular, extensible, and easy to use:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
description: Package architecture of ts-graphviz.
3+
---
14
# Package Architecture
25

36
**ts-graphviz** consists of several packages, each with a specific role:

docs/ts-graphviz/12-architecture-and-design-principles/03-versioning-policy.md renamed to docs/ts-graphviz/11-advanced-topics/03-versioning-policy.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
1+
---
2+
description: Versioning policy for ts-graphviz.
3+
---
24
# Versioning Policy
35

46
## Overview
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
description: Supported environments for ts-graphviz.
3+
---
14
# Supported Environments
25

36
To provide clarity on the environments in which **ts-graphviz** operates, we have categorized support levels:

docs/ts-graphviz/12-architecture-and-design-principles/05-security-policies.md renamed to docs/ts-graphviz/11-advanced-topics/05-security-policies.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
---
2+
description: Security policies for ts-graphviz.
3+
---
14
# Security Policies
25

36
## Purpose and Importance
47

5-
In today's software development landscape, **open-source software (OSS)** plays an indispensable role in building applications. According to the **Open Source Security Foundation (OpenSSF)**, **70% to 90%** of modern applications consist of OSS components, and the complexity of their dependencies is increasing daily.
8+
In today's software development landscape, **Open Source Software (OSS)** plays an indispensable role in building applications. According to the **Open Source Security Foundation (OpenSSF)**, **70% to 90%** of modern applications consist of OSS components, and the complexity of their dependencies is increasing daily.
69

710
### The Impact and Responsibility of ts-graphviz
811

Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
2-
"label": "Advanced Usage",
2+
"label": "Advanced Topics",
33
"link": {
44
"type": "generated-index",
55
"description": "Advanced topics to help you understand the inner workings of ts-graphviz."
66
}
77
}
8-

docs/ts-graphviz/11-advanced-usage/01-package-overview.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

docs/ts-graphviz/12-architecture-and-design-principles/00-overview.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/ts-graphviz/12-architecture-and-design-principles/_category_.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)