File tree Expand file tree Collapse file tree 3 files changed +76
-1
lines changed Expand file tree Collapse file tree 3 files changed +76
-1
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,7 @@ <h3 class="modal-title fs-5" id="search_modal_label">
193
193
</ script >
194
194
195
195
< script src ="{{ 'dist/main.js'|url }} "> </ script >
196
+ < script src ="{{ 'dist/prettify-1.0.js'|url }} "> </ script >
196
197
197
198
{% for path in config.extra_javascript %}
198
199
< script src ="{{ path|url }} " defer > </ script >
Original file line number Diff line number Diff line change @@ -12,3 +12,8 @@ import "../../node_modules/bootstrap/js/dist/toast";
12
12
import "../../node_modules/bootstrap/js/dist/tooltip" ;
13
13
14
14
import "../scss/styles.scss" ;
15
+
16
+ const codeBlocks = document . querySelectorAll ( "pre code" ) ;
17
+ codeBlocks . forEach ( ( block ) => {
18
+ block . parentElement . classList . add ( [ "prettyprint" , "well" ] ) ;
19
+ } ) ;
Original file line number Diff line number Diff line change @@ -66,6 +66,12 @@ $code-color: #d14;
66
66
a {
67
67
color : #a30000 ;
68
68
text-decoration : none ;
69
+
70
+ & :hover ,
71
+ & :active {
72
+ color : #c20000 ;
73
+ text-decoration : underline ;
74
+ }
69
75
}
70
76
71
77
pre .prettyprint {
@@ -86,6 +92,18 @@ code {
86
92
padding : 2px 4px ;
87
93
}
88
94
95
+ pre {
96
+ background-color : #f7f7f9 ;
97
+ }
98
+
99
+ pre code {
100
+ border : none ;
101
+ }
102
+
103
+ .nav-link {
104
+ padding : 2px 15px 3px ;
105
+ }
106
+
89
107
.body-content {
90
108
padding-top : 120px ;
91
109
padding-bottom : 70px ;
@@ -101,4 +119,55 @@ code {
101
119
color : #333 ;
102
120
}
103
121
104
- // Code Blocks
122
+ // Prettify Code
123
+ .com {
124
+ color : #93a1a1 ;
125
+ }
126
+ .lit {
127
+ color : #195f91 ;
128
+ }
129
+ .pun ,
130
+ .opn ,
131
+ .clo {
132
+ color : #93a1a1 ;
133
+ }
134
+ .fun {
135
+ color : #dc322f ;
136
+ }
137
+ .str ,
138
+ .atv {
139
+ color : #d14 ;
140
+ }
141
+ .kwd ,
142
+ .prettyprint .tag {
143
+ color : #1e347b ;
144
+ }
145
+ .typ ,
146
+ .atn ,
147
+ .dec ,
148
+ .var {
149
+ color : teal ;
150
+ }
151
+ .pln {
152
+ color : #48484c ;
153
+ }
154
+
155
+ .prettyprint {
156
+ padding : 8px ;
157
+ background-color : #f7f7f9 ;
158
+ border : 1px solid #e1e1e8 ;
159
+ }
160
+ .prettyprint.linenums {
161
+ box-shadow : inset 40px 0 0 #fbfbfc , inset 41px 0 0 #ececf0 ;
162
+ }
163
+
164
+ /* Specify class=linenums on a pre to get line numbering */
165
+ ol .linenums {
166
+ margin : 0 0 0 33px ; /* IE indents via margin-left */
167
+ }
168
+ ol .linenums li {
169
+ padding-left : 12px ;
170
+ color : #bebec5 ;
171
+ line-height : 20px ;
172
+ text-shadow : 0 1px 0 #fff ;
173
+ }
You can’t perform that action at this time.
0 commit comments