mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-03 20:34:20 +01:00 
			
		
		
		
	Remove CJS builds from docs
This commit is contained in:
		@@ -118,7 +118,7 @@ b. The importing of mermaid library through the `mermaid.esm.js` or `mermaid.esm
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
**Notes**:
 | 
			
		||||
Rendering in Mermaid is initialized by `mermaid.initialize()` call. You can place `mermaid.initialize()` inside `mermaid.min.js` for brevity. However, doing the opposite lets you control when it starts looking for `<div>`tags inside the web page with `mermaid.initialize()`. This is useful when you think that not all `<div>` tags may have loaded on the execution of `mermaid.min.js` file.
 | 
			
		||||
Rendering in Mermaid is initialized by `mermaid.initialize()` call. You can place `mermaid.initialize()` inside `mermaid.esm.min.mjs` for brevity. However, doing the opposite lets you control when it starts looking for `<div>`tags inside the web page with `mermaid.initialize()`. This is useful when you think that not all `<div>` tags may have loaded on the execution of `mermaid.esm.min.mjs` file.
 | 
			
		||||
 | 
			
		||||
`startOnLoad` is one of the parameters that can be defined by `mermaid.initialize()`
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -170,7 +170,7 @@ You can still use the pre 9.4.0 method to add mermaid with mindmaps to a web pag
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
<script type="module">
 | 
			
		||||
  import mermaid from '<CDN_URL>/mermaid@<MERMAID_VERSION>/dist/mermaid.esm.min.mjs';
 | 
			
		||||
  import mermaid from '<CDN_URL>/mermaid@9.3.0/dist/mermaid.esm.min.mjs';
 | 
			
		||||
  import mindmap from '<CDN_URL>/@mermaid-js/mermaid-mindmap@9.3.0/dist/mermaid-mindmap.esm.min.mjs';
 | 
			
		||||
  await mermaid.registerExternalDiagrams([mindmap]);
 | 
			
		||||
</script>
 | 
			
		||||
@@ -184,12 +184,6 @@ From version 9.4.0 you can simplify this code to:
 | 
			
		||||
</script>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
or if you prefer not using the ESM package:
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
<script src="<CDN_URL>/mermaid@<MERMAID_VERSION>/dist/mermaid.min.js"></script>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Note that more complex integrations that use the **render** function directly need to use the **renderAsync** method instead in order to render mind maps.
 | 
			
		||||
 | 
			
		||||
You can also refer the implementation in the live editor [here](https://github.com/mermaid-js/mermaid-live-editor/blob/develop/src/lib/util/mermaid.ts) to see how the async loading is done.
 | 
			
		||||
 
 | 
			
		||||
@@ -298,7 +298,9 @@ Timeline uses experimental lazy loading & async rendering features which could c
 | 
			
		||||
You can use this method to add mermaid including the timeline diagram to a web page:
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
<script src="<CDN_URL>/mermaid@<MERMAID_VERSION>/dist/mermaid.min.js"></script>
 | 
			
		||||
<script type="module">
 | 
			
		||||
  import mermaid from '<CDN_URL>/mermaid@<MERMAID_VERSION>/dist/mermaid.esm.min.mjs';
 | 
			
		||||
</script>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Note that more complex integrations that the **render** function directly need to use the **renderAsync** method instead in order to render timeline.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user