Skip to content

Commit 7fbff48

Browse files
committed
Use highlight.js instead of prettify
Fixes #1484
1 parent bce5be0 commit 7fbff48

File tree

633 files changed

+1483
-1332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

633 files changed

+1483
-1332
lines changed

lib/resources/github.css

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/*
2+
3+
github.com style (c) Vasily Polovnyov <[email protected]>
4+
5+
*/
6+
7+
.hljs {
8+
display: block;
9+
overflow-x: auto;
10+
padding: 0.5em;
11+
color: #333;
12+
background: #f8f8f8;
13+
}
14+
15+
.hljs-comment,
16+
.hljs-quote {
17+
color: #998;
18+
font-style: italic;
19+
}
20+
21+
.hljs-keyword,
22+
.hljs-selector-tag,
23+
.hljs-subst {
24+
color: #333;
25+
font-weight: bold;
26+
}
27+
28+
.hljs-number,
29+
.hljs-literal,
30+
.hljs-variable,
31+
.hljs-template-variable,
32+
.hljs-tag .hljs-attr {
33+
color: #008080;
34+
}
35+
36+
.hljs-string,
37+
.hljs-doctag {
38+
color: #d14;
39+
}
40+
41+
.hljs-title,
42+
.hljs-section,
43+
.hljs-selector-id {
44+
color: #900;
45+
font-weight: bold;
46+
}
47+
48+
.hljs-subst {
49+
font-weight: normal;
50+
}
51+
52+
.hljs-type,
53+
.hljs-class .hljs-title {
54+
color: #458;
55+
font-weight: bold;
56+
}
57+
58+
.hljs-tag,
59+
.hljs-name,
60+
.hljs-attribute {
61+
color: #000080;
62+
font-weight: normal;
63+
}
64+
65+
.hljs-regexp,
66+
.hljs-link {
67+
color: #009926;
68+
}
69+
70+
.hljs-symbol,
71+
.hljs-bullet {
72+
color: #990073;
73+
}
74+
75+
.hljs-built_in,
76+
.hljs-builtin-name {
77+
color: #0086b3;
78+
}
79+
80+
.hljs-meta {
81+
color: #999;
82+
font-weight: bold;
83+
}
84+
85+
.hljs-deletion {
86+
background: #fdd;
87+
}
88+
89+
.hljs-addition {
90+
background: #dfd;
91+
}
92+
93+
.hljs-emphasis {
94+
font-style: italic;
95+
}
96+
97+
.hljs-strong {
98+
font-weight: bold;
99+
}

lib/resources/highlight.pack.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/resources/prettify.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/resources/prettify.js

Lines changed: 0 additions & 32 deletions
This file was deleted.

lib/resources/readme.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# highlight.js
2+
3+
Generated from https://highlightjs.org/download/ on 2017-08-30
4+
5+
Included languages:
6+
7+
* bash
8+
* css
9+
* dart
10+
* java
11+
* javascript
12+
* json
13+
* markdown
14+
* objectivec
15+
* ruby - dragged in by `yaml` - 🙄
16+
* shell
17+
* swift
18+
* xml - includes html
19+
* yaml

lib/resources/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ function initSearch() {
193193
}
194194

195195
document.addEventListener("DOMContentLoaded", function() {
196-
prettyPrint();
196+
hljs.initHighlightingOnLoad();
197197
initSideNav();
198198
initSearch();
199199
});

lib/src/html/resources.g.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const List<String> resource_names = const [
88
'package:dartdoc/resources/css/bootstrap.css.map',
99
'package:dartdoc/resources/css/bootstrap.min.css',
1010
'package:dartdoc/resources/favicon.png',
11-
'package:dartdoc/resources/prettify.css',
12-
'package:dartdoc/resources/prettify.js',
11+
'package:dartdoc/resources/github.css',
12+
'package:dartdoc/resources/highlight.pack.js',
1313
'package:dartdoc/resources/script.js',
1414
'package:dartdoc/resources/styles.css',
1515
'package:dartdoc/resources/typeahead.bundle.min.js'

lib/src/markdown_processor.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,6 @@ class MarkdownDocument extends md.Document {
797797
}
798798

799799
bool specifiesLanguage = pre.classes.isNotEmpty;
800-
pre.classes.add('prettyprint');
801800
// Assume the user intended Dart if there are no other classes present.
802801
if (!specifiesLanguage) pre.classes.add('language-dart');
803802
}

lib/templates/_footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
1616
<script src="static-assets/typeahead.bundle.min.js"></script>
17-
<script src="static-assets/prettify.js"></script>
17+
<script src="static-assets/highlight.pack.js"></script>
1818
<script src="static-assets/URI.js"></script>
1919
<script src="static-assets/script.js"></script>
2020
<!-- footer placeholder -->

lib/templates/_head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
{{/htmlBase}}
1919

2020
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700" rel="stylesheet">
21-
<link rel="stylesheet" href="static-assets/prettify.css">
21+
<link rel="stylesheet" href="static-assets/github.css">
2222
<link rel="stylesheet" href="static-assets/styles.css">
2323
<link rel="icon" href="static-assets/favicon.png">
2424

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,4 +350,4 @@ packages:
350350
source: hosted
351351
version: "2.1.12"
352352
sdks:
353-
dart: ">=1.23.0-dev.11.5 <2.0.0"
353+
dart: ">=1.23.0-dev.11.5 <2.0.0-dev.infinity"

0 commit comments

Comments
 (0)