Skip to content

Commit

Permalink
Release v0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav committed Nov 4, 2023
1 parent 7bedfa2 commit 963e2de
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 26 deletions.
3 changes: 0 additions & 3 deletions .changes/unreleased/Added-20231103-215333.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions .changes/unreleased/Added-20231103-215358.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions .changes/unreleased/Added-20231103-215444.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions .changes/unreleased/Changed-20231103-214954.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions .changes/unreleased/Changed-20231103-215008.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions .changes/unreleased/Changed-20231103-215025.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions .changes/unreleased/Changed-20231103-215101.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions .changes/unreleased/Removed-20231103-215308.yaml

This file was deleted.

50 changes: 50 additions & 0 deletions .changes/v0.5.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
## v0.5.0 - 2023-11-03

This release brings support for rendering diagrams server-side
without the need for the MermaidJS CLI.

You can use this functionality by installing a `mermaidcdp.Compiler`
into your `mermaid.Extender` or `mermaid.ServerRenderer`.
For example:

```go
import "go.abhg.dev/goldmark/mermaid/mermaidcdp"

compiler, err := mermaidcdp.New(&mermaidcdp.Config{
JSSource: mermaidJSSource, // contents of mermaid.min.js
})
if err != nil {
return err
}
defer compiler.Close()

md := goldmark.New(
goldmark.WithExtensions(
// ...
&mermaid.Extender{
Compiler: compiler,
},
),
// ...
)
```

Use of mermaidcdp is highly recommended for server-side rendering
if you have lots of diagrams or documents to render.
This should be substantially faster than invoking the `mmdc` CLI.

### Breaking changes
- ServerRenderer: Delete `MMDC` and `Theme` fields.
If you need these, you can provide them with the `CLICompiler` instead.
- `CLI` and `MMDC` were flipped.
The old `MMDC` interface is now named `CLI`, and it now accepts a context.
You can use the new `MMDC` function to build an instance of it.
- ClientRenderer, Extender: Rename `MermaidJS` to `MermaidURL`.
- Rename `DefaultMMDC` to `DefaultCLI`.
- Extender: Replace `MMDC` field with the `CLI` field.

### Added
- ServerRenderer now supports pluggable `Compiler`s.
- Add `CLICompiler` to render diagrams by invoking MermaidJS CLI. Plugs into ServerRenderer.
- Add mermaidcdp subpackage to render diagrams with a long-running Chromium-based process.
Plugs into ServerRenderer.
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,57 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).

## v0.5.0 - 2023-11-03

This release brings support for rendering diagrams server-side
without the need for the MermaidJS CLI.

You can use this functionality by installing a `mermaidcdp.Compiler`
into your `mermaid.Extender` or `mermaid.ServerRenderer`.
For example:

```go
import "go.abhg.dev/goldmark/mermaid/mermaidcdp"

compiler, err := mermaidcdp.New(&mermaidcdp.Config{
JSSource: mermaidJSSource, // contents of mermaid.min.js
})
if err != nil {
return err
}
defer compiler.Close()

md := goldmark.New(
goldmark.WithExtensions(
// ...
&mermaid.Extender{
Compiler: compiler,
},
),
// ...
)
```

Use of mermaidcdp is highly recommended for server-side rendering
if you have lots of diagrams or documents to render.
This should be substantially faster than invoking the `mmdc` CLI.

### Breaking changes
- ServerRenderer: Delete `MMDC` and `Theme` fields.
If you need these, you can provide them with the `CLICompiler` instead.
- `CLI` and `MMDC` were flipped.
The old `MMDC` interface is now named `CLI`, and it now accepts a context.
You can use the new `MMDC` function to build an instance of it.
- ClientRenderer, Extender: Rename `MermaidJS` to `MermaidURL`.
- Rename `DefaultMMDC` to `DefaultCLI`.
- Extender: Replace `MMDC` field with the `CLI` field.

### Added
- ServerRenderer now supports pluggable `Compiler`s.
- Add `CLICompiler` to render diagrams by invoking MermaidJS CLI. Plugs into ServerRenderer.
- Add mermaidcdp subpackage to render diagrams with a long-running Chromium-based process.
Plugs into ServerRenderer.

## v0.4.0 - 2023-03-24
### Changed
- ClientRenderer: Use `<pre>` instead of `<div>` for diagram containers.
Expand Down

0 comments on commit 963e2de

Please sign in to comment.