Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
aec2c12e
Commit
aec2c12e
authored
Nov 04, 2021
by
Eduardo Bonet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Highlighting transformed ipynb diffs
parent
22cb2366
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
app/presenters/blob_presenter.rb
app/presenters/blob_presenter.rb
+5
-1
No files found.
app/presenters/blob_presenter.rb
View file @
aec2c12e
...
...
@@ -27,7 +27,7 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated
Gitlab
::
Highlight
.
highlight
(
blob
.
path
,
transformed_blob_data
,
language:
language
,
language:
transformed_blob_
language
,
plain:
plain
)
end
...
...
@@ -120,6 +120,10 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated
blob
.
language_from_gitattributes
end
def
transformed_blob_language
@transformed_blob_language
||=
blob
.
path
.
ends_with?
(
'.ipynb'
)
?
"md"
:
language
end
def
transformed_blob_data
@transformed_blob
||=
if
blob
.
path
.
ends_with?
(
'.ipynb'
)
new_blob
=
IpynbDiff
.
transform
(
blob
.
data
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment