Skip to content

Commit

Permalink
Use deep outline for the whole documentation website
Browse files Browse the repository at this point in the history
  • Loading branch information
nirname committed Dec 18, 2023
1 parent 0506ba8 commit f66f4f4
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 43 deletions.
5 changes: 4 additions & 1 deletion packages/mermaid/src/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ export default defineConfig({
sidebar: {
'/': sidebarAll(),
},
outline: {
level: 'deep',
},
socialLinks: [
{ icon: 'github', link: 'https://github.com/mermaid-js/mermaid' },
{
Expand Down Expand Up @@ -198,7 +201,7 @@ function sidebarCommunity() {
collapsed: false,
items: [
{ text: 'Contributing to Mermaid', link: '/contributing/intro' },
{ text: 'Quick start guide', link: '/contributing/quick-start' },
{ text: 'Contributing guide', link: '/contributing/contributing' },
{ text: 'Initial setup', link: '/contributing/setup' },
{ text: 'Workflow', link: '/contributing/workflow' },
{ text: 'Code', link: '/contributing/code' },
Expand Down
29 changes: 14 additions & 15 deletions packages/mermaid/src/docs/community/documentation.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Contributing Documentation

# Contributing to Documentation

If it is not in the documentation, it's like it never happened. Wouldn't that be sad? With all the effort that was put into the feature?

The documentation is written in Markdown. It is located in the [`packages/mermaid/src/docs`](https://github.com/mermaid-js/mermaid/tree/develop/packages/mermaid/src/docs) folder and organized according to relevant subfolder. Just pick the right section and start typing.

The contents of [mermaid.js.org](https://mermaid.js.org/) are based on the docs from the `master` branch. Updates committed to the `master` branch are reflected in the [Mermaid Docs](https://mermaid.js.org/) once published.

## How to Contribute to Documentation
## How to Contribute

```warning
DO NOT CHANGE FILES IN `/docs`
Expand All @@ -18,15 +19,21 @@ The `docs` folder will be automatically generated when committing to `packages/m
flowchart LR
classDef default fill:#fff,color:black,stroke:black
source["files in /packages/mermaid/src/docs\n(changes should be done here)"] -- automatic processing\nto generate the final documentation--> published["files in /docs\ndisplayed on the official documentation site"]
source["Edit /packages/mermaid/src/docs"] -- automatic processing--> published["View /docs which will be publised on Official Website"]
```

It is OK to commit directly in the `develop` branch if you are a collaborator.
## Runing the Documentation Website

```tip
If the change is **only** to the documentation, you can get your changes published to the site quicker by making a PR to the `master` branch. In that case, your branch should be based on master, not develop.
```
**[The mermaid documentation site](https://mermaid.js.org/) is powered by [Vitepress](https://vitepress.vuejs.org/).**

To run the documentation site locally:

1. Run `pnpm --filter mermaid run docs:dev` to start the dev server. (Or `pnpm docs:dev` inside the `packages/mermaid` directory.)
2. Open [http://localhost:3333/](http://localhost:3333/) in your browser.


### Markdown extensions

You can use `note`, `tip`, `warning` and `danger` in triple backticks to add a note, tip, warning or danger box.
Do not use vitepress specific markdown syntax `::: warning` as it will not be processed correctly.
Expand All @@ -49,14 +56,6 @@ Danger content
```
````

## The official documentation site

**[The mermaid documentation site](https://mermaid.js.org/) is powered by [Vitepress](https://vitepress.vuejs.org/).**

To run the documentation site locally:

1. Run `pnpm --filter mermaid run docs:dev` to start the dev server. (Or `pnpm docs:dev` inside the `packages/mermaid` directory.)
2. Open [http://localhost:3333/](http://localhost:3333/) in your browser.

Markdown is used to format the text, for more information about Markdown [see the GitHub Markdown help page](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax).

Expand Down
18 changes: 9 additions & 9 deletions packages/mermaid/src/docs/community/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Here are a few things to get you started on the right path.

```mermaid-nocode
mindmap
root)Contribution(
root)Contributing(
Development
Solving issues
Adding new diagrams
Expand All @@ -25,23 +25,23 @@ mindmap
Classification and monitoring of incoming issues
```

## Join the development

[Join our slack community if you want closer contact!](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)

## Help with testing

## Manage tasks
<!-- ## Join the development -->
<!-- ## Help with testing -->
<!-- ## Manage tasks -->

## Where do I start?

```tip
Detailed information about contributing can be found in the [contribution guide](../contributing/contributing.md).
```

- You could confirm the bugs in [these issues](https://github.com/knsv/mermaid/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Bug+%2F+Error%22+label%3A%22Status%3A+Pending%22).
- You could help write and improve the documentation! [Here's ](https://github.com/knsv/mermaid/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3A%22Help+wanted%21%22+label%3A%22Area%3A+Documentation%22)some inspiration.
- You could start getting some knowledge of the code base by working on [these "good first issues"](https://github.com/knsv/mermaid/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3A%22Good+first+issue%21%22+).
- You could jump right in and help us fix any of [these bugs](https://github.com/knsv/mermaid/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Bug+%2F+Error%22+label%3A%22Help+wanted%21%22+label%3A%22Area%3A+Development%22)!
- You could work on a new feature! [These](https://github.com/knsv/mermaid/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3A%22Area%3A+Development%22+label%3A%22Help+wanted%21%22+label%3A%22Type%3A+Enhancement%22+label%3A%22Status%3A+Approved%22) are some ideas!
- [Join our slack community if you want closer contact!](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)

Detailed information about contributing can be found in the [contribution guide](https://github.com/mermaid-js/mermaid/blob/master/CONTRIBUTING.md).

## Last Words

Expand Down
1 change: 0 additions & 1 deletion packages/mermaid/src/docs/community/quick-start.md

This file was deleted.

10 changes: 6 additions & 4 deletions packages/mermaid/src/docs/community/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ flowchart LR
```

Here are a few things to get you started on the right path.

## Get the Source Code

In GitHub, you first **fork** a repository when you are going to make changes and submit pull requests.
Expand All @@ -41,7 +39,7 @@ These are the tools we use for working with the code and documentation:
- [pnpm](https://pnpm.io/) package manager. `volta install pnpm`
- [npx](https://docs.npmjs.com/cli/v8/commands/npx) the packaged executor in npm. This is needed [to install pnpm.](#install-packages)

Follow the setup steps below to install them and start the development.
Follow the setup steps below to start the development.

## Setup and Launch

Expand All @@ -61,7 +59,7 @@ Run `npx pnpm install`. You will need `npx` for this because volta doesn't suppo
npx pnpm install # npx is required for first install
```

### Launch
### Launch Mermaid

```bash
npx pnpm run dev
Expand All @@ -77,6 +75,10 @@ If you need a specific diagram, you can duplicate the `example.html` file in `/d
That will be served at <http://localhost:9000/dev/your-file-name.html>.
After making code changes, the dev server will rebuild the mermaid library. You will need to reload the browser page yourself to see the changes. (PRs for auto reload are welcome!)

### Launch Documentaion Website



## Verify Everything is Working

This step is optional, but it helps to make sure that everything in development branch was OK before you started making any changes.
Expand Down
4 changes: 0 additions & 4 deletions packages/mermaid/src/docs/ecosystem/integrations-community.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
outline: 'deep' # shows all h3 headings in outline in Vitepress
---

# Integrations

## Official integration: [Mermaid Chart](./mermaid-chart.md)
Expand Down
4 changes: 0 additions & 4 deletions packages/mermaid/src/docs/ecosystem/integrations-create.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
outline: 'deep' # shows all h3 headings in outline in Vitepress
---

# Integrations - create

## Recommendations
Expand Down
4 changes: 0 additions & 4 deletions packages/mermaid/src/docs/ecosystem/mermaid-chart.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
outline: 'deep' # shows all h3 headings in outline in Vitepress
---

# Mermaid Chart

<br />
Expand Down
1 change: 0 additions & 1 deletion packages/mermaid/src/docs/syntax/flowchart.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Flowcharts Syntax
outline: 'deep' # shows all h3 headings in outline in Vitepress
---

# Flowcharts - Basic Syntax
Expand Down

0 comments on commit f66f4f4

Please sign in to comment.