Skip to content

Commit b3949bd

Browse files
committed
Separate main css from build script
1 parent ba75c29 commit b3949bd

File tree

2 files changed

+74
-14
lines changed

2 files changed

+74
-14
lines changed

scripts/md2html/main.css

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#respec-ui {
2+
visibility: hidden;
3+
}
4+
5+
#title {
6+
color: #578000;
7+
}
8+
9+
#subtitle {
10+
color: #578000;
11+
}
12+
13+
.dt-published {
14+
color: #578000;
15+
}
16+
17+
.dt-published::before {
18+
content: "Published ";
19+
}
20+
21+
h1, h2, h3, h4, h5, h6 {
22+
color: #578000;
23+
font-weight: normal;
24+
font-style: normal;
25+
}
26+
27+
a[href] {
28+
color: #45512c;
29+
}
30+
31+
body:not(.toc-inline) #toc h2 {
32+
color: #45512c;
33+
}
34+
35+
table {
36+
display: block;
37+
width: 100%;
38+
overflow: auto;
39+
}
40+
41+
table th {
42+
font-weight: 600;
43+
}
44+
45+
table th, table td {
46+
padding: 6px 13px;
47+
border: 1px solid #dfe2e5;
48+
}
49+
50+
table tr {
51+
background-color: #fff;
52+
border-top: 1px solid #c6cbd1;
53+
}
54+
55+
table tr:nth-child(2n) {
56+
background-color: #f6f8fa;
57+
}
58+
59+
pre {
60+
background-color: #f6f8fa !important;
61+
}
62+
63+
code {
64+
color: #c83500
65+
}
66+
67+
th code {
68+
color: inherit
69+
}
70+
71+
a.bibref {
72+
text-decoration: underline;
73+
}

scripts/md2html/md2html.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,7 @@ function preface(title,options) {
137137
catch (ex) {}
138138
preface += '</head><body>';
139139
preface += '<style>';
140-
preface += '#respec-ui { visibility: hidden; }';
141-
preface += '#title { color: #578000; } #subtitle { color: #578000; }';
142-
preface += '.dt-published { color: #578000; } .dt-published::before { content: "Published "; }';
143-
preface += 'h1,h2,h3,h4,h5,h6 { color: #578000; font-weight: normal; font-style: normal; }';
144-
preface += 'a[href] { color: #45512c; }';
145-
preface += 'body:not(.toc-inline) #toc h2 { color: #45512c; }';
146-
preface += 'table { display: block; width: 100%; overflow: auto; }';
147-
preface += 'table th { font-weight: 600; }';
148-
preface += 'table th, table td { padding: 6px 13px; border: 1px solid #dfe2e5; }';
149-
preface += 'table tr { background-color: #fff; border-top: 1px solid #c6cbd1; }';
150-
preface += 'table tr:nth-child(2n) { background-color: #f6f8fa; }';
151-
preface += 'pre { background-color: #f6f8fa !important; }';
152-
preface += 'code { color: #c83500 } th code { color: inherit }';
153-
preface += 'a.bibref { text-decoration: underline;}';
140+
preface += fs.readFileSync(path.resolve(__dirname,'main.css'),'utf8').split(/\r?\n/).join(' ');
154141
preface += fs.readFileSync(path.resolve(__dirname,'gist.css'),'utf8').split(/\r?\n/).join(' ');
155142
preface += '</style>';
156143
preface += `<h1 id="title">${title.split('|')[0]}</h1>`;

0 commit comments

Comments
 (0)