Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logic to switch between source/rendered on Markdown #19356

Merged
merged 6 commits into from
Apr 10, 2022

Conversation

Gusted
Copy link
Contributor

@Gusted Gusted commented Apr 9, 2022

- Adds a button to switch between the source blob and the rendered blob.
Currently these buttons are only shown for markdown files, it is the only blob
that can be shown rendered and shown source without having to show raw
binary code.
- Resolves go-gitea#11259
@Gusted Gusted added this to the 1.17.0 milestone Apr 9, 2022
@Gusted Gusted added type/enhancement An improvement of existing functionality topic/ui Change the appearance of the Gitea UI labels Apr 9, 2022
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 9, 2022
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Apr 9, 2022

There is already a raw button beside to get the origin content?

Hmm ... the raw doesn't show line numbers 😂

@Gusted
Copy link
Contributor Author

Gusted commented Apr 9, 2022

Hmm ... the raw doesn't show line numbers joy

Yeah and it's really raw, so it won't be shown within the WebUI

templates/repo/view_file.tmpl Outdated Show resolved Hide resolved
options/locale/locale_en-US.ini Outdated Show resolved Hide resolved
@Gusted
Copy link
Contributor Author

Gusted commented Apr 9, 2022

Seems like there was already UI to switch between source/render so:

Rendered:
image

Source:
image

@Gusted Gusted changed the title Add button to switch between source and rendered blob Add logic to switch between source/rendered on Markdown Apr 9, 2022
routers/web/repo/view.go Outdated Show resolved Hide resolved
Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

routers/web/repo/view.go Outdated Show resolved Hide resolved
routers/web/repo/view.go Outdated Show resolved Hide resolved
routers/web/repo/view.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 9, 2022
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 10, 2022
@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (main@6d51b9f). Click here to learn what that means.
The diff coverage is 88.88%.

@@           Coverage Diff           @@
##             main   #19356   +/-   ##
=======================================
  Coverage        ?   47.39%           
=======================================
  Files           ?      949           
  Lines           ?   132090           
  Branches        ?        0           
=======================================
  Hits            ?    62603           
  Misses          ?    61951           
  Partials        ?     7536           
Impacted Files Coverage Δ
routers/web/repo/view.go 40.02% <88.88%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6d51b9f...84274ca. Read the comment docs.

@wxiaoguang wxiaoguang merged commit ee769f7 into go-gitea:main Apr 10, 2022
@Gusted Gusted deleted the add-source-rendered-blob-button branch April 10, 2022 16:32
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 11, 2022
* giteaofficial/main: (22 commits)
  Add logic to switch between source/rendered on Markdown (go-gitea#19356)
  Fixed registry host value. (go-gitea#19363)
  [skip ci] Updated translations via Crowdin
  Allow package linking to private repository (go-gitea#19348)
  Use "main" as default branch name (go-gitea#19354)
  Move milestone to models/issues/ (go-gitea#19278)
  Refactor CSRF protection modules, make sure CSRF tokens can be up-to-date. (go-gitea#19337)
  Remove dependent on session auth for api/v1 routers (go-gitea#19321)
  API: Search Issues, dont show 500 if filter result in empty list (go-gitea#19244)
  [skip ci] Updated translations via Crowdin
  Never use /api/v1 from Gitea UI Pages (go-gitea#19318)
  [skip ci] Updated translations via Crowdin
  Show ssh command directly in template instead of i18n translation (go-gitea#19335)
  Package registry changes (go-gitea#19305)
  [skip ci] Updated translations via Crowdin
  Add `ENABLE_SSH_LOG` to debugging problems (go-gitea#19316)
  Warn on SSH connection for incorrect configuration (go-gitea#19317)
  escape fake link
  Allow custom redirect for landing page (go-gitea#19324)
  [skip ci] Updated translations via Crowdin
  ...
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this pull request Aug 24, 2022
Adds a button to switch between the source blob and the rendered markdown.
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. outdated/theme/markdown topic/ui Change the appearance of the Gitea UI type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add possibility to display line numbers in Markdown files
5 participants