diff options
author | 6543 <6543@obermui.de> | 2021-05-07 10:43:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-07 10:43:41 +0200 |
commit | 640066840e23367d9d13e92d786b877448ae9329 (patch) | |
tree | e419f42d40a904b0b16302f3710914902f5366c0 /templates/repo | |
parent | 9b5185d3cc0bd63d7387655bedaeea6340695d95 (diff) | |
download | gitea-640066840e23367d9d13e92d786b877448ae9329.tar.gz gitea-640066840e23367d9d13e92d786b877448ae9329.zip |
Use a generic markup class to display externally rendered files and diffs (#15735)
* creates and implements generic markup less class
* How to give custom CSS to externally rendered html
* Clarifies sources of CSS styling of markup
* further clarification of sources of markup styling
* rename _markdown to _markup
* remove defunct import
* fix orphaned reference
* Update docs/content/doc/advanced/external-renderers.en-us.md
* more renames markdown -> markup
* do not suggest less customization
* add back tokens
* fix class whitespace, remove useless if-clause
* remove unused csv-data rules
* use named exports and rename functions
* sort imports
Co-authored-by: HarvsG <11440490+HarvsG@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/diff/box.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/diff/comment_form.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/diff/comments.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/editor/edit.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/empty.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/issue/comment_tab.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/milestone_issues.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/milestones.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/view_content.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/issue/view_content/comments.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/release/list.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/release/new.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/settings/lfs_file.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/view_file.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/wiki/view.tmpl | 2 |
15 files changed, 21 insertions, 21 deletions
diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 9a2f7bdd7f..582b66d5db 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -164,7 +164,7 @@ <div class="ui bottom attached active write tab segment"> <textarea class="review-textarea" tabindex="1" name="content"></textarea> </div> - <div class="ui bottom attached tab preview segment markdown"> + <div class="ui bottom attached tab preview segment markup"> {{$.i18n.Tr "loading"}} </div> <div class="text right edit buttons"> diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl index c82d32c214..628cd52dc2 100644 --- a/templates/repo/diff/comment_form.tmpl +++ b/templates/repo/diff/comment_form.tmpl @@ -22,12 +22,12 @@ <div class="ui active tab" data-tab="write"> <textarea name="content" placeholder="{{$.root.i18n.Tr "repo.diff.comment.placeholder"}}"></textarea> </div> - <div class="ui tab markdown" data-tab="preview"> + <div class="ui tab markup" data-tab="preview"> {{.i18n.Tr "loading"}} </div> </div> <div class="field footer"> - <span class="markdown-info">{{svg "octicon-markdown"}} {{$.root.i18n.Tr "repo.diff.comment.markdown_info"}}</span> + <span class="markup-info">{{svg "octicon-markup"}} {{$.root.i18n.Tr "repo.diff.comment.markup_info"}}</span> <div class="ui right"> {{if $.reply}} <button class="ui submit green tiny button btn-reply" type="submit">{{$.root.i18n.Tr "repo.diff.comment.reply"}}</button> diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index b566ffce9a..6e39fbe854 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -51,7 +51,7 @@ </div> </div> <div class="ui attached segment comment-body"> - <div class="render-content markdown"> + <div class="render-content markup"> {{if .RenderedContent}} {{.RenderedContent|Str2html}} {{else}} diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl index 3efde70f50..b7e1589aa1 100644 --- a/templates/repo/editor/edit.tmpl +++ b/templates/repo/editor/edit.tmpl @@ -44,7 +44,7 @@ {{.FileContent}}</textarea> <div class="editor-loading is-loading"></div> </div> - <div class="ui bottom attached tab segment markdown" data-tab="preview"> + <div class="ui bottom attached tab segment markup" data-tab="preview"> {{.i18n.Tr "loading"}} </div> <div class="ui bottom attached tab segment diff edit-diff" data-tab="diff"> diff --git a/templates/repo/empty.tmpl b/templates/repo/empty.tmpl index 7dae7c0121..21c6005456 100644 --- a/templates/repo/empty.tmpl +++ b/templates/repo/empty.tmpl @@ -27,7 +27,7 @@ <div class="item"> <h3>{{.i18n.Tr "repo.create_new_repo_command"}}</h3> - <div class="markdown"> + <div class="markup"> <pre><code>touch README.md git init {{if ne .Repository.DefaultBranch "master"}}git checkout -b {{.Repository.DefaultBranch}}{{end}} @@ -41,7 +41,7 @@ git push -u origin {{.Repository.DefaultBranch}}</code></pre> <div class="item"> <h3>{{.i18n.Tr "repo.push_exist_repo"}}</h3> - <div class="markdown"> + <div class="markup"> <pre><code>git remote add origin <span class="clone-url">{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}</span> git push -u origin {{.Repository.DefaultBranch}}</code></pre> </div> diff --git a/templates/repo/issue/comment_tab.tmpl b/templates/repo/issue/comment_tab.tmpl index ab874bdd13..77e82930dc 100644 --- a/templates/repo/issue/comment_tab.tmpl +++ b/templates/repo/issue/comment_tab.tmpl @@ -8,7 +8,7 @@ {{- if .BodyQuery}}{{.BodyQuery}}{{else if .IssueTemplate}}{{.IssueTemplate}}{{else if .PullRequestTemplate}}{{.PullRequestTemplate}}{{else}}{{.content}}{{end -}} </textarea> </div> - <div class="ui bottom tab markdown" data-tab="preview"> + <div class="ui bottom tab markup" data-tab="preview"> {{.i18n.Tr "loading"}} </div> </div> diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl index 8c2f36f04b..897d297d37 100644 --- a/templates/repo/issue/milestone_issues.tmpl +++ b/templates/repo/issue/milestone_issues.tmpl @@ -5,7 +5,7 @@ <div class="ui three column stackable grid"> <div class="column"> <h1>{{.Milestone.Name}}</h1> - <div class="markdown content"> + <div class="markup content"> {{.Milestone.RenderedContent|Str2html}} </div> </div> diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl index c7d3522abc..448d758e3e 100644 --- a/templates/repo/issue/milestones.tmpl +++ b/templates/repo/issue/milestones.tmpl @@ -98,7 +98,7 @@ </div> {{end}} {{if .Content}} - <div class="markdown content"> + <div class="markup content"> {{.RenderedContent|Str2html}} </div> {{end}} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 0482604b70..e353d71ee9 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -57,7 +57,7 @@ </div> </div> <div class="ui attached segment comment-body"> - <div class="render-content markdown"> + <div class="render-content markup"> {{if .Issue.RenderedContent}} {{.Issue.RenderedContent|Str2html}} {{else}} @@ -191,7 +191,7 @@ <div class="ui bottom active tab write"> <textarea tabindex="1" name="content"></textarea> </div> - <div class="ui bottom tab preview markdown"> + <div class="ui bottom tab preview markup"> {{$.i18n.Tr "loading"}} </div> </div> diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 81f0d0434a..4863f7f2f1 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -64,7 +64,7 @@ </div> </div> <div class="ui attached segment comment-body"> - <div class="render-content markdown"> + <div class="render-content markup"> {{if .RenderedContent}} {{.RenderedContent|Str2html}} {{else}} @@ -442,7 +442,7 @@ </span> </div> <div class="ui attached segment comment-body"> - <div class="render-content markdown"> + <div class="render-content markup"> {{if .RenderedContent}} {{.RenderedContent|Str2html}} {{else}} @@ -552,7 +552,7 @@ </div> </div> <div class="text comment-content"> - <div class="render-content markdown"> + <div class="render-content markup"> {{if .RenderedContent}} {{.RenderedContent|Str2html}} {{else}} @@ -739,7 +739,7 @@ </span> </div> <div class="ui attached segment"> - <div class="render-content markdown"> + <div class="render-content markup"> {{if .RenderedContent}} {{.RenderedContent|Str2html}} {{else}} diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index 63f9e26cf1..d98e441644 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -136,7 +136,7 @@ | <span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | EscapePound}}...{{.Target}}">{{$.i18n.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{$.i18n.Tr "repo.release.ahead.target" .Target}}</span> {{end}} </p> - <div class="markdown desc"> + <div class="markup desc"> {{Str2html .Note}} </div> <div class="ui accordion download"> diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl index 8489d89597..c4b36597c6 100644 --- a/templates/repo/release/new.tmpl +++ b/templates/repo/release/new.tmpl @@ -53,7 +53,7 @@ <div class="ui bottom active tab" data-tab="write"> <textarea name="content">{{.content}}</textarea> </div> - <div class="ui bottom tab markdown" data-tab="preview"> + <div class="ui bottom tab markup" data-tab="preview"> {{$.i18n.Tr "loading"}} </div> </div> diff --git a/templates/repo/settings/lfs_file.tmpl b/templates/repo/settings/lfs_file.tmpl index 09eeb3f27f..478c034e11 100644 --- a/templates/repo/settings/lfs_file.tmpl +++ b/templates/repo/settings/lfs_file.tmpl @@ -12,7 +12,7 @@ </div> </h4> <div class="ui attached table unstackable segment"> - <div class="file-view {{if .IsMarkup}}markdown{{else if .IsRenderedHTML}}plain-text{{else if .IsTextFile}}code-view{{end}}"> + <div class="file-view{{if .IsMarkup}} markup {{.MarkupType}}{{else if .IsRenderedHTML}} plain-text{{else if .IsTextFile}} code-view{{end}}"> {{if .IsMarkup}} {{if .FileContent}}{{.FileContent | Safe}}{{end}} {{else if .IsRenderedHTML}} diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index d9c1e93eaf..5798ec875c 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -64,7 +64,7 @@ {{end}} </h4> <div class="ui attached table unstackable segment"> - <div class="file-view {{if .IsMarkup}}{{.MarkupType}} {{if ne "csv" .MarkupType}}markdown{{end}}{{else if .IsRenderedHTML}}plain-text{{else if .IsTextSource}}code-view{{end}}"> + <div class="file-view{{if .IsMarkup}} markup {{.MarkupType}}{{else if .IsRenderedHTML}} plain-text{{else if .IsTextSource}} code-view{{end}}"> {{if .IsMarkup}} {{if .FileContent}}{{.FileContent | Safe}}{{end}} {{else if .IsRenderedHTML}} diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl index 0bc5858863..fbb97db4ad 100644 --- a/templates/repo/wiki/view.tmpl +++ b/templates/repo/wiki/view.tmpl @@ -61,7 +61,7 @@ </div> {{end}} <div class="ui {{if .sidebarPresent}}grid equal width{{end}}" style="margin-top: 1rem;"> - <div class="ui {{if .sidebarPresent}}eleven wide column{{end}} segment markdown"> + <div class="ui {{if .sidebarPresent}}eleven wide column{{end}} segment markup"> {{.content | Str2html}} </div> {{if .sidebarPresent}} |