@mermaid-js/mermaid-cli 9.2.2 → 9.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,20 +1,37 @@
1
1
  # mermaid-cli
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/@mermaid-js/mermaid-cli)](https://www.npmjs.com/package/@mermaid-js/mermaid-cli)
4
+ [![node-lts (scoped)](https://img.shields.io/node/v-lts/@mermaid-js/mermaid-cli)](https://www.npmjs.com/package/@mermaid-js/mermaid-cli)
5
+ [![Docker Image Version (latest semver)](https://img.shields.io/docker/v/minlag/mermaid-cli?label=Dockerhub)](https://hub.docker.com/r/minlag/mermaid-cli)
6
+ [![Build, test and deploy mermaid-cli Docker image](https://github.com/mermaid-js/mermaid-cli/actions/workflows/compile-mermaid.yml/badge.svg)](https://github.com/mermaid-js/mermaid-cli/actions/workflows/compile-mermaid.yml)
7
+ [![This project is using Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/Mermaid/mermaid-cli)
8
+ [![Join our Slack!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=slack&label=slack)](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
9
+
3
10
  This is a command-line interface (CLI) for [mermaid](https://mermaid-js.github.io/). It takes a mermaid definition file as input and generates an svg/png/pdf file as output.
4
11
 
5
- [![Join our Slack!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=slack&label=slack)](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) [![This project is using Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/Mermaid/mermaid-cli) ![Build, test and deploy](https://github.com/mermaid-js/mermaid-cli/workflows/Build,%20test%20and%20deploy%20mermaid-cli%20Docker%20image/badge.svg)
12
+ ## Installation
6
13
 
7
- ## Example Usage
14
+ ```sh
15
+ npm install -g @mermaid-js/mermaid-cli
16
+ ```
8
17
 
9
- Locate how to call the mmdc executable for your preferred method i.e. Docker,
10
- Yarn, NPM, global install, etc. Try these examples to get started quickly.
18
+ ## Usage
11
19
 
12
- ### Convert Mermaid mmd Diagram File To SVG
20
+ Convert Mermaid mmd Diagram File To SVG
13
21
 
14
22
  ```sh
15
23
  mmdc -i input.mmd -o output.svg
16
24
  ```
17
25
 
26
+ > **Note**
27
+ >
28
+ > See [Alternative installations](#alternative-installations) if you don't want to install the package globally.
29
+ >
30
+ > Locate how to call the mmdc executable for your preferred method
31
+ > i.e. Docker, Yarn, NPM, local install, etc.
32
+
33
+ ## Examples
34
+
18
35
  ### Create A PNG With A Dark Theme And Transparent Background
19
36
 
20
37
  ```sh
@@ -104,6 +121,8 @@ EOF
104
121
  mmdc -h
105
122
  ```
106
123
 
124
+ # Alternative installations
125
+
107
126
  ## Use Docker:
108
127
 
109
128
  ```sh
@@ -112,7 +131,7 @@ docker pull minlag/mermaid-cli
112
131
 
113
132
  or pull from Github Container Registry
114
133
 
115
- ```sh
134
+ ```sh
116
135
  docker pull ghcr.io/mermaid-js/mermaid-cli/mermaid-cli
117
136
  ```
118
137
 
@@ -127,7 +146,7 @@ diagram defined on your system in `/path/to/diagrams/diagram.mmd`, you can use
127
146
  the container to generate an SVG file as follows:
128
147
 
129
148
  ```sh
130
- docker run -it -v /path/to/diagrams:/data minlag/mermaid-cli -i /data/diagram.mmd
149
+ docker run --rm -u `id -u`:`id -g` -v /path/to/diagrams:/data minlag/mermaid-cli -i /data/diagram.mmd
131
150
  ```
132
151
 
133
152
  ## Use Node.JS API
@@ -161,21 +180,6 @@ npm install @mermaid-js/mermaid-cli
161
180
  ./node_modules/.bin/mmdc -h
162
181
  ```
163
182
 
164
- ## Install globally
165
-
166
- ❗️ We do **NOT** recommend installing it globally because both YARN and NPM
167
- could fail to install a command-line tool globally properly due to weird
168
- permission issues.
169
- `yarn global add @mermaid-js/mermaid-cli` or `npm install -g @mermaid-js/mermaid-cli`
170
-
171
- ## Install with [brew](https://brew.sh)
172
- This method of installation is no longer supported.
173
- For more details, see the [discussion](https://github.com/mermaid-js/mermaid-cli/issues/288).
174
- An old version of mermaid-cli can be installed with brew.
175
- ```
176
- brew install mermaid-cli
177
- ```
178
-
179
183
  ### Run with npx
180
184
 
181
185
  [`npx`](https://www.npmjs.com/package/npx) is installed by default with NPM. It
@@ -183,6 +187,19 @@ downloads and runs commands at the same time. To use Mermaid CLI with npx, you
183
187
  need to use the `-p` flag because the package name is different than the command
184
188
  it installs (`mmdc`). `npx -p @mermaid-js/mermaid-cli mmdc -h`
185
189
 
190
+
191
+ ## Install with [brew](https://brew.sh)
192
+
193
+ > **Warning**
194
+ >
195
+ > This method of installation is no longer supported.
196
+ > For more details, see the [discussion](https://github.com/mermaid-js/mermaid-cli/issues/288).
197
+ > An old version of mermaid-cli can be installed with brew.
198
+ > ```sh
199
+ > brew install mermaid-cli
200
+ > ```
201
+
202
+
186
203
  ## Known issues
187
204
 
188
205
  1. [Linux sandbox issue](docs/linux-sandbox-issue.md)