Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
* master:
  doc: Add mindmap integration docs
  fix: Fetch depth
  fix: Fetch depth
  fix: Fetch depth
  fix: Add commit count to release preview
  fix: Add commit count to release preview
  chore: Add working directory
  fix: release-preview-publish.yml
  Fix #3799: Remove `type` from package.json
  • Loading branch information
sidharthv96 committed Dec 1, 2022
2 parents 650ee31 + e2a0c43 commit 4103300
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 8 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/release-preview-publish.yml
Expand Up @@ -10,22 +10,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
cache: pnpm
node-version: 18.x
- name: Install Yarn
run: npm i yarn --global

- name: Install Packages
run: |
pnpm install --frozen-lockfile
env:
CYPRESS_CACHE_FOLDER: .cache/Cypress

- name: Install Json
run: npm i json --global

- name: Install Packages
run: yarn install --frozen-lockfile

- name: Publish
working-directory: ./packages/mermaid
run: |
PREVIEW_VERSION=8
PREVIEW_VERSION=$(git log --oneline "origin/$GITHUB_REF_NAME" ^"origin/master" | wc -l)
VERSION=$(echo ${{github.ref}} | tail -c +20)-preview.$PREVIEW_VERSION
echo $VERSION
npm version --no-git-tag-version --allow-same-version $VERSION
Expand Down
4 changes: 4 additions & 0 deletions docs/intro/n00b-gettingStarted.md
Expand Up @@ -143,6 +143,10 @@ Rendering in Mermaid is initialized by `mermaid.initialize()` call. You can plac
| ----------- | --------------------------------- | ------- | ----------- |
| startOnLoad | Toggle for Rendering upon loading | Boolean | true, false |

### Adding external diagrams to mermaid

Please refer to the [Mindmap](./mindmap.md?id=integrating-with-your-librarywebsite) section for more information.

### Working Examples

**Here is a full working example of the mermaidAPI being called through the CDN:**
Expand Down
14 changes: 14 additions & 0 deletions docs/syntax/mindmap.md
Expand Up @@ -253,3 +253,17 @@ Root
B
C
```

## Integrating with your library/website.

Mindmap uses the experimental lazy loading & async rendering features which could change in the future.

```html
<script type="module">
import mermaid from 'https://unpkg.com/mermaid@9/dist/mermaid.esm.min.mjs';
import mindmap from 'https://unpkg.com/@mermaid-js/mermaid-mindmap@9/dist/mermaid-mindmap.esm.min.mjs';
await mermaid.registerExternalDiagrams([mindmap]);
</script>
```

You can also refer the implementation in the live editor [here](https://github.com/mermaid-js/mermaid-live-editor/blob/fcf53c98c25604c90a218104268c339be53035a6/src/lib/util/mermaid.ts) to see how the async loading is done.
3 changes: 1 addition & 2 deletions packages/mermaid/package.json
@@ -1,11 +1,10 @@
{
"name": "mermaid",
"version": "9.2.2",
"version": "9.2.3-rc.1",
"description": "Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
"main": "./dist/mermaid.min.js",
"module": "./dist/mermaid.core.mjs",
"types": "./dist/mermaid.d.ts",
"type": "commonjs",
"exports": {
".": {
"require": "./dist/mermaid.min.js",
Expand Down
4 changes: 4 additions & 0 deletions packages/mermaid/src/docs/intro/n00b-gettingStarted.md
Expand Up @@ -126,6 +126,10 @@ Rendering in Mermaid is initialized by `mermaid.initialize()` call. You can plac
| ----------- | --------------------------------- | ------- | ----------- |
| startOnLoad | Toggle for Rendering upon loading | Boolean | true, false |

### Adding external diagrams to mermaid

Please refer to the [Mindmap](./mindmap.md?id=integrating-with-your-librarywebsite) section for more information.

### Working Examples

**Here is a full working example of the mermaidAPI being called through the CDN:**
Expand Down
14 changes: 14 additions & 0 deletions packages/mermaid/src/docs/syntax/mindmap.md
Expand Up @@ -161,3 +161,17 @@ Root
B
C
```

## Integrating with your library/website.

Mindmap uses the experimental lazy loading & async rendering features which could change in the future.

```html
<script type="module">
import mermaid from '<CDN_URL>/mermaid@<MERMAID_VERSION>/dist/mermaid.esm.min.mjs';
import mindmap from '<CDN_URL>/@mermaid-js/mermaid-mindmap@<MERMAID_VERSION>/dist/mermaid-mindmap.esm.min.mjs';
await mermaid.registerExternalDiagrams([mindmap]);
</script>
```

You can also refer the implementation in the live editor [here](https://github.com/mermaid-js/mermaid-live-editor/blob/fcf53c98c25604c90a218104268c339be53035a6/src/lib/util/mermaid.ts) to see how the async loading is done.

0 comments on commit 4103300

Please sign in to comment.