Commit graph

210 commits

Author SHA1 Message Date
Jordan Welch
58c088977e
Fix color preference order 2023-09-19 19:04:02 -05:00
Jordan Welch
c22febdbd6
Adjust colors for line-by-line 2023-09-19 19:04:01 -05:00
Jordan Welch
1b0c1a87a2
swap highlight and base 2023-09-19 19:04:01 -05:00
Jordan Welch
0b76161d86
Use variables for dark mode 2023-09-19 19:04:00 -05:00
Jordan Welch
6ed6a5da88
Setup Auto color mode 2023-09-19 19:04:00 -05:00
Jordan Welch
47000723a9
Consolidate dark classes 2023-09-19 19:04:00 -05:00
Jordan Welch
6b420de752
est auto color scheme 2023-09-19 19:03:59 -05:00
Jordan Welch
bd4a84cd3e
Update colors 2023-09-19 19:03:59 -05:00
Jordan Welch
1aafcb201b
Add dark mode classes. 2023-09-19 19:03:59 -05:00
Jordan Welch
4d2505dac8
Normalize class names 2023-09-19 19:03:59 -05:00
Jordan Welch
ff3a86d393
Add colorscheme variable to wrapper 2023-09-19 19:03:58 -05:00
Jordan Welch
5dae945e95
Add initial dark mode css classes 2023-09-19 19:03:57 -05:00
Jordan Welch
66912a3a54
reorganize/rename blocks to match tested functions 2023-09-11 22:48:23 -05:00
Rodrigo Fernandes
f6f05db2f6
fallback to plaintext when highlighting unloaded language 2023-08-27 21:37:39 +01:00
Rodrigo Fernandes
409b5e2f6b tweak tsconfig 2023-08-06 19:28:46 +01:00
Rodrigo Fernandes
7a3a4398d1 fix vertical align on diff 2023-04-15 14:12:08 +01:00
Rodrigo Fernandes
68515376a1
Merge pull request #483 from phikes/hand-in-file-line-to-template
feat: hand in file/line to generic line template
2023-03-07 19:34:03 +00:00
Siddhant
32239a0b9d
Precise widths for code-line and code-side-line
The widths of these are now calculated based on:
100% minus the horizontal padding
2023-02-28 19:17:07 -06:00
Phillip Kessels
0d314aecd1
feat: hand in file/line to generic line template 2023-02-20 15:07:34 +00:00
Rodrigo Fernandes
a716739a18 support unix diff binaires 2023-01-20 23:00:34 +00:00
Rodrigo Fernandes
ca2397830c fix-broken-header-ff 2023-01-20 22:27:44 +00:00
Rodrigo Fernandes
d0ead3a14c tweak css 2023-01-06 23:32:58 +00:00
fpin
df005c3f06 fix #462: Info lines shrunk in right panel of side-by-side diff 2023-01-02 16:17:16 +01:00
Eric Cornelissen
3a480e4ab0 perf: check hljs is not null only once
Update the `highlightCode` method of `Diff2HtmlUI` to check if the hljs
reference is null only once (at the start). This address the "HACK"
comments by using a locally scoped variable for hljs. This way,
TypeScript is able to deduce that, after the initial null-check, hljs is
in fact not null.
2022-11-02 22:43:23 +01:00
Rodrigo Fernandes
6db4aae9e5
Merge pull request #456 from ericcornelissen/455-sticky-file-headers
Implement support for sticky file headers
2022-11-01 00:14:45 +00:00
Eric Cornelissen
4dae65d5c7 feat: enable sticky file headers by default
Update the stickyFileHeaders default value to `true` so that it is
enabled by default. Also correct the name of this option in the
documentation by adding the missing trailing "s".
2022-10-31 09:47:31 +01:00
Rodrigo Fernandes
5ca9d22276 fix side by side margins and highlight usage of object instead of map 2022-10-30 20:31:33 +00:00
Eric Cornelissen
7d4a5dce6f feat: sticky file headers
Add support for sticky file headers by adding a `stickyFileHeaders`
option to the `Diff2HtmlUI`. By default this feature is disabled. Also
document this option in the README.

