From 6e6009aebd1eb5b32cddb3aa49c946d748287fdc Mon Sep 17 00:00:00 2001
From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com>
Date: Mon, 27 Nov 2023 18:53:52 +0100
Subject: [PATCH] docs: build the user documentation with Docusaurus (#264)
Initiate the website with Docusaurus v3.
Setup the site and includes the content that was already available in
the `docs` package.
The currently implementation mainly uses the default theme available
when using the Docusaurus scaffolding. It was initiated with:
`npx create-docusaurus@3.0.0 my-website classic`
---
.github/workflows/build.yml | 4 +-
...documentation.yml => generate-website.yml} | 16 +-
.gitignore | 2 +-
README.md | 12 +-
.../docs => docs}/images/maxgraph_demo.gif | Bin
packages/core/tsconfig.json | 2 +-
packages/docs/.gitignore | 1 -
packages/website/.gitignore | 2 +
packages/website/README.md | 43 +++++
packages/website/babel.config.js | 3 +
.../website/docs/development/_category_.json | 8 +
.../docs/development}/release.md | 10 +-
packages/website/docs/intro.md | 36 ++++
packages/website/docs/usage/_category_.json | 8 +
.../docs/usage}/css-and-images.md | 6 +-
.../docs/usage}/migrate-from-mxgraph.md | 25 ++-
packages/website/docusaurus.config.ts | 136 ++++++++++++++
.../old-mxgraph/api-specification.txt | 0
.../old-mxgraph/css/manual-colors.css | 0
.../old-mxgraph/css/manual-styles.css | 0
.../images/MX_MANUAL_html_1cc55dd3.png | Bin
.../images/MX_MANUAL_html_ba4bf13.png | Bin
.../images/MX_MANUAL_html_m75de608.png | Bin
.../old-mxgraph/images/architecture.png | Bin
.../old-mxgraph/images/callgraph.png | Bin
.../old-mxgraph/images/editor.png | Bin
.../old-mxgraph/images/graph.png | Bin
.../old-mxgraph/images/logo.jpg | Bin
.../old-mxgraph/images/model.png | Bin
.../images/mx_man_architecture.png | Bin
.../images/mx_man_collapse_swim.png | Bin
.../old-mxgraph/images/mx_man_drill_down.png | Bin
.../old-mxgraph/images/mx_man_drilling.png | Bin
.../images/mx_man_edge_routing.png | Bin
.../old-mxgraph/images/mx_man_expand_swim.png | Bin
.../images/mx_man_graph_analysis.jpg | Bin
.../images/mx_man_graph_interaction.png | Bin
.../images/mx_man_graph_layout.png | Bin
.../old-mxgraph/images/mx_man_graph_vis.png | Bin
.../images/mx_man_hello_struct.png | Bin
.../old-mxgraph/images/mx_man_hello_world.png | Bin
.../images/mx_man_log_group_struct.png | Bin
.../images/mx_man_non_realtive_edge_pos.png | Bin
.../images/mx_man_non_relative_pos.png | Bin
.../old-mxgraph/images/mx_man_overlap.png | Bin
.../images/mx_man_rel_vert_pos.png | Bin
.../images/mx_man_simple_graph.png | Bin
.../images/mx_man_simple_workflow.png | Bin
.../images/mx_man_stencil_loaded.png | Bin
.../old-mxgraph/images/mx_man_styles.png | Bin
.../old-mxgraph/images/mx_man_top_level.png | Bin
.../images/mx_man_vertex_props.png | Bin
.../old-mxgraph/images/mxgraph_logo.gif | Bin
.../{docs => website}/old-mxgraph/js/toc.js | 0
.../old-mxgraph/known-issues.html | 0
.../{docs => website}/old-mxgraph/manual.html | 2 +-
.../old-mxgraph/manual_javavis.html | 2 +-
.../old-mxgraph/stencils.xsd | 0
.../old-mxgraph/tutorial.html | 0
packages/website/package.json | 46 +++++
packages/website/sidebars.ts | 31 ++++
.../src/components/HomepageFeatures/index.tsx | 73 ++++++++
.../HomepageFeatures/styles.module.css | 11 ++
packages/website/src/css/custom.css | 30 +++
packages/website/src/pages/index.module.css | 23 +++
packages/website/src/pages/index.tsx | 42 +++++
packages/website/src/pages/markdown-page.md | 7 +
packages/website/static/.nojekyll | 0
packages/website/static/img/docusaurus.png | Bin 0 -> 5142 bytes
packages/website/static/img/favicon.ico | Bin 0 -> 3626 bytes
packages/website/static/img/logo.svg | 1 +
.../static/img/undraw_docusaurus_mountain.svg | 171 ++++++++++++++++++
.../static/img/undraw_docusaurus_react.svg | 170 +++++++++++++++++
.../static/img/undraw_docusaurus_tree.svg | 40 ++++
packages/website/tsconfig.json | 7 +
75 files changed, 942 insertions(+), 28 deletions(-)
rename .github/workflows/{generate-documentation.yml => generate-website.yml} (54%)
rename {packages/docs => docs}/images/maxgraph_demo.gif (100%)
delete mode 100644 packages/docs/.gitignore
create mode 100644 packages/website/.gitignore
create mode 100644 packages/website/README.md
create mode 100644 packages/website/babel.config.js
create mode 100644 packages/website/docs/development/_category_.json
rename packages/{docs => website/docs/development}/release.md (91%)
create mode 100644 packages/website/docs/intro.md
create mode 100644 packages/website/docs/usage/_category_.json
rename packages/{docs => website/docs/usage}/css-and-images.md (86%)
rename packages/{docs => website/docs/usage}/migrate-from-mxgraph.md (95%)
create mode 100644 packages/website/docusaurus.config.ts
rename packages/{docs => website}/old-mxgraph/api-specification.txt (100%)
rename packages/{docs => website}/old-mxgraph/css/manual-colors.css (100%)
rename packages/{docs => website}/old-mxgraph/css/manual-styles.css (100%)
rename packages/{docs => website}/old-mxgraph/images/MX_MANUAL_html_1cc55dd3.png (100%)
rename packages/{docs => website}/old-mxgraph/images/MX_MANUAL_html_ba4bf13.png (100%)
rename packages/{docs => website}/old-mxgraph/images/MX_MANUAL_html_m75de608.png (100%)
rename packages/{docs => website}/old-mxgraph/images/architecture.png (100%)
rename packages/{docs => website}/old-mxgraph/images/callgraph.png (100%)
rename packages/{docs => website}/old-mxgraph/images/editor.png (100%)
rename packages/{docs => website}/old-mxgraph/images/graph.png (100%)
rename packages/{docs => website}/old-mxgraph/images/logo.jpg (100%)
rename packages/{docs => website}/old-mxgraph/images/model.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_architecture.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_collapse_swim.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_drill_down.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_drilling.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_edge_routing.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_expand_swim.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_graph_analysis.jpg (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_graph_interaction.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_graph_layout.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_graph_vis.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_hello_struct.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_hello_world.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_log_group_struct.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_non_realtive_edge_pos.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_non_relative_pos.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_overlap.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_rel_vert_pos.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_simple_graph.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_simple_workflow.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_stencil_loaded.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_styles.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_top_level.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mx_man_vertex_props.png (100%)
rename packages/{docs => website}/old-mxgraph/images/mxgraph_logo.gif (100%)
rename packages/{docs => website}/old-mxgraph/js/toc.js (100%)
rename packages/{docs => website}/old-mxgraph/known-issues.html (100%)
rename packages/{docs => website}/old-mxgraph/manual.html (99%)
rename packages/{docs => website}/old-mxgraph/manual_javavis.html (99%)
rename packages/{docs => website}/old-mxgraph/stencils.xsd (100%)
rename packages/{docs => website}/old-mxgraph/tutorial.html (100%)
create mode 100644 packages/website/package.json
create mode 100644 packages/website/sidebars.ts
create mode 100644 packages/website/src/components/HomepageFeatures/index.tsx
create mode 100644 packages/website/src/components/HomepageFeatures/styles.module.css
create mode 100644 packages/website/src/css/custom.css
create mode 100644 packages/website/src/pages/index.module.css
create mode 100644 packages/website/src/pages/index.tsx
create mode 100644 packages/website/src/pages/markdown-page.md
create mode 100644 packages/website/static/.nojekyll
create mode 100644 packages/website/static/img/docusaurus.png
create mode 100644 packages/website/static/img/favicon.ico
create mode 100644 packages/website/static/img/logo.svg
create mode 100644 packages/website/static/img/undraw_docusaurus_mountain.svg
create mode 100644 packages/website/static/img/undraw_docusaurus_react.svg
create mode 100644 packages/website/static/img/undraw_docusaurus_tree.svg
create mode 100644 packages/website/tsconfig.json
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 9c98459f1..c1979da0b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -9,7 +9,7 @@ on:
- '.nvmrc'
- 'packages/**/*'
- '!packages/**/*.md'
- - '!packages/docs/*'
+ - '!packages/website/**/*'
- 'scripts/**/*'
- 'babel.config.js'
- 'package.json'
@@ -21,7 +21,7 @@ on:
- '.github/workflows/build.yml'
- 'packages/**/*'
- '!packages/**/*.md'
- - '!packages/docs/*'
+ - '!packages/website/**/*'
- 'scripts/**/*'
- 'babel.config.js'
- 'package.json'
diff --git a/.github/workflows/generate-documentation.yml b/.github/workflows/generate-website.yml
similarity index 54%
rename from .github/workflows/generate-documentation.yml
rename to .github/workflows/generate-website.yml
index 595873ba4..5b8941127 100644
--- a/.github/workflows/generate-documentation.yml
+++ b/.github/workflows/generate-website.yml
@@ -1,14 +1,14 @@
-name: Generate documentation
+name: Generate website
on:
pull_request:
branches:
- development
paths:
- - '.github/workflows/generate-documentation.yml'
+ - '.github/workflows/generate-website.yml'
- '.nvmrc'
- 'packages/core/*'
- - 'packages/docs/*'
+ - 'packages/website/*'
- 'package.json'
jobs:
@@ -25,3 +25,13 @@ jobs:
- name: Build @maxgraph/core API docs
working-directory: packages/core
run: npm run docs:api
+ - name: Build website
+ working-directory: packages/website
+ run: npm run build
+ - name: Upload website artifact
+ uses: actions/upload-artifact@v3
+ with:
+ name: website-${{github.sha}}
+ path: |
+ packages/core/build/api/
+ packages/website/build/
diff --git a/.gitignore b/.gitignore
index 7fd96f7f4..59cd9e288 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,7 +22,7 @@ package-lock.json
/out/
# production
-/build
+build/
# misc
.DS_Store
diff --git a/README.md b/README.md
index 7af8c9865..f3096b9f6 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[![npm version](https://img.shields.io/npm/v/@maxgraph/core?color=blue&style=flat)](https://www.npmjs.com/package/@maxgraph/core)
[![build status](https://github.com/maxGraph/maxGraph/workflows/Build/badge.svg)](https://github.com/maxGraph/maxGraph/actions/workflows/build.yml)
-
+
`maxGraph` is a TypeScript library which can display and allow interaction with vector diagrams. At a high level, it provides:
- **Nodes**, also known as **vertices** which are typically represented by shapes like rectangles.
- **Edges** which can be lines and arrows which normally point between one node and another.
@@ -12,7 +12,7 @@ It provides many of the diagramming features which would be expected by a piece
or LibreOffice® Impress such as being able to resize, move or rotate nodes, but has a stronger focus on automatic layout
algorithms and applications of [Graph Theory](https://en.wikipedia.org/wiki/Graph_theory). It is suited towards software
which requires finer-grained customization of functionality than off-the-shelf packages.
-
+
The `maxGraph` library uses no third-party software, it requires no plugins and can be integrated in virtually any framework (it's vanilla JS).
@@ -107,11 +107,11 @@ graph.batchUpdate(() => {
You will see something like in the following _maxGraph panning_ demo:
-![maxGraph panning demo](packages/docs/images/maxgraph_demo.gif "maxGraph panning demo")
+![maxGraph panning demo](docs/images/maxgraph_demo.gif "maxGraph panning demo")
For more details, have a look at the [storybook stories](packages/html/stories).
-Notice that some elements produced by `maxGraph` require to use [CSS and images](./packages/docs/css-and-images.md) provided in the npm package.
+Notice that some elements produced by `maxGraph` require to use [CSS and images](packages/website/docs/usage/css-and-images.md) provided in the npm package.
## TypeScript support
@@ -134,7 +134,7 @@ Until we provide a complete documentation, you can check the mxGraph resources
`maxGraph` APIs are not fully compatible with `mxGraph` APIs. The concepts are the same, so experienced `mxGraph` users should be able to switch from `mxGraph` to `maxGraph` without issues.
-For a complete guide, see the [dedicated migration page](packages/docs/migrate-from-mxgraph.md).
+For a complete guide, see the [dedicated migration page](packages/website/docs/usage/migrate-from-mxgraph.md).
## History
@@ -225,4 +225,4 @@ Examples of use can be found in the [maxgraph-integration-examples](https://gith
### Release
-See the dedicated [release](packages/docs/release.md) page.
+See the dedicated [release](packages/website/docs/development/release.md) page.
diff --git a/packages/docs/images/maxgraph_demo.gif b/docs/images/maxgraph_demo.gif
similarity index 100%
rename from packages/docs/images/maxgraph_demo.gif
rename to docs/images/maxgraph_demo.gif
diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json
index bcdcca5fb..dc87f39b0 100644
--- a/packages/core/tsconfig.json
+++ b/packages/core/tsconfig.json
@@ -13,7 +13,7 @@
},
"include": ["src/**/*.ts"],
"typedocOptions": {
- "out": "../docs/build/api",
+ "out": "build/api",
"readme": "none",
"excludeExternals": true,
"excludePrivate": true
diff --git a/packages/docs/.gitignore b/packages/docs/.gitignore
deleted file mode 100644
index 567609b12..000000000
--- a/packages/docs/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-build/
diff --git a/packages/website/.gitignore b/packages/website/.gitignore
new file mode 100644
index 000000000..84ba12e04
--- /dev/null
+++ b/packages/website/.gitignore
@@ -0,0 +1,2 @@
+.docusaurus/
+build/
diff --git a/packages/website/README.md b/packages/website/README.md
new file mode 100644
index 000000000..5e5cd1f90
--- /dev/null
+++ b/packages/website/README.md
@@ -0,0 +1,43 @@
+# Website
+
+This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website generator.
+
+### Installation
+
+```
+$ npm install
+```
+
+### Local Development
+
+```
+$ npm start
+```
+
+This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
+
+### Build
+
+```
+$ npm build
+```
+
+This command generates static content into the `build` directory and can be served using any static contents hosting service.
+
+
diff --git a/packages/website/babel.config.js b/packages/website/babel.config.js
new file mode 100644
index 000000000..e00595dae
--- /dev/null
+++ b/packages/website/babel.config.js
@@ -0,0 +1,3 @@
+module.exports = {
+ presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
+};
diff --git a/packages/website/docs/development/_category_.json b/packages/website/docs/development/_category_.json
new file mode 100644
index 000000000..a539abff7
--- /dev/null
+++ b/packages/website/docs/development/_category_.json
@@ -0,0 +1,8 @@
+{
+ "label": "Development",
+ "position": 3,
+ "link": {
+ "type": "generated-index",
+ "description": "Everything you need to know when you are developing maxGraph."
+ }
+}
diff --git a/packages/docs/release.md b/packages/website/docs/development/release.md
similarity index 91%
rename from packages/docs/release.md
rename to packages/website/docs/development/release.md
index 5790dfb0f..34d639618 100644
--- a/packages/docs/release.md
+++ b/packages/website/docs/development/release.md
@@ -1,3 +1,7 @@
+---
+description: Explain how to do a release of maxGraph.
+---
+
# Release how-to
This page explains the steps needed to release a new version of maxgraph@core.
@@ -21,8 +25,8 @@ released. Rename it if necessary.
- Close the milestone.
Changes in the source code
-- Update the version in [package.json](../core/package.json) and the `VERSION` constant in the [Client](../core/src/Client.ts) file.
-- Update the [CHANGELOG](../../CHANGELOG.md) to list the major changes included in the new version. Be generic and add a
+- Update the version in `packages/core/package.json` and the `VERSION` constant in the `packages/core/src/Client.ts` file.
+- Update the `CHANGELOG` file to list the major changes included in the new version. Be generic and add a
link to the future GitHub release that will contain detailed release notes, as shown below.
```markdown
For more details, see the [0.1.0 Changelog](https://github.com/maxGraph/maxGraph/releases/tag/v0.1.0) on
@@ -59,7 +63,7 @@ Create a [new draft release](https://github.com/maxGraph/maxGraph/releases/)
- save it as a draft
Generate the list of the major changes by using the [automatically generated release notes](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes).
-It is based on the labels of the merged Pull Requests included in this release and the [GitHub release configuration](../../.github/release.yml).
+It is based on the labels of the merged Pull Requests included in this release and the [GitHub release configuration](https://github.com/maxGraph/maxGraph/blob/development/.github/release.yml).
If the list is incorrect (for example, an item is not in the correct category), update the label(s) or the associated
Pull Request and regenerate the list.
diff --git a/packages/website/docs/intro.md b/packages/website/docs/intro.md
new file mode 100644
index 000000000..6f7796271
--- /dev/null
+++ b/packages/website/docs/intro.md
@@ -0,0 +1,36 @@
+---
+sidebar_position: 1
+---
+
+# Introduction
+
+
+`maxGraph` is a TypeScript library which can display and allow interaction with vector diagrams. At a high level, it provides:
+- **Nodes**, also known as **vertices** which are typically represented by shapes like rectangles.
+- **Edges** which can be lines and arrows which normally point between one node and another.
+
+It provides many of the diagramming features which would be expected by a piece of presentation software like Microsoft® PowerPoint™
+or LibreOffice® Impress such as being able to resize, move or rotate nodes, but has a stronger focus on automatic layout
+algorithms and applications of [Graph Theory](https://en.wikipedia.org/wiki/Graph_theory). It is suited towards software
+which requires finer-grained customization of functionality than off-the-shelf packages.
+
+
+## About this documentation
+
+:::warning
+
+This documentation is a **work in progress**. Please be patient, the content will be updated progressively.
+
+:::
+
+
+## Getting Started
+
+Please check the maxGraph repository **README**:
+- [installation](https://github.com/maxGraph/maxGraph/blob/development/README.md#install)
+- [getting started](https://github.com/maxGraph/maxGraph/blob/development/README.md#getting-started)
+
+
+## Usage
+
+Let's continue with the [Usage](/docs/category/usage) documentation.
diff --git a/packages/website/docs/usage/_category_.json b/packages/website/docs/usage/_category_.json
new file mode 100644
index 000000000..95126787b
--- /dev/null
+++ b/packages/website/docs/usage/_category_.json
@@ -0,0 +1,8 @@
+{
+ "label": "Usage",
+ "position": 2,
+ "link": {
+ "type": "generated-index",
+ "description": "Everything you need to know to use maxGraph."
+ }
+}
diff --git a/packages/docs/css-and-images.md b/packages/website/docs/usage/css-and-images.md
similarity index 86%
rename from packages/docs/css-and-images.md
rename to packages/website/docs/usage/css-and-images.md
index ae8edc392..b06f31bb5 100644
--- a/packages/docs/css-and-images.md
+++ b/packages/website/docs/usage/css-and-images.md
@@ -1,9 +1,13 @@
+---
+description: Integrate CSS and Images assets required by maxGraph.
+---
+
# CSS and Images
## CSS
Some features of `maxGraph` create elements in the DOM to let interact with the `Graph`.
-For instance, it happens hen using _Rubberband_, _Tooltip_, _MaxWindow_, _Editor_ and _Toolbar_.
+For instance, it happens when using _Rubberband_, _Tooltip_, _MaxWindow_, _Editor_ and _Toolbar_.
These elements require the application to provide CSS rules for correct display.
diff --git a/packages/docs/migrate-from-mxgraph.md b/packages/website/docs/usage/migrate-from-mxgraph.md
similarity index 95%
rename from packages/docs/migrate-from-mxgraph.md
rename to packages/website/docs/usage/migrate-from-mxgraph.md
index 25bf21a16..b5dbf28e2 100644
--- a/packages/docs/migrate-from-mxgraph.md
+++ b/packages/website/docs/usage/migrate-from-mxgraph.md
@@ -9,9 +9,16 @@ Here's a breakdown of the proposed changes:
2. [General guidelines](#general-guidelines)
3. [Specific code changes](#specific-code-changes)
-> **Note:** **⚠️⚠️⚠️ This page is under construction. ⚠️⚠️⚠️
+:::warning
+
+**This page is under construction.**
+
Comments are welcome by creating an [issue](https://github.com/maxGraph/maxGraph/issues)
-or starting a [discussion](https://github.com/maxGraph/maxGraph/discussions/categories/q-a)!**.
+or starting a [discussion](https://github.com/maxGraph/maxGraph/discussions/categories/q-a)!.
+
+Feel free to create a [Pull Request](https://github.com/maxGraph/maxGraph/pulls) to enrich the content or fix errors.
+
+:::
The `maxGraph` APIs are not fully compatible with the `mxGraph` APIs, but the `maxGraph` APIs are close to the former `mxGraph` APIs.
The concepts are the same, so experienced `mxGraph` users should be able to switch from `mxGraph` to `maxGraph` without problems.
@@ -292,9 +299,9 @@ Several functions from the `mxGraphDataModel` class have been moved to the `Cell
### Misc
-Codec renaming and output: https://github.com/maxGraph/maxGraph/pull/70
+- Codec renaming and output: https://github.com/maxGraph/maxGraph/pull/70
+- `mxDictionary`<T> to `Dictionary`<K, V>
-mxDictionary
The same graph expanded using folding instead looks like:
+ WIDTH=695 HEIGHT=227 BORDER=0>Exiting the group using the shape->exit group option, which invokes mxGraph.exitGroup, brings you back to the original 3 vertex top level graph.
diff --git a/packages/docs/old-mxgraph/manual_javavis.html b/packages/website/old-mxgraph/manual_javavis.html similarity index 99% rename from packages/docs/old-mxgraph/manual_javavis.html rename to packages/website/old-mxgraph/manual_javavis.html index 05f49f66a..89825fb36 100644 --- a/packages/docs/old-mxgraph/manual_javavis.html +++ b/packages/website/old-mxgraph/manual_javavis.html @@ -1088,7 +1088,7 @@ children of that parent appear in the display as the complete graph.The same graph expanded using folding instead looks like:
+ WIDTH=695 HEIGHT=227 BORDER=0>Exiting the group using the shape->exit group option, which invokes mxGraph.exitGroup, brings you back to the original 3 vertex top level graph.
diff --git a/packages/docs/old-mxgraph/stencils.xsd b/packages/website/old-mxgraph/stencils.xsd similarity index 100% rename from packages/docs/old-mxgraph/stencils.xsd rename to packages/website/old-mxgraph/stencils.xsd diff --git a/packages/docs/old-mxgraph/tutorial.html b/packages/website/old-mxgraph/tutorial.html similarity index 100% rename from packages/docs/old-mxgraph/tutorial.html rename to packages/website/old-mxgraph/tutorial.html diff --git a/packages/website/package.json b/packages/website/package.json new file mode 100644 index 000000000..043bc4b94 --- /dev/null +++ b/packages/website/package.json @@ -0,0 +1,46 @@ +{ + "name": "@maxgraph/docs", + "private": true, + "scripts": { + "docusaurus": "docusaurus", + "start": "docusaurus start", + "build": "docusaurus build", + "swizzle": "docusaurus swizzle", + "deploy": "docusaurus deploy", + "clear": "docusaurus clear", + "serve": "docusaurus serve", + "write-translations": "docusaurus write-translations", + "write-heading-ids": "docusaurus write-heading-ids", + "typecheck": "tsc" + }, + "dependencies": { + "@docusaurus/core": "3.0.0", + "@docusaurus/preset-classic": "3.0.0", + "@mdx-js/react": "^3.0.0", + "clsx": "^1.2.1", + "prism-react-renderer": "^2.1.0", + "react": "^18.0.0", + "react-dom": "^18.0.0" + }, + "devDependencies": { + "@docusaurus/module-type-aliases": "3.0.0", + "@docusaurus/tsconfig": "3.0.0", + "@docusaurus/types": "3.0.0", + "typescript": "~5.2.2" + }, + "browserslist": { + "production": [ + ">0.5%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 3 chrome version", + "last 3 firefox version", + "last 5 safari version" + ] + }, + "engines": { + "node": ">=18.0" + } +} diff --git a/packages/website/sidebars.ts b/packages/website/sidebars.ts new file mode 100644 index 000000000..794b96727 --- /dev/null +++ b/packages/website/sidebars.ts @@ -0,0 +1,31 @@ +import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; + +/** + * Creating a sidebar enables you to: + - create an ordered group of docs + - render a sidebar for each doc of that group + - provide next/previous navigation + + The sidebars can be generated from the filesystem, or explicitly defined here. + + Create as many sidebars as you want. + */ +const sidebars: SidebarsConfig = { + // By default, Docusaurus generates a sidebar from the docs folder structure + docsSidebar: [{ type: 'autogenerated', dirName: '.' }], + + // But you can create a sidebar manually + /* + tutorialSidebar: [ + 'intro', + 'hello', + { + type: 'category', + label: 'Tutorial', + items: ['tutorial-basics/create-a-document'], + }, + ], + */ +}; + +export default sidebars; diff --git a/packages/website/src/components/HomepageFeatures/index.tsx b/packages/website/src/components/HomepageFeatures/index.tsx new file mode 100644 index 000000000..a660da31b --- /dev/null +++ b/packages/website/src/components/HomepageFeatures/index.tsx @@ -0,0 +1,73 @@ +import clsx from 'clsx'; +import Heading from '@theme/Heading'; +import styles from './styles.module.css'; + +type FeatureItem = { + title: string; + Svg: React.ComponentTypemaxGraph
is the successor of{' '}
+ mxGraph (which is now EOL in its
+ public version), the diagram library that powers{' '}
+ draw.io.
+ >
+ ),
+ },
+ {
+ title: 'Fully typed',
+ Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default,
+ description: (
+ <>
+ maxGraph
is written in TypeScript and provides precise types to guide
+ you easily when developing or reading API documentation.
+ >
+ ),
+ },
+ {
+ title: 'Flexible with convenient defaults',
+ Svg: require('@site/static/img/undraw_docusaurus_react.svg').default,
+ description: (
+ <>
+ maxGraph
is highly configurable and offers numerous extension points.
+ But it also provides numerous built-in elements, for example for shapes and
+ styles.
+ >
+ ),
+ },
+];
+
+function Feature({ title, Svg, description }: FeatureItem) {
+ return (
+ {description}
+{siteConfig.tagline}
+&L{&Gf6-TKsE35Pv%1
z;bJcxPO+A9rPGsUs=rX(9^vydg2q`rU~otOJ37zb{Z{|)bAS!v3PQ5?l$+LkpGNJq
zzXDLcS$vMy|9sIidXq$NE6A-^v@)Gs_x_3wYxF%y*_e{B6FvN-enGst&nq0z8Hl0<
z*p6ZXC*su`M{y|Fv(Vih_F|83=)A6ay-v_&ph1Fqqcro{oeu99Y0*FVvRFmbFa@gs
zJ*g%Gik{Sb+_zNNf?Qy7PTf@S*dTGt#O%a9WN1KVNj`q$1Qoiwd|y&_v?}bR#>fdP
zSlMy2#KzRq4%?