Skip to content

Commit 1697142

Browse files
committed
Docs: put the style inline
1 parent fb2180e commit 1697142

18 files changed

+103
-143
lines changed

docs/404.html

-39
This file was deleted.

docs/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ local: html
2222
download:
2323
rsync -rtvzP "root@auto-editor.com:/var/www/auto-editor/public/img" src
2424

25-
upload:
25+
upload: html
2626
rsync -rtvzP --delete ./public "root@auto-editor.com:/var/www/auto-editor"
2727
rsync server.js "root@auto-editor.com:/var/www/auto-editor/server.js"
2828
rsync package.json "root@auto-editor.com:/var/www/auto-editor/package.json"

docs/build.py

+16-7
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,22 @@ def main():
1919
parser = main_options(parser)
2020

2121
with open("src/ref/options.html", "w") as file:
22-
file.write(
23-
'{{ headerdesc "Options" "These are the options and flags that auto-editor uses." }}\n'
24-
"<body>\n"
25-
"{{ nav }}\n"
26-
'<section class="section">\n'
27-
'<div class="container">\n'
28-
)
22+
file.write("""\
23+
<!DOCTYPE html>
24+
<html lang="en">
25+
<head>
26+
{{ init_head }}
27+
{{ headerdesc "Options" "These are the options and flags that auto-editor uses." }}
28+
{{ head_icon }}
29+
<style>
30+
{{ core_style }}
31+
</style>
32+
<body>
33+
{{ nav }}
34+
<section class="section">
35+
<div class="container">
36+
""")
37+
2938
for op in parser.args:
3039
if isinstance(op, OptionText):
3140
file.write(f"<h2>{escape(op.text)}</h2>\n")

docs/components/cls_center.css

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.center {
2+
text-align: center;
3+
display: block;
4+
margin-left: auto;
5+
margin-right: auto;
6+
}

docs/src/style.css docs/components/core_style.css

+3-48
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ body, button, input {
2525
Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Helvetica, Arial;
2626
}
2727