The feature is implemented through an optional CSS class on top of the
pre-existing `.d2h-file-header` class. The new class is added on all
file headers if the option is set to `true` (or the `stickyFileHeaders`
method is called).

This class, `.d2h-sticky-header`, has the minimum amount of styling to
get the desired effect. The `position` and `top` values make the headers
stick to the top as long as the wrapper is in the view. The `z-index`
value is needed to ensure the header is displayed over all other content
in the wrapper. In particular, from my testing in Firefox (106.0.2), the
line numbers would display over the header if the `z-index` value isn't
set.
2022-10-30 13:05:53 +01:00
Rodrigo Fernandes
5373ae180b add support for language override 2022-10-23 18:26:19 +01:00
Rodrigo Fernandes
a09d50a94f bump dependencies 2022-10-16 00:01:01 +01:00
Evan Bovie
a3a0385991 fix prettier complaint 2022-08-25 19:51:21 +00:00
Evan Bovie
a5e2fab2f1
Fix file collapse UI regression
Increase specificity of .d2h-d-none selector
2022-08-25 12:09:43 -07:00
森 雅希
41037b20f3 Set display:flex to align inline-block elements 2022-07-13 19:16:07 +09:00
Rodrigo Fernandes
72b0610d2c
bump: Update all dependencies 2021-10-15 21:29:07 +01:00
Rodrigo Fernandes
e44b4b1363
fix: Add language mappings for highlight.js 2021-09-03 23:26:31 +01:00
Rodrigo Fernandes
7253dbb900 fix: Remove display block to allow hidding file contents 2021-09-01 15:39:34 +00:00
Rodrigo Fernandes
6572b68bf2
bump: Update dependencies 2021-07-23 21:50:00 +01:00
Rodrigo Fernandes
6ad7f00be2
clean: Improve git diff support 2021-07-09 22:35:27 +01:00
Mohamed Akram
ac9e2ce706 Remove redundant HTML classes 2021-05-29 02:08:47 +04:00
Pierric Cistac
bf7b52ad30
regroup handling of diffMaxLineLength and diffMaxChanges in parser 2021-03-11 18:17:33 -05:00
Pierric Cistac
a4e619efa4
feature: new diffMaxLineLength
Mark a file diff as too big if diff line length > threshold
2021-03-11 18:10:14 -05:00
Rodrigo Fernandes
38a9d8f93e
Merge pull request #365 from huggingface/diff-max-lines
feature: bypass parsing/rendering of file diff if specific threshold is crossed
2021-03-04 22:41:02 +00:00
Pierric Cistac
7668889493
fix: only display "Viewed" checkbox if fileContentToggle is set 2021-03-01 17:17:08 -05:00
Pierric Cistac
a65a3b9562
update tests 2021-03-01 16:05:12 -05:00
Pierric Cistac
f220ca11e4
move everything inside parser 2021-03-01 14:48:12 -05:00
Pierric Cistac
5915ecdaa1
feature: display message instead of diff if isTooBig is true
A default `Diff too big to be displayed` message is rendered for any file diff where `isTooBig` is `true`.

A new `diffTooBigMessage` option in render config allows to fully customize the message and receives the file index in the diff as an argument. It can be used to render a link to the raw file diff for example.
2021-02-25 14:08:18 -05:00
Pierric Cistac
ea9c1fee48
feature: new diffMaxChanges in parser config
If `diffMaxChanges` is set in parser config, and its value is exceeded for a given file diff, then parsing for this file is stopped, and `isTooBig` is set to `true` in the `DiffFile`
2021-02-25 14:02:43 -05:00
Civan Yavuzsen
9e831469a5 fix: remove unnesesary height property in d2h-files-diff class 2021-02-07 03:27:57 +03:00
Rafael Cortês
242fc5ae7b
feature: Add selected state style 2021-01-23 22:32:50 +00:00
Rafael Cortês
49bf898e0e
clean: Refactor font style 2021-01-23 22:18:03 +00:00