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

Auto transform mermaid-example in docs. #3401

Merged
merged 41 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
cfae2b6
Doc transformer
sidharthv96 Sep 2, 2022
3b88150
Move docs to src
sidharthv96 Sep 3, 2022
bd14dc5
Build docs in lintstaged
sidharthv96 Sep 3, 2022
d01de85
Update doc test
sidharthv96 Sep 3, 2022
e34e208
Add auto generated docs
sidharthv96 Sep 3, 2022
9d5c50a
Update doc test
sidharthv96 Sep 3, 2022
0aabae4
Update doc test
sidharthv96 Sep 3, 2022
f45c0e3
Fail commit if docs changed
sidharthv96 Sep 3, 2022
b6d0d7f
Fail commit if docs changed
sidharthv96 Sep 3, 2022
cc38667
Add generated file to git
sidharthv96 Sep 3, 2022
017fdfa
Fail commit if docs changed
sidharthv96 Sep 3, 2022
c3da6c1
Add generated file to git
sidharthv96 Sep 3, 2022
829e1c2
Fix typo
sidharthv96 Sep 3, 2022
3833dcd
Add verification for doc change
sidharthv96 Sep 3, 2022
4225f5e
Turn off jsdoc warnings that were polluting logs
sidharthv96 Sep 3, 2022
13e7da1
Add doc verification to CI
sidharthv96 Sep 3, 2022
c2f7240
Test
sidharthv96 Sep 3, 2022
074f30e
Fix double rendering in docsify
sidharthv96 Sep 3, 2022
bdeefb2
Test
sidharthv96 Sep 3, 2022
0a30423
Fix Doc
sidharthv96 Sep 3, 2022
42a2cab
Remove "Edit this page"
sidharthv96 Sep 3, 2022
c702e12
Fix edit page url
sidharthv96 Sep 3, 2022
6167eda
Prettier
sidharthv96 Sep 3, 2022
1f7d8c0
Fix lint staged
sidharthv96 Sep 3, 2022
fe1be11
Fix lint staged
sidharthv96 Sep 3, 2022
787cf93
Prettier options
sidharthv96 Sep 3, 2022
661f283
Strict prettierrc
sidharthv96 Sep 3, 2022
f6d69b3
Prettier
sidharthv96 Sep 3, 2022
b84511b
Prettier
sidharthv96 Sep 3, 2022
c49c15a
Add dotfiles
sidharthv96 Sep 3, 2022
5674f8e
Prettier Pass
sidharthv96 Sep 3, 2022
0caf372
Fix configuration doc
sidharthv96 Sep 3, 2022
85dc16d
Add files only when running from lint-staged
sidharthv96 Sep 3, 2022
636017f
Add files only when running from lint-staged
sidharthv96 Sep 3, 2022
e718c5b
Fix doc
sidharthv96 Sep 3, 2022
22999e2
Merge branch 'develop' into sidv/docs
sidharthv96 Sep 4, 2022
f0c41a8
Fix lint issue
sidharthv96 Sep 4, 2022
537ce4f
Add change in `src/docs`
sidharthv96 Sep 4, 2022
a95f46f
Fix mermaid code formatting in html
sidharthv96 Sep 4, 2022
5e9db25
Merge branch 'develop' into sidv/docs
sidharthv96 Sep 5, 2022
5ae1bd9
Build docs
sidharthv96 Sep 5, 2022
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
4 changes: 4 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
"jsdoc/multiline-blocks": "off",
"jsdoc/newline-after-description": "off",
"jsdoc/tag-lines": "off",
"jsdoc/require-param-description": "off",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns": "off",
"jsdoc/require-returns-description": "off",
"cypress/no-async-tests": "off",
"json/*": ["error", "allowComments"],
"no-empty": ["error", { "allowEmptyCatch": true }]
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ jobs:

- name: Run Linting
run: yarn lint

- name: Verify Docs
run: yarn docs:verify
1 change: 1 addition & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"src/docs/**": ["yarn docs:build --git"],
"*.{ts,js,json,html,md}": ["eslint --fix", "prettier --write"]
}
6 changes: 4 additions & 2 deletions docs/8.6.0_docs.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs.

# Version 8.6.0 Changes

## [New Mermaid Live-Editor Beta](https://mermaid-js.github.io/docs/mermaid-live-editor-beta/#/edit/eyJjb2RlIjoiJSV7aW5pdDoge1widGhlbWVcIjogXCJmb3Jlc3RcIiwgXCJsb2dMZXZlbFwiOiAxIH19JSVcbmdyYXBoIFREXG4gIEFbQ2hyaXN0bWFzXSAtLT58R2V0IG1vbmV5fCBCKEdvIHNob3BwaW5nKVxuICBCIC0tPiBDe0xldCBtZSB0aGlua31cbiAgQyAtLT58T25lfCBEW0xhcHRvcF1cbiAgQyAtLT58VHdvfCBFW2lQaG9uZV1cbiAgQyAtLT58VGhyZWV8IEZbZmE6ZmEtY2FyIENhcl1cblx0XHQiLCJtZXJtYWlkIjp7InRoZW1lIjoiZGFyayJ9fQ)
Expand Down Expand Up @@ -36,9 +38,9 @@ The modifiable parts of the Configuration are limited by the secure array, which
# Secure Arrays

Site owners can add to the **secure** array using this command:
mermaidAPI.initialize( { startOnLoad: true, secure: ['parameter1', 'parameter2'] } );
mermaidAPI.initialize( { startOnLoad: true, secure: \['parameter1', 'parameter2'] } );

Default values for the `secure array` consists of: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']. These default values are immutable.
Default values for the `secure array` consists of: \['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']. These default values are immutable.

