소스 검색

markdown: support rendering Mermaid diagrams (#6776)

Co-authored-by: Joe Chen <jc@unknwon.io>
shuyue 3 년 전
부모
커밋
7c893a58da
6개의 변경된 파일1738개의 추가작업 그리고 1726개의 파일을 삭제
  1. 1 0
      CHANGELOG.md
  2. 241 241
      internal/assets/conf/conf_gen.go
  3. 1338 1337
      internal/assets/public/public_gen.go
  4. 148 148
      internal/assets/templates/templates_gen.go
  5. 1 0
      public/plugins/mermaid-8.14.0/mermaid.min.js
  6. 9 0
      templates/base/footer.tmpl

+ 1 - 0
CHANGELOG.md

@@ -10,6 +10,7 @@ All notable changes to Gogs are documented in this file.
 - New configuration option `[git.timeout] DIFF` for customizing operation timeout of `git diff`. [#6315](https://github.com/gogs/gogs/issues/6315)
 - New configuration option `[server] SSH_SERVER_MACS` for setting list of accepted MACs for connections to builtin SSH server. [#6434](https://github.com/gogs/gogs/issues/6434)
 - Support specifying custom schema for PostgreSQL. [#6695](https://github.com/gogs/gogs/pull/6695)
+- Support rendering Mermaid diagrams in Markdown. [#6776](https://github.com/gogs/gogs/pull/6776)
 - New languages support: Mongolian. [#6510](https://github.com/gogs/gogs/pull/6510)
 
 ### Changed

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 241 - 241
internal/assets/conf/conf_gen.go


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1338 - 1337
internal/assets/public/public_gen.go


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 148 - 148
internal/assets/templates/templates_gen.go


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 0
public/plugins/mermaid-8.14.0/mermaid.min.js


+ 9 - 0
templates/base/footer.tmpl

@@ -58,6 +58,15 @@
 {{if .RequireAutosize}}
 	<script src="{{AppSubURL}}/plugins/autosize-4.0.2/autosize.min.js"></script>
 {{end}}
+{{if .IsMarkdown}}
+	<script src="{{AppSubURL}}/plugins/mermaid-8.14.0/mermaid.min.js"></script>
+	<script>
+		$(document).ready(function () {
+			mermaid.init({startOnLoad: true, noteMargin: 10}, ".language-mermaid");
+		});
+	</script>
+{{end}}
+
 <script src="{{AppSubURL}}/js/libs/emojify-1.1.0.min.js"></script>
 <script src="{{AppSubURL}}/js/libs/clipboard-2.0.4.min.js"></script>
 

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.