Use a generic markup class to display externally rendered files and diffs #15735

Merged
6543 merged 26 commits from markup into main 2021-05-07 08:43:41 +00:00
6543 commented 2021-05-05 15:37:42 +00:00 (Migrated from github.com)

This pull is based on #12261


This PR will be a follow-on from https://github.com/go-gitea/gitea/issues/8299 and https://github.com/go-gitea/gitea/issues/7614.

It builds on the work done in https://github.com/go-gitea/gitea/pull/8300 and the patch https://github.com/go-gitea/gitea/pull/8357

The idea is to have a generic class .markup that has some default rendering, that is near identical to the current .markdown

More details

The current .markdown is defined at

https://github.com/go-gitea/gitea/blob/master/web_src/less/_markdown.less

and overwritten at:

84a419de98/web_src/less/themes/theme-arc-green.less (L851-L885)

and

84a419de98/web_src/less/themes/theme-arc-green.less (L1856-L1867)

⚠️ BREAKING ⚠️

Administrators with css/less customization targeting the .markdown class should update these to use .markup.

This pull is based on #12261 --- This PR will be a follow-on from https://github.com/go-gitea/gitea/issues/8299 and https://github.com/go-gitea/gitea/issues/7614. It builds on the work done in https://github.com/go-gitea/gitea/pull/8300 and the patch https://github.com/go-gitea/gitea/pull/8357 The idea is to have a generic class `.markup` that has some default rendering, that is near identical to the current `.markdown` <details><summary>More details</summary> The current `.markdown` is defined at https://github.com/go-gitea/gitea/blob/master/web_src/less/_markdown.less and overwritten at: https://github.com/go-gitea/gitea/blob/84a419de98701fe1e8a0d7f1be5d82c7f5e4ac92/web_src/less/themes/theme-arc-green.less#L851-L885 and https://github.com/go-gitea/gitea/blob/84a419de98701fe1e8a0d7f1be5d82c7f5e4ac92/web_src/less/themes/theme-arc-green.less#L1856-L1867 </details> ## :warning: BREAKING :warning: Administrators with css/less customization targeting the `.markdown` class should update these to use `.markup`.
silverwind (Migrated from github.com) reviewed 2021-05-05 15:59:48 +00:00
silverwind (Migrated from github.com) commented 2021-05-05 15:59:48 +00:00
## Customizing CSS

American variant is probably more proper for docs.

```suggestion ## Customizing CSS ``` American variant is probably more proper for docs.
silverwind (Migrated from github.com) reviewed 2021-05-05 16:00:27 +00:00
silverwind (Migrated from github.com) commented 2021-05-05 16:00:26 +00:00

Maybe drop this :not(code) and see what breaks, if anything at all? Might need to check git history why it was added in first place.

Maybe drop this `:not(code)` and see what breaks, if anything at all? Might need to check git history why it was added in first place.
silverwind (Migrated from github.com) reviewed 2021-05-05 16:30:26 +00:00
silverwind (Migrated from github.com) commented 2021-05-05 16:30:26 +00:00
rg markdown.+code templates
rg code.+markdown templates

No relevant matches.

``` rg markdown.+code templates rg code.+markdown templates ``` No relevant matches.
silverwind (Migrated from github.com) reviewed 2021-05-05 16:31:55 +00:00
silverwind (Migrated from github.com) commented 2021-05-05 16:31:54 +00:00

Git history points to it being related to webhook: c2ca103d30.

Git history points to it being related to webhook: https://github.com/go-gitea/gitea/commit/c2ca103d30b0f47b5ad0fa544ab5a07263894ea3.
silverwind (Migrated from github.com) reviewed 2021-05-05 16:37:37 +00:00
silverwind (Migrated from github.com) commented 2021-05-05 16:37:37 +00:00

Webhook delivery list looks fine with the removal, let's do this.

Webhook delivery list looks fine with the removal, let's do this.
silverwind (Migrated from github.com) reviewed 2021-05-05 16:53:24 +00:00
silverwind (Migrated from github.com) commented 2021-05-05 16:53:24 +00:00

Pushed this change.

Pushed this change.
silverwind (Migrated from github.com) reviewed 2021-05-05 17:08:41 +00:00
silverwind (Migrated from github.com) commented 2021-05-05 17:08:41 +00:00

{{if ne "csv" .MarkupType}}{{end}} was noop here, fyi.

`{{if ne "csv" .MarkupType}}{{end}}` was noop here, fyi.
silverwind (Migrated from github.com) approved these changes 2021-05-05 17:08:46 +00:00
silverwind (Migrated from github.com) reviewed 2021-05-05 18:14:33 +00:00
@ -0,0 +473,4 @@
kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
silverwind (Migrated from github.com) commented 2021-05-05 18:14:33 +00:00

Where do these come from? I see no related CSS class changes, are they dead code?

Where do these come from? I see no related CSS class changes, are they dead code?
6543 (Migrated from github.com) reviewed 2021-05-05 18:15:48 +00:00
@ -0,0 +473,4 @@
kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
6543 (Migrated from github.com) commented 2021-05-05 18:15:47 +00:00

no idear either

no idear either
silverwind (Migrated from github.com) reviewed 2021-05-05 18:30:25 +00:00
@ -0,0 +473,4 @@
kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
silverwind (Migrated from github.com) commented 2021-05-05 18:30:25 +00:00

I think @HarvsG might have added them during testing and Github's CSS includes a same-name class but given that we never actually output such HTML in first place, let's remove it. If CSV rendering it added to our markdown, the CSS for it should be added along with that.

I think @HarvsG might have added them during testing and Github's CSS includes a same-name class but given that we never actually output such HTML in first place, let's remove it. If CSV rendering it added to our markdown, the CSS for it should be added along with that.
silverwind (Migrated from github.com) reviewed 2021-05-05 18:31:14 +00:00
@ -0,0 +473,4 @@
kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
silverwind (Migrated from github.com) commented 2021-05-05 18:31:14 +00:00

Removed them.

Removed them.
6543 (Migrated from github.com) reviewed 2021-05-05 18:49:30 +00:00
6543 (Migrated from github.com) left a comment

LGTM from my side ... :)

LGTM from my side ... :)
lunny reviewed 2021-05-07 05:00:13 +00:00
@ -0,0 +12,4 @@
} else if (id.startsWith('user-content-')) { // compat for links with old 'user-content-' prefixed hashes
const el = document.getElementById(id);
if (el) el.scrollIntoView();
}

initMarkupAnchors?

`initMarkupAnchors`?
zeripath approved these changes 2021-05-07 06:07:22 +00:00
silverwind (Migrated from github.com) reviewed 2021-05-07 06:35:55 +00:00
@ -0,0 +12,4 @@
} else if (id.startsWith('user-content-')) { // compat for links with old 'user-content-' prefixed hashes
const el = document.getElementById(id);
if (el) el.scrollIntoView();
}
silverwind (Migrated from github.com) commented 2021-05-07 06:35:55 +00:00

Fixed, renamed and changed these to named exports.

Fixed, renamed and changed these to named exports.
This repo is archived. You cannot comment on pull requests.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lunny/gitea#15735
No description provided.