Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Rephrase documentation and add colors to code snippets #45

Merged
merged 1 commit into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,9 @@ You have to ways to configure _Doctrine Diagram Bundle_.
1. Using configuration file
2. Using command's options

### Configuration file
!!! Note

Configuration file is located at `config/packages/doctrine_diagram.yaml`, this
is a full configuration example:

```yaml
doctrine_diagram:
size: midi
filename: database
format: svg
server: 'http://www.plantuml.com/plantuml'
theme: _none_
connection: ~
exclude:
- table1
- table2
```
Command line configuration will always have precedence over configuration file.

### Command's options

Expand All @@ -43,3 +29,21 @@ Options:
--theme=THEME Change diagram colors and style.
--exclude=EXCLUDE Comma separated list of tables to exclude from diagram.
```

### Configuration file

Configuration file is located at `config/packages/doctrine_diagram.yaml`, this
is a full configuration example:

```yaml
doctrine_diagram:
size: midi
filename: database
format: svg
server: 'http://www.plantuml.com/plantuml'
theme: _none_
connection: ~
exclude:
- table1
- table2
```
23 changes: 17 additions & 6 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
## Create an ER diagram

To generate an ER diagram from your current Doctrine database, use the following command:
To generate an ER diagram from your current Doctrine database, use the following
command:

```console
bin/console doctrine:diagram
```

If you are using the default configuration, a file named `database.png` will be created at the root of your project.
If you are using the default configuration, a file named `database.png` will be
created at the root of your project.

## Change the diagram format

Expand All @@ -26,7 +28,8 @@ doctrine_diagram:
format: png
```

If you encounter difficulties generating your diagram, use the puml format as it doesn't require a PlantUML server to function.
If you encounter difficulties generating your diagram, use the puml format as it
doesn't require a PlantUML server to function.

## Set diagram size

Expand All @@ -52,7 +55,9 @@ doctrine_diagram:

## Specify ER diagram name

By default, the diagram filename is `database`, and the file extension is added automatically based on the chosen format. Modify the filename on-the-fly with the `--filename` option:
By default, the diagram filename is `database`, and the file extension is added
automatically based on the chosen format. Modify the filename on-the-fly with
the `--filename` option:

```console
bin/console doctrine:diagram --filename=my-database
Expand All @@ -66,9 +71,14 @@ doctrine_diagram:
filename: my-database
```

!!! TIP

You don't need to explicitly set filename extension, it's autmatically added according to selected diagram format.

## Output redirection

To redirect the diagram output to a file or another program, set `php://output` as the filename. For example:
To redirect the diagram output to a file or another program, set `php://output`
as the filename. For example:

```console
bin/console doctrine:diagram --filename="php://stdout" --format=puml | tee example.puml
Expand Down Expand Up @@ -114,7 +124,8 @@ doctrine_diagram:

## Specify the Doctrine connection

If a connection is not specified, the `default` connection is used. Use the `--connection` option to declare an alternative connection:
If a connection is not specified, the `default` connection is used. Use
the `--connection` option to declare an alternative connection:

```console
bin/console doctrine:diagram --connection=default
Expand Down
11 changes: 10 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
site_name: !ENV [ SITE_NAME, 'Doctrine Diagram Bundle - dev' ]
theme: material
copyright: © 2024 Jawira Portugal
copyright: © 2023-2024 Jawira Portugal
site_author: Jawira Portugal
strict: true
use_directory_urls: false
Expand All @@ -10,3 +10,12 @@ nav:
- 'configuration.md'
- 'usage.md'
- 'themes.md'
markdown_extensions:
- admonition
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
Loading