From 3d093a6f5ddc44f4d02949965a9b44bc135f2a00 Mon Sep 17 00:00:00 2001 From: Guillaume Fontorbe Date: Fri, 1 Aug 2025 09:26:02 +0200 Subject: [PATCH 1/4] Add reference documentation for sprotty and sprotty-protocol packages # Conflicts: # hugo/content/docs/ref/features.md # hugo/content/docs/ref/smodel.md # Conflicts: # hugo/content/docs/ref/smodel.md # hugo/data/menu/main.yaml --- hugo/content/docs/ref/smodel.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hugo/content/docs/ref/smodel.md b/hugo/content/docs/ref/smodel.md index 4d60864..e356f59 100644 --- a/hugo/content/docs/ref/smodel.md +++ b/hugo/content/docs/ref/smodel.md @@ -190,11 +190,11 @@ These are the connectors for the diagram model. An edge has a source and a targe *Default features:* -* [editFeature]({{}}#editfeature) -* [deletableFeature]({{}}#deletablefeature) -* [selectFeature]({{}}#selectfeature) -* [fadeFeature]({{}}#fadefeature) -* [hoverFeedbackFeature]({{}}#hoverfeedbackfeature) +* [editFeature](../{{}}#editfeature) +* [deletableFeature](../{{}}#deletablefeature) +* [selectFeature](../{{}}#selectfeature) +* [fadeFeature](../{{}}#fadefeature) +* [hoverFeedbackFeature](../{{}}#hoverfeedbackfeature) ### SLabelImpl From 4275c2ead10ac72952497be9e9954091b86faedb Mon Sep 17 00:00:00 2001 From: Guillaume Fontorbe Date: Thu, 28 Aug 2025 15:33:34 +0200 Subject: [PATCH 2/4] Remove old documentation --- hugo/content/docs/ref/user-interaction.md | 33 ----------------------- 1 file changed, 33 deletions(-) delete mode 100644 hugo/content/docs/ref/user-interaction.md diff --git a/hugo/content/docs/ref/user-interaction.md b/hugo/content/docs/ref/user-interaction.md deleted file mode 100644 index 5545a7e..0000000 --- a/hugo/content/docs/ref/user-interaction.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: 'User Interaction' ---- -{{< toc >}} - -## Interacting with a Sprotty Diagram - -Sprotty offers multiple mouse and keyboard interactions by default listed in the following tables. -The `CTRL` key in the following is equal to the `CMD` key on Mac. - -| Mouse -| ----------------- | ---- | -| left-click: | toggle selection | -| CTRL-click: | add to/remove from selection | -| left-click : drag | move selection (when on selected element) | -| left-click : drag | pan viewport (when on diagram background) | -| mouse wheel: | zoom | - -| Touchpad -| --------------------- | --- | -|click | toggle selection | -|drag | move selection (when on selected element) | -|two-finger pan up/down | zoom | -|zoom | zoom | - -| Keys -| ---------- | --- | -|CTRL-SHIFT-A| select all | -|CTRL-SHIFT-C| center selection, or if nothing is selected center the entire diagram | -|CTRL-SHIFT-E| export diagram to SVG | -|CTRL-SHIFT-F| zoom selection to fill the entire canvas, or if nothing is selected zoom the entire diagram | -|CTRL-Z | undo | -|CTRL-SHIFT-Z| redo | From 82a06ac72f0153261328b36dc9a2d1b02f87570a Mon Sep 17 00:00:00 2001 From: Guillaume Fontorbe Date: Mon, 1 Sep 2025 11:16:30 +0200 Subject: [PATCH 3/4] Put back the user interaction, features, and smodel documentation --- hugo/content/docs/ref/user-interaction.md | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 hugo/content/docs/ref/user-interaction.md diff --git a/hugo/content/docs/ref/user-interaction.md b/hugo/content/docs/ref/user-interaction.md new file mode 100644 index 0000000..5545a7e --- /dev/null +++ b/hugo/content/docs/ref/user-interaction.md @@ -0,0 +1,33 @@ +--- +title: 'User Interaction' +--- +{{< toc >}} + +## Interacting with a Sprotty Diagram + +Sprotty offers multiple mouse and keyboard interactions by default listed in the following tables. +The `CTRL` key in the following is equal to the `CMD` key on Mac. + +| Mouse +| ----------------- | ---- | +| left-click: | toggle selection | +| CTRL-click: | add to/remove from selection | +| left-click : drag | move selection (when on selected element) | +| left-click : drag | pan viewport (when on diagram background) | +| mouse wheel: | zoom | + +| Touchpad +| --------------------- | --- | +|click | toggle selection | +|drag | move selection (when on selected element) | +|two-finger pan up/down | zoom | +|zoom | zoom | + +| Keys +| ---------- | --- | +|CTRL-SHIFT-A| select all | +|CTRL-SHIFT-C| center selection, or if nothing is selected center the entire diagram | +|CTRL-SHIFT-E| export diagram to SVG | +|CTRL-SHIFT-F| zoom selection to fill the entire canvas, or if nothing is selected zoom the entire diagram | +|CTRL-Z | undo | +|CTRL-SHIFT-Z| redo | From c5c76913780411bd35683c5f3de5c2d37e86a690 Mon Sep 17 00:00:00 2001 From: Guillaume Fontorbe Date: Mon, 8 Sep 2025 17:58:32 +0200 Subject: [PATCH 4/4] Add readme for generating reference documentation --- README.md | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b5da6fe..c63bc7f 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,40 @@ This repository contains the source for the website of Eclipse Sprotty: -https://sprotty.org/ +[https://sprotty.org](https://sprotty.org) The main repository is found at [eclipse-sprotty/sprotty](https://github.com/eclipse-sprotty/sprotty). ## Repository Structure - - `hugo` – [Hugo](https://gohugo.io) content including static web pages and documentation in Markdown format - - `tailwind` – [Tailwind CSS](https://tailwindcss.com) configuration - - `showcase` – Live examples of Sprotty diagrams +- `hugo` – [Hugo](https://gohugo.io) content including static web pages and documentation in Markdown format +- `tailwind` – [Tailwind CSS](https://tailwindcss.com) configuration +- `showcase` – Live examples of Sprotty diagrams + +## How to generate reference documentation + +The reference documentation is generated using [TypeDoc](https://typedoc.org/) and requires manual steps in order to be integrated into the website structure. + +1. Install typedoc and typedoc-plugin-markdown globally + + ```bash + npm i -g typedoc typedoc-plugin-markdown + ``` + +2. Navigate to the package you want to create the reference for (ex: sprotty-protocol) + +3. Generate documentation + + ```bash + npx typedoc src/index --skipErrorChecking --plugin typedoc-plugin-markdown --flattenOutputFiles + ``` + +4. This should have generated a new docs folder with many markdown files in the root of the package + +5. Copy the content of this folder into the correct place in sprotty-website (hugo/content/docs/ref/[library]). + +6. In sprotty-website run the `process-docs` script. This is needed to adapt the generated links to what hugo is expecting + + ```bash + npm run process-docs + ```