Skip to content

support mermaid uml#6630

Closed
free1139 wants to merge 3 commits intogogs:release/0.12from
free1139:feat/mermaid
Closed

support mermaid uml#6630
free1139 wants to merge 3 commits intogogs:release/0.12from
free1139:feat/mermaid

Conversation

@free1139
Copy link
Contributor

Trying to support mermaid issue #4229 .

I found that need to ran make not go build to took effect.

Test the mermaid's diagrams were passed.

```mermaid
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
```
```mermaid
sequenceDiagram
    participant Alice
    participant Bob
    Alice->>John: Hello John, how are you?
    loop Healthcheck
        John->>John: Fight against hypochondria
    end
    Note right of John: Rational thoughts <br/>prevail!
    John-->>Alice: Great!
    John->>Bob: How about you?
    Bob-->>John: Jolly good!
```

The renderings
image

@unknwon
Copy link
Member

unknwon commented Oct 22, 2021

Thanks @free1139!

Few notes:

  1. Release branch only get cherry-picked commits for patch releases, so you should target main at all time.
  2. Could you include a copy of pinned version for the JS file into https://github.com/gogs/gogs/tree/main/public/plugins, and link from it. We don't use CDN because this could be ran in a restricted network environment.

@unknwon
Copy link
Member

unknwon commented Oct 22, 2021

Also the script should be included here:

<!-- Third-party libraries -->
{{if .RequireHighlightJS}}
<link rel="stylesheet" href="{{AppSubURL}}/plugins/highlight-9.18.0/github.css">
<script src="{{AppSubURL}}/plugins/highlight-9.18.0/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
{{end}}
{{if .RequireMinicolors}}
<link rel="stylesheet" href="{{AppSubURL}}/plugins/jquery.minicolors-2.2.3/jquery.minicolors.css">
<script src="{{AppSubURL}}/plugins/jquery.minicolors-2.2.3/jquery.minicolors.min.js"></script>
{{end}}
{{if .RequireDatetimepicker}}
<link rel="stylesheet" href="{{AppSubURL}}/plugins/jquery.datetimepicker-2.4.5/jquery.datetimepicker.css">
<script src="{{AppSubURL}}/plugins/jquery.datetimepicker-2.4.5/jquery.datetimepicker.js"></script>
{{end}}
{{if .RequireDropzone}}
<link rel="stylesheet" href="{{AppSubURL}}/plugins/dropzone-5.5.0/dropzone.min.css">
<script src="{{AppSubURL}}/plugins/dropzone-5.5.0/dropzone.min.js"></script>
<script>Dropzone.autoDiscover = false</script>
{{end}}
{{if .RequireAutosize}}
<script src="{{AppSubURL}}/plugins/autosize-4.0.2/autosize.min.js"></script>
{{end}}
, along with other third party plugins.

@free1139
Copy link
Contributor Author

Thanks @free1139!

Few notes:

  1. Release branch only get cherry-picked commits for patch releases, so you should target main at all time.
  2. Could you include a copy of pinned version for the JS file into https://github.com/gogs/gogs/tree/main/public/plugins, and link from it. We don't use CDN because this could be ran in a restricted network environment.

Yeah, it's much better after removing CDN. I used it for a while and found that CDN is not very easy to download.

I have made corrections. If you think it is appropriate, I will submit this PR again based on the main branch. At present, there are too many conflicts with the main branch, and I need a stable branch to be used in the production environment.

@free1139
Copy link
Contributor Author

This PR move to
#6776

@free1139 free1139 closed this Feb 20, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants