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

Release v0.5.0 #59

Merged
merged 1 commit into from
Nov 4, 2023
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
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