28-
html, p, h1, h2, h3, h4, h5, html, blockquote {
28+
html, p, h1, h2, h3, h4, html, blockquote {
2929
margin: 0;
3030
padding: 0;
3131
}
@@ -40,9 +40,7 @@ body {
4040
padding: 0 2em;
4141
margin: 0;
4242
}
43-
@media (max-width: 55em) {
44-
body {padding: 0 1rem}
45-
}
43+
@media (max-width: 55em) { body {padding: 0 1rem} }
4644

4745
hr {
4846
margin: 24px 0;
@@ -83,10 +81,7 @@ hr {
8381
}
8482
.navbar-item img {max-height: 1.75rem}
8583

86-
img {
87-
max-width: 100%;
88-
height: auto;
89-
}
84+
img { max-width: 100%; height: auto }
9085

9186
.navbar-link, a.navbar-item {
9287
cursor: pointer;
@@ -104,7 +99,6 @@ a {
10499
}
105100
a:hover {border-bottom: 1px solid}
106101
a.navbar-item:hover {border-bottom: 0}
107-
108102
a.no-underline {
109103
border-bottom: 0;
110104
}
@@ -132,7 +126,6 @@ pre {
132126
word-wrap: normal;
133127
overflow-x: auto;
134128
}
135-
136129
pre code {
137130
background-color: transparent;
138131
color: currentColor;
@@ -153,22 +146,6 @@ g-emoji {
153146
vertical-align: -.075em;
154147
}
155148

156-
.center {
157-
text-align: center;
158-
display: block;
159-
margin-left: auto;
160-
margin-right: auto;
161-
}
162-
.right {text-align: right}
163-
.left {text-align: left}
164-
165-
.hero {
166-
margin-bottom: 3rem;
167-
margin-top: 1.6rem;
168-
flex-direction: column;
169-
justify-content: space-between;
170-
}
171-
172149
p, .paragraph {max-width: 88ch;}
173150
p {
174151
display: block;
@@ -180,15 +157,7 @@ p {
180157

181158
.section {padding: 1rem 0}
182159

183-
.subtitle {margin-top: -1.5rem}
184-
185-
table {
186-
border-collapse: collapse;
187-
border-spacing: 0;
188-
}
189-
190160
.huge {font-size: 5rem}
191-
.huge-lite {font-size: 4rem}
192161
h1, .bigger {font-size: 2.5rem}
193162
h2, .big {font-size: 2.1rem}
194163
h3, .medium {font-size: 1.7rem}
@@ -200,7 +169,6 @@ pre {line-height: 1.25}
200169

201170
@media (max-width: 55em){
202171
.huge {font-size: 4rem}
203-
.huge-lite {font-size: 3rem}
204172
h1, .bigger {font-size: 2rem}
205173
h2, .big {font-size: 1.8rem}
206174
h3, .medium {font-size: 1.5rem}
@@ -214,12 +182,6 @@ pre {line-height: 1.25}
214182
.navbar-start > .navbar-item {font-size: 1em}
215183
}
216184

217-
#icon {
218-
width: 35%;
219-
margin-top: -3%;
220-
margin-bottom: -3%;
221-
}
222-
223185
h1 {
224186
margin-bottom: 1.5rem;
225187
line-height: 1.125;
@@ -232,14 +194,8 @@ h3 {font-weight: 500}
232194
.navbar-start > .navbar-item {font-weight: bold}
233195
.underline {text-decoration: underline}
234196

235-
.author-date {
236-
font-weight: 650;
237-
margin-block-end: 0.4em;
238-
}
239-
240197
/* Light Theme Colors */
241198
html {background-color: white}
242-
.hero {background-color: #EAEAEA}
243199
hr {background-color: #EAEAEA}
244200
h1, h2, h3, h4, p, code, pre, th {color: #323232}
245201
blockquote {border-left: 5px solid #EAEAEA}
@@ -263,7 +219,6 @@ li {color: black; text-decoration: black;}
263219
/* Dark Theme Colors */
264220
@media (prefers-color-scheme: dark) {
265221
html {background-color: #262626}
266-
.hero {background-color: #4A4A4A}
267222
hr {background-color: #4A4A4A}
268223
h1, h2, h3, h4, p, code, pre, th {color: #F9F7F7}
269224
blockquote {border-left: 5px solid #4A4A4A}

docs/components/head_icon.html

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
2+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
3+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
4+
<link rel="manifest" href="/favicon/site.webmanifest">

docs/components/header.html

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<title>{{ $1 }}</title>
77
<meta property="og:title" content="{{ $1 }}">
88
<meta name="twitter:title" content="{{ $1 }}">
9-
<link rel="stylesheet" href="/style.css?v=1.12.0">
109
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
1110
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
1211
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">

docs/components/headerdesc.html

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
61
<title>{{ $1 }}</title>
72
<meta property="og:title" content="{{ $1 }}">
83
<meta name="twitter:title" content="{{ $1 }}">
94
<meta name="description" property="og:description" content="{{ $2 }}">
10-
<meta name="twitter:description" content="{{ $2 }}">
11-
<link rel="stylesheet" href="/style.css?v=1.12.0">
12-
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
13-
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
14-
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
15-
<link rel="manifest" href="/favicon/site.webmanifest">
16-
</head>
5+
<meta name="twitter:description" content="{{ $2 }}">

docs/components/index_header.html

-21
This file was deleted.

docs/components/init_head.html

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<meta charset="utf-8">
2+
<meta name="viewport" content="width=device-width, initial-scale=1.0">

docs/doc.pal

+2
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,7 @@ alyssa.age ; returns 23
879879
)
880880
(displayln "{{ header \"Palet Scripting Reference\" }}
881881
<style>
882+
{{ core_style }}
882883
.palet-block {
883884
padding-left: 7px;
884885
padding-bottom: 7px;
@@ -923,6 +924,7 @@ file )
923924

924925
(displayln "{{ header \"Edit Reference\" }}
925926
<style>
927+
{{ core_style }}
926928
.palet-block {
927929
padding-left: 7px;
928930
padding-bottom: 7px;

docs/make.nim

+4-6
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,10 @@ proc convert(file: string, path: string) =
463463
f.write("\n <meta name=\"robots\" content=\"noindex\">")
464464

465465
f.write(&"""
466-
467-
<link rel="stylesheet" href="/style.css?v=1.12.0">
468-
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
469-
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
470-
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
471-
<link rel="manifest" href="/favicon/site.webmanifest">
466+
{{{{ head_icon }}}}
467+
<style>
468+
{{{{ core_style }}}}
469+
</style>
472470
</head>
473471
<body>
474472
{{{{ nav }}}}

docs/server.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ app.get("/app/*", (req, res) => {
99
res.redirect(301, `https://app.auto-editor.com${newPath}`);
1010
});
1111

12-
app.get("/blog/", (req, res) => {
13-
res.redirect(301, `https://basswood-io.com/blog`);
14-
});
1512
app.get("/blog/*", (req, res) => {
1613
console.log(req.path);
1714
res.redirect(301, `https://basswood-io.com${req.path}`);
@@ -35,7 +32,10 @@ app.use(express.static("public", {
3532
}));
3633

3734
app.use((req, res) => {
38-
res.status(404).sendFile(path.join(__dirname, "404.html"));
35+
let options = {
36+
headers: {"Content-Type": "text/html"}
37+
};
38+
res.status(404).sendFile(path.join(__dirname, "public/404"), options);
3939
});
4040

4141
app.listen(1337, (req, res) => console.log("running on http://localhost:1337"));

docs/src/404.html

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
{{ init_head }}
5+
<title>404</title>
6+
{{ head_icon }}
7+
<style>
8+
{{ core_style }}
9+
{{ cls_center }}
10+
.hero {
11+
margin-bottom: 3rem;
12+
margin-top: 1.6rem;
13+
flex-direction: column;
14+
justify-content: space-between;
15+
background-color: #EAEAEA;
16+
}
17+
@media (prefers-color-scheme: dark) {
18+
.hero {background-color: #4A4A4A}
19+
}
20+
</style>
21+
</head>
22+
<body>
23+
{{ nav }}
24+
<section class="section">
25+
<div class="container">
26+
<h1 class="hero huge">404. That's an error</h1>
27+
<p class="medium center">The page you were looking for doesn't exist. Back to <a href="/">main page</a>.</p>
28+
</div>
29+
</section>
30+
</body>
31+
</html>

docs/src/docs/index.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ See also: [reference](../ref)
99
[How To Shrink File Size](./file-size)
1010
[Range Syntax](./range-syntax)
1111
[Subcommands](./subcommands)
12-
[Using Auto-Editor on Windows](./windows)
13-
[Supported Media](./supported_media)
12+
[Supported Media](./supported-media)
1413

1514
### Timeline Documentation
1615
[The v1 format](./v1)
File renamed without changes.

0 commit comments

Comments
 (0)