Implementors can only modify configurations using directives, and cannot change the `secure` array.

Expand Down
1,070 changes: 536 additions & 534 deletions docs/CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion docs/Configuration.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs.

# Configuration

Configuration is the second half of Mermaid, after deployment. Together Deployment and Configuration constitute the whole of Mermaid.
Expand All @@ -11,7 +13,7 @@ The Following are the most commonly used methods, and are all tied to Mermaid [D

## [Directives](./directives.md),

allows the limited reconfiguration of a diagram just before it is rendered. It can alter the font style, color and other aesthetic aspects of the diagram. you can pass a directive alongside your definition inside `%%{ }%%`, either above or below your diagram definition.
Directives allows limited reconfiguration of a diagram just before it is rendered. It can alter the font style, color and other aesthetic aspects of the diagram. You can pass a directive alongside your definition inside `%%{ }%%`, either above or below your diagram definition.

## Theme Creation:

Expand Down
36 changes: 23 additions & 13 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs.

# About Mermaid

**Mermaid lets you create diagrams and visualizations using text and code.**
Expand All @@ -8,8 +10,6 @@ It is a JavaScript based diagramming and charting tool that renders Markdown-ins

<img src="img/header.png" alt="" />

<!-- **Edit this Page** [![N|Solid](img/GitHub-Mark-32px.png)](https://github.com/mermaid-js/mermaid/blob/develop/docs/README.md) -->

[![Build Status](https://travis-ci.org/mermaid-js/mermaid.svg?branch=master)](https://travis-ci.org/mermaid-js/mermaid) [![NPM](https://img.shields.io/npm/v/mermaid)](https://www.npmjs.com/package/mermaid) [![Coverage Status](https://coveralls.io/repos/github/mermaid-js/mermaid/badge.svg?branch=master)](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [![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)

<!-- Mermaid book banner -->
Expand All @@ -24,8 +24,7 @@ Mermaid is a JavaScript based diagramming and charting tool that uses Markdown-i

Diagramming and documentation costs precious developer time and gets outdated quickly.
But not having diagrams or docs ruins productivity and hurts organizational learning.<br/>
Mermaid addresses this problem by enabling users to create easily modifiable diagrams, it can also be made part of production scripts (and other pieces of code).<br/>
<br/>
Mermaid addresses this problem by enabling users to create easily modifiable diagrams, it can also be made part of production scripts (and other pieces of code).<br/> <br/>
Mermaid allows even non-programmers to easily create detailed and diagrams through the [Mermaid Live Editor](https://mermaid.live/).<br/>
[Tutorials](./Tutorials.md) has video tutorials.
Use Mermaid with your favorite applications, check out the list of [Integrations and Usages of Mermaid](./integrations.md).
Expand Down Expand Up @@ -131,6 +130,19 @@ Class08 <--> C2: Cool label
commit
```

```mermaid
gitGraph
commit
commit
branch develop
commit
commit
commit
checkout main
commit
commit
```

### [Entity Relationship Diagram - :exclamation: experimental](./entityRelationshipDiagram.md)

```mmd
Expand Down Expand Up @@ -167,25 +179,23 @@ journey

### CDN

```
https://unpkg.com/mermaid@<version>/dist/
```
https://unpkg.com/mermaid@<version>/dist/

To select a version:

Replace `<version>` with the desired version number.

Latest Version: [https://unpkg.com/browse/mermaid@8.8.0/](https://unpkg.com/browse/mermaid@8.8.0/)
Latest Version: <https://unpkg.com/browse/mermaid@8.8.0/>

## Deploying Mermaid

To Deploy Mermaid:

1. You will need to install node v16, which would have npm
2. Download yarn using npm
3. Enter the following command: `yarn add mermaid`
4. You can then add mermaid as a dev dependency using this command:
`yarn add --dev mermaid`
1. You will need to install node v16, which would have npm
2. Download yarn using npm
3. Enter the following command: `yarn add mermaid`
4. You can then add mermaid as a dev dependency using this command:
`yarn add --dev mermaid`

### [Mermaid API](./Setup.md):

Expand Down
2 changes: 2 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs.

# Summary

- [mermaid](README.md)
Expand Down
10 changes: 6 additions & 4 deletions docs/Setup.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs.

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## mermaidAPI
Expand Down Expand Up @@ -58,9 +60,9 @@ Theme , the CSS style sheet

## logLevel

| Parameter | Description | Type | Required | Values |
| --------- | ----------------------------------------------------- | ---------------- | -------- | --------------------------------------------- |
| logLevel | This option decides the amount of logging to be used. | string \| number | Required | 'trace','debug','info','warn','error','fatal' |
| Parameter | Description | Type | Required | Values |
| --------- | ----------------------------------------------------- | ------ | -------- | -------- | --------------------------------------------- |
| logLevel | This option decides the amount of logging to be used. | string | number | Required | 'trace','debug','info','warn','error','fatal' |

**Notes:**

Expand Down Expand Up @@ -116,7 +118,7 @@ overriding a site's default security.

**Notes**:

Default value: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
Default value: \['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']

## deterministicIds

Expand Down
2 changes: 2 additions & 0 deletions docs/Tutorials.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs.

# Tutorials

This is list of publicly available Tutorials for using Mermaid.JS . This is intended as a basic introduction for the use of the Live Editor for generating diagrams, and deploying Mermaid.JS through HTML.
Expand Down
2 changes: 2 additions & 0 deletions docs/_navbar.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs.

- Getting started

- [Quick start](quickstart.md)
Expand Down
2 changes: 2 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs.

- 📔 Introduction

- [About Mermaid](README.md)
Expand Down
Loading