Skip to content

Commit

Permalink
chore: add mermaid support
Browse files Browse the repository at this point in the history
  • Loading branch information
tianyingchun committed Aug 22, 2024
1 parent d4c2be5 commit cfe7ab8
Show file tree
Hide file tree
Showing 6 changed files with 1,113 additions and 258 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

Before you begin, make sure you have the following installed:

- Node.js (recommended version 16.x or higher)
- npm (comes with Node.js)
* Node.js (recommended version 16.x or higher)

Check failure on line 38 in README.md

View workflow job for this annotation

GitHub Actions / test (18.x)

Replace `*` with `-`
* npm (comes with Node.js)

Check failure on line 39 in README.md

View workflow job for this annotation

GitHub Actions / test (18.x)

Replace `*` with `-`

## Installation

Expand All @@ -50,8 +50,8 @@ yarn add @hyperse/track

## Development

> [!IMPORTANT]
> The following instructions are for those who want to develop the hyperse related framework or plugins (e.g. if you intend to make a pull request). For instructions on how to build a project _using_ Hyperse, please see the [Getting Started guide](https://hyperse-io.github.io/docusaurus-mono-starter/docs/community/contributing).
> \[!IMPORTANT]
> The following instructions are for those who want to develop the hyperse related framework or plugins (e.g. if you intend to make a pull request). For instructions on how to build a project *using* Hyperse, please see the [Getting Started guide](https://hyperse-io.github.io/docusaurus-mono-starter/docs/community/contributing).

Check failure on line 54 in README.md

View workflow job for this annotation

GitHub Actions / test (18.x)

Replace `*using*` with `_using_`
### 1. Clone project to the local directory

Expand All @@ -73,9 +73,9 @@ npm install

The root directory has a `package.json` which contains build-related dependencies for tasks including:

- Building & deploying the docs
- Project for online presentation
- Linting, formatting & testing tasks to run on git commit & push
* Building & deploying the docs

Check failure on line 76 in README.md

View workflow job for this annotation

GitHub Actions / test (18.x)

Replace `*` with `-`
* Project for online presentation

Check failure on line 77 in README.md

View workflow job for this annotation

GitHub Actions / test (18.x)

Replace `*` with `-`
* Linting, formatting & testing tasks to run on git commit & push

Check failure on line 78 in README.md

View workflow job for this annotation

GitHub Actions / test (18.x)

Replace `*` with `-`

### 3. Testing

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@
"@commitlint/config-conventional": "19.2.2",
"@hyperse/eslint-config-hyperse": "^1.1.3",
"@hyperse/vitest-coverage-reporter": "^1.0.15",
"@types/node": "^22.2.0",
"@types/node": "^22.5.0",
"@vitest/coverage-istanbul": "^2.0.5",
"cheerio": "^1.0.0",
"commitizen": "4.3.0",
"cz-conventional-changelog": "3.3.0",
"eslint": "^9.9.0",
"husky": "9.1.4",
"lint-staged": "15.2.8",
"husky": "9.1.5",
"lint-staged": "15.2.9",
"rimraf": "6.0.1",
"typescript": "^5.5.4",
"vitest": "^2.0.5"
Expand Down
11 changes: 11 additions & 0 deletions website/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ slug: /getting-started
npm install mui-color-input --save
```

```mermaid
flowchart TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
```

or you can use **yarn**

```bash
Expand Down
8 changes: 8 additions & 0 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ const config: Config = {
} satisfies Preset.Options,
],
],
markdown: {
mermaid: true,
},
themes: ['@docusaurus/theme-mermaid'],
themeConfig: {
mermaid: {
// https://mermaid.js.org/config/theming.html
theme: { light: 'forest', dark: 'neutral' },
},
colorMode: {
defaultMode: 'dark',
disableSwitch: false,
Expand Down
21 changes: 11 additions & 10 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,37 @@
]
},
"dependencies": {
"@docusaurus/core": "^3.5.1",
"@docusaurus/plugin-content-docs": "^3.5.1",
"@docusaurus/plugin-google-gtag": "^3.5.1",
"@docusaurus/preset-classic": "^3.5.1",
"@docusaurus/core": "^3.5.2",
"@docusaurus/plugin-content-docs": "^3.5.2",
"@docusaurus/plugin-google-gtag": "^3.5.2",
"@docusaurus/preset-classic": "^3.5.2",
"@docusaurus/theme-mermaid": "^3.5.2",
"@heroicons/react": "^2.1.5",
"@mdx-js/react": "^3.0.1",
"clsx": "^2.1.1",
"postcss": "^8.4.41",
"prism-react-renderer": "^2.3.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tailwindcss": "^3.4.9",
"tailwindcss": "^3.4.10",
"usehooks-ts": "^3.1.0"
},
"devDependencies": {
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.7",
"@commitlint/cli": "19.4.0",
"@commitlint/config-conventional": "19.2.2",
"@docusaurus/module-type-aliases": "3.5.1",
"@docusaurus/module-type-aliases": "3.5.2",
"@hyperse/eslint-config-hyperse": "^1.1.3",
"@tsconfig/docusaurus": "^2.0.3",
"@types/node": "^22.2.0",
"@types/react": "^18.3.3",
"@types/node": "^22.5.0",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"commitizen": "4.3.0",
"cz-conventional-changelog": "3.3.0",
"eslint": "^9.9.0",
"husky": "9.1.4",
"lint-staged": "15.2.8",
"husky": "9.1.5",
"lint-staged": "15.2.9",
"typescript": "5.5.4",
"vitest": "^2.0.5"
},
Expand Down
Loading

0 comments on commit cfe7ab8

Please sign in to comment.