-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Upgrade rubygem versions. #19716
base: main
Are you sure you want to change the base?
Upgrade rubygem versions. #19716
Changes from 2 commits
578aac1
9e568ed
5683ee7
d985f72
28bb25f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
# To build the spec on Travis CI | ||
source "https://rubygems.org" | ||
ruby "3.3" | ||
|
||
gem "jekyll", "3.6.3" | ||
gem "webrick" | ||
gem "rouge" | ||
# gem 's3_website' | ||
gem "redcarpet", "3.5.1" | ||
gem "jekyll", "4.3.3" | ||
gem "rexml" | ||
gem "sass-embedded" | ||
gem "csv" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,78 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
addressable (2.8.1) | ||
addressable (2.8.6) | ||
public_suffix (>= 2.0.2, < 6.0) | ||
colorator (1.1.0) | ||
ffi (1.15.5) | ||
concurrent-ruby (1.2.3) | ||
csv (3.2.8) | ||
em-websocket (0.5.3) | ||
eventmachine (>= 0.12.9) | ||
http_parser.rb (~> 0) | ||
eventmachine (1.2.7) | ||
ffi (1.16.3) | ||
forwardable-extended (2.6.0) | ||
jekyll (3.6.3) | ||
google-protobuf (3.25.3-x86_64-linux) | ||
http_parser.rb (0.8.0) | ||
i18n (1.14.1) | ||
concurrent-ruby (~> 1.0) | ||
jekyll (4.3.3) | ||
addressable (~> 2.4) | ||
colorator (~> 1.0) | ||
jekyll-sass-converter (~> 1.0) | ||
jekyll-watch (~> 1.1) | ||
kramdown (~> 1.14) | ||
em-websocket (~> 0.5) | ||
i18n (~> 1.0) | ||
jekyll-sass-converter (>= 2.0, < 4.0) | ||
jekyll-watch (~> 2.0) | ||
kramdown (~> 2.3, >= 2.3.1) | ||
kramdown-parser-gfm (~> 1.0) | ||
liquid (~> 4.0) | ||
mercenary (~> 0.3.3) | ||
mercenary (>= 0.3.6, < 0.5) | ||
pathutil (~> 0.9) | ||
rouge (>= 1.7, < 3) | ||
rouge (>= 3.0, < 5.0) | ||
safe_yaml (~> 1.0) | ||
jekyll-sass-converter (1.5.2) | ||
sass (~> 3.4) | ||
jekyll-watch (1.5.1) | ||
terminal-table (>= 1.8, < 4.0) | ||
webrick (~> 1.7) | ||
jekyll-sass-converter (3.0.0) | ||
sass-embedded (~> 1.54) | ||
jekyll-watch (2.2.1) | ||
listen (~> 3.0) | ||
kramdown (1.17.0) | ||
liquid (4.0.3) | ||
listen (3.7.1) | ||
kramdown (2.4.0) | ||
rexml | ||
kramdown-parser-gfm (1.1.0) | ||
kramdown (~> 2.0) | ||
liquid (4.0.4) | ||
listen (3.8.0) | ||
rb-fsevent (~> 0.10, >= 0.10.3) | ||
rb-inotify (~> 0.9, >= 0.9.10) | ||
mercenary (0.3.6) | ||
mercenary (0.4.0) | ||
pathutil (0.16.2) | ||
forwardable-extended (~> 2.6) | ||
public_suffix (5.0.0) | ||
public_suffix (5.0.4) | ||
rb-fsevent (0.11.2) | ||
rb-inotify (0.10.1) | ||
ffi (~> 1.0) | ||
redcarpet (3.5.1) | ||
rouge (2.2.1) | ||
rexml (3.2.6) | ||
rouge (4.2.0) | ||
safe_yaml (1.0.5) | ||
sass (3.7.4) | ||
sass-listen (~> 4.0.0) | ||
sass-listen (4.0.0) | ||
rb-fsevent (~> 0.9, >= 0.9.4) | ||
rb-inotify (~> 0.9, >= 0.9.7) | ||
webrick (1.7.0) | ||
sass-embedded (1.71.0-x86_64-linux-gnu) | ||
google-protobuf (~> 3.25) | ||
terminal-table (3.0.2) | ||
unicode-display_width (>= 1.1.1, < 3) | ||
unicode-display_width (2.5.0) | ||
webrick (1.8.1) | ||
|
||
PLATFORMS | ||
ruby | ||
x86_64-linux | ||
|
||
DEPENDENCIES | ||
jekyll (= 3.6.3) | ||
redcarpet (= 3.5.1) | ||
csv | ||
jekyll (= 4.3.3) | ||
rexml | ||
rouge | ||
webrick | ||
sass-embedded | ||
|
||
RUBY VERSION | ||
ruby 3.3.0p0 | ||
|
||
BUNDLED WITH | ||
2.3.5 | ||
2.5.6 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,23 +41,101 @@ if(window.jekyllEnv !== 'spec-pdf') { | |
); | ||
} | ||
|
||
// no language auto-detect so that EBNF isn't detected as scala | ||
hljs.configure({ | ||
languages: [] | ||
// See https://github.com/highlightjs/highlight.js/issues/2889 for additional context. | ||
function renderMath({el, result, text}) { | ||
|
||
const re = RegExp('´', 'g'); | ||
|
||
const spans = []; | ||
|
||
// get the spans of all math elements | ||
while(match = re.exec(text)) { | ||
const start = match.index; | ||
match = re.exec(text); | ||
if(match == null) { | ||
break; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a weird mix of tabs and spaces here. The surrounding code uses 2 spaces for indentation of JavaScript code. We should stick to that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will - do I am going through each bit of the snippets first to make sure the rendering works from before. I will unmark as draft and |
||
} else { | ||
const end = match.index + 1; | ||
spans.push({start, end}); | ||
} | ||
} | ||
|
||
// render spans using katex | ||
for(const span of spans) { | ||
const {start, end} = span; | ||
const str = text.substring(start + 1, end - 1); | ||
const parent = new DocumentFragment(); | ||
katex.render(str, parent, { throwOnError: false }); | ||
const children = parent.children; | ||
// TODO: Double check mutiple elements aren't possible | ||
if (children.length == 1) { | ||
span.span = children[0]; | ||
} | ||
} | ||
|
||
// Here we start the merging between the katex output and highlight output. | ||
if (spans.length != 0) { | ||
|
||
// This is essentially our iterator | ||
var offset = 0; | ||
var span = spans.shift(); | ||
var child = el.firstChild; | ||
|
||
// highlight only supports one level of nesting. | ||
while (child) { | ||
if (child instanceof Text) { | ||
const str = child.wholeText; | ||
const start = offset; | ||
const end = start + str.length; | ||
|
||
if (span.start >= start && span.end <= end) { | ||
const beforeText = str.substring(0, span.start - start); | ||
if (beforeText) { | ||
el.insertBefore(new Text(beforeText), child); | ||
} | ||
|
||
const afterText = str.substring(span.end - start); | ||
child = el.replaceChild(span.span, child); | ||
|
||
if (afterText) { | ||
const afterChild = new Text(afterText); | ||
if (child.nextSibling) { | ||
el.insertBefore(afterChild, child.nextSibling); | ||
} else { | ||
el.appendChild(afterChild); | ||
} | ||
} | ||
|
||
offset = span.end; | ||
|
||
} else { | ||
offset = end; | ||
} | ||
} else if (child.tagName) { | ||
const str = child.innerHTML; | ||
offset += str.length; | ||
} | ||
|
||
child = child.nextSibling; | ||
} | ||
} | ||
} | ||
|
||
hljs.addPlugin({ | ||
'after:highlightElement': renderMath | ||
}); | ||
|
||
// KaTeX configuration | ||
document.addEventListener("DOMContentLoaded", function() { | ||
renderMathInElement(document.body, { | ||
delimiters: [ | ||
{left: "´", right: "´", display: false}, // "display: false" -> inline | ||
{left: "$$", right: "$$", display: true} | ||
], | ||
ignoredTags: ['script', 'noscript', 'style', 'textarea'], | ||
delimiters: [ | ||
{left: "´", right: "´", display: false}, // "display: false" -> inline | ||
{left: "$$", right: "$$", display: true} | ||
], | ||
// We ignore 'code' here, because highlight will deal with it. | ||
ignoredTags: ['script', 'noscript', 'style', 'code'], | ||
}); | ||
// syntax highlighting after KaTeX is loaded, | ||
// so that math can be used in code blocks | ||
hljs.initHighlighting(); | ||
hljs.highlightAll(); | ||
$("pre nobr").addClass("fixws"); | ||
// point when all necessary js is done, so PDF to be rendered | ||
window.status = "loaded"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file should be reflected at https://github.com/lampepfl/dotty/blob/ca88156789b2c94f107f85f07b238a59d84b7d65/.github/workflows/spec.yml#L26-L37 as well. I guess we should add a comment in the current file warning about this.