Skip to content

Commit 566e03f

Browse files
authored
Html and css (#9)
* refactor: update global css * adding navigation side
1 parent 079148e commit 566e03f

7 files changed

Lines changed: 210 additions & 87 deletions

File tree

docs/all-pages.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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" />
6+
<title>All Pages</title>
7+
<link rel="stylesheet" href="global.css" />
8+
</head>
9+
<body>
10+
<header>
11+
<h1>All Pages</h1>
12+
<nav>
13+
<a href="index.html">Back</a>
14+
</nav>
15+
</header>
16+
<main>
17+
<h2>docs root</h2>
18+
<ul>
19+
<li><a href="impressum-en.html">impressum-en.html</a></li>
20+
<li><a href="index.html">index.html</a></li>
21+
<li><a href="loop_docu.html">loop_docu.html</a></li>
22+
</ul>
23+
<h2>docs/atch (without docs/atch/server)</h2>
24+
<ul>
25+
<li><a href="atch/about.pdf">atch/about.pdf</a></li>
26+
<li><a href="atch/about.svg">atch/about.svg</a></li>
27+
</ul>
28+
</main>
29+
</body>
30+
</html>

docs/global.css

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
:root {
2+
color-scheme: light dark;
3+
}
4+
5+
body {
6+
margin: 0;
7+
font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
8+
line-height: 1.6;
9+
}
10+
11+
header {
12+
padding: 24px 16px;
13+
border-bottom: 1px solid #ddd;
14+
}
15+
16+
main {
17+
min-width: 1000px;
18+
max-width: 1400px;
19+
margin: 0 auto;
20+
padding: 20px 5px 30px;
21+
}
22+
23+
.markdown h1,
24+
.markdown h2,
25+
.markdown h3 {
26+
line-height: 1.25;
27+
margin-top: 1.6em;
28+
}
29+
30+
.markdown pre {
31+
padding: 12px;
32+
overflow: auto;
33+
border: 1px solid #ddd;
34+
border-radius: 8px;
35+
}
36+
37+
.markdown code {
38+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
39+
}
40+
41+
.markdown table {
42+
border-collapse: collapse;
43+
width: 100%;
44+
}
45+
46+
.markdown th,
47+
.markdown td {
48+
border: 1px solid #ddd;
49+
padding: 8px;
50+
vertical-align: top;
51+
}
52+
53+
.markdown blockquote {
54+
margin: 0;
55+
padding-left: 12px;
56+
border-left: 4px solid #ddd;
57+
opacity: 0.9;
58+
}
59+
60+
.personal_info {
61+
font-style: italic;
62+
opacity: 0.85;
63+
}
64+
65+
a {
66+
color: inherit;
67+
}
68+
69+
header nav a + a {
70+
margin-left: 12px;
71+
}
72+
73+
.contact-grid {
74+
display: grid;
75+
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
76+
gap: 16px 24px;
77+
}
78+
79+
pre {
80+
overflow-x: auto;
81+
}
82+
83+
code {
84+
font-family: "Courier New", monospace;
85+
}
86+
87+
table {
88+
border-collapse: collapse;
89+
}
90+
91+
th,
92+
td {
93+
border: 1px solid #ccc;
94+
padding: 0.4rem 0.6rem;
95+
}
96+
97+
body.loop-docu {
98+
margin: 2rem;
99+
font-family: Arial, sans-serif;
100+
}

docs/impressum-en.html

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,7 @@
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
66
<title>Imprint</title>
7-
<style>
8-
:root { color-scheme: light dark; }
9-
body {
10-
margin: 0;
11-
font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
12-
line-height: 1.6;
13-
}
14-
header {
15-
padding: 24px 16px;
16-
border-bottom: 1px solid #ddd;
17-
}
18-
main {
19-
max-width: 1400px;
20-
margin: 0 auto;
21-
padding: 20px 5px 30px;
22-
}
23-
/* Optional: basic styling for rendered Markdown content */
24-
.markdown h1, .markdown h2, .markdown h3 { line-height: 1.25; margin-top: 1.6em; }
25-
.markdown pre { padding: 12px; overflow: auto; border: 1px solid #ddd; border-radius: 8px; }
26-
.markdown code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
27-
.markdown table { border-collapse: collapse; width: 100%; }
28-
.markdown th, .markdown td { border: 1px solid #ddd; padding: 8px; vertical-align: top; }
29-
.markdown blockquote { margin: 0; padding-left: 12px; border-left: 4px solid #ddd; opacity: 0.9; }
30-
.personal_info { font-style: italic; opacity: 0.85; }
31-
a { color: inherit; }
32-
.contact-grid {
33-
display: grid;
34-
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
35-
gap: 16px 24px;
36-
}
37-
</style>
7+
<link rel="stylesheet" href="global.css" />
388
</head>
399
<body>
4010
<header>

docs/index.html

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,16 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<title>Chemotion Converter</title>
88

9-
<style>
10-
:root { color-scheme: light dark; }
11-
body {
12-
margin: 0;
13-
font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
14-
line-height: 1.6;
15-
}
16-
header {
17-
padding: 24px 16px;
18-
border-bottom: 1px solid #ddd;
19-
}
20-
main {
21-
max-width: 1400px;
22-
margin: 0 auto;
23-
padding: 20px 5px 30px;
24-
}
25-
/* Optional: basic styling for rendered Markdown content */
26-
.markdown h1, .markdown h2, .markdown h3 { line-height: 1.25; margin-top: 1.6em; }
27-
.markdown pre { padding: 12px; overflow: auto; border: 1px solid #ddd; border-radius: 8px; }
28-
.markdown code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
29-
.markdown table { border-collapse: collapse; width: 100%; }
30-
.markdown th, .markdown td { border: 1px solid #ddd; padding: 8px; vertical-align: top; }
31-
.markdown blockquote { margin: 0; padding-left: 12px; border-left: 4px solid #ddd; opacity: 0.9; }
32-
</style>
9+
<link rel="stylesheet" href="global.css" />
3310
</head>
3411

3512
<body>
3613
<header>
3714
<h1>Chemotion Converter</h1>
3815
<nav>
3916
<a href="impressum-en.html">Imprint</a>
17+
<a href="atch/about.pdf">About PDF</a>
18+
<a href="all-pages.html">All pages</a>
4019
</nav>
4120
</header>
4221

docs/loop_docu.html

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@
44
<meta charset="utf-8">
55
<title>Loop Docu</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
<style>
8-
body { font-family: Arial, sans-serif; margin: 2rem; line-height: 1.6; }
9-
pre { overflow-x: auto; }
10-
code { font-family: "Courier New", monospace; }
11-
table { border-collapse: collapse; }
12-
th, td { border: 1px solid #ccc; padding: 0.4rem 0.6rem; }
13-
</style>
7+
<link rel="stylesheet" href="global.css" />
148
</head>
15-
<body>
9+
<body class="loop-docu">
1610
<h1>Converter Loop Documentation</h1>
1711
<hr />
1812
<h1>Backend</h1>

profile_manager/__main__.py

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import shutil
44
import sys
5+
from html import escape
56
from typing import BinaryIO, cast
67
from importlib.resources import files
78
from pathlib import Path
@@ -137,6 +138,7 @@ def build_index():
137138

138139
template_path = Path(__file__).parent.joinpath("index_template.html")
139140
fill_data_into_html(template_path, readers_table, profiles_table)
141+
build_html_links_page(base_path)
140142

141143

142144
def readers_dict_to_grid_config():
@@ -256,6 +258,75 @@ def fill_data_into_html(html_file: Path, readers_table, profiles_table):
256258
with open(index_path, "w") as file:
257259
file.write(html_content)
258260

261+
262+
def build_html_links_page(base_path: Path):
263+
docs_dir = Path(base_path, "docs")
264+
atch_dir = docs_dir / "atch"
265+
links_page_name = "all-pages.html"
266+
267+
# Keep these customizable for future filtering needs.
268+
additional_folder_blacklist = {".git", "__pycache__"}
269+
extension_blacklist = {".md", ".png", ".jpg", ".jpeg", ".gif", ".css", ".js", ".json", ".txt", ".py", ".exe", ".sh"}
270+
folder_blacklist = {"server", *additional_folder_blacklist}
271+
272+
root_links = []
273+
atch_links = []
274+
275+
for page in sorted(docs_dir.iterdir()):
276+
if not page.is_file():
277+
continue
278+
if page.name == links_page_name or page.suffix.lower() in extension_blacklist:
279+
continue
280+
root_links.append(page.relative_to(docs_dir).as_posix())
281+
282+
if atch_dir.exists():
283+
for page in sorted(atch_dir.rglob("*")):
284+
if not page.is_file() or page.suffix.lower() in extension_blacklist:
285+
continue
286+
rel_to_atch = page.relative_to(atch_dir)
287+
if any(part in folder_blacklist for part in rel_to_atch.parts[:-1]):
288+
continue
289+
atch_links.append(page.relative_to(docs_dir).as_posix())
290+
291+
def render_links(paths):
292+
if not paths:
293+
return "<li>No matching files found.</li>"
294+
return "\n".join(
295+
f' <li><a href="{escape(path)}">{escape(path)}</a></li>' for path in paths
296+
)
297+
298+
html_content = f"""<!doctype html>
299+
<html lang="en">
300+
<head>
301+
<meta charset="utf-8" />
302+
<meta name="viewport" content="width=device-width, initial-scale=1" />
303+
<title>All Pages</title>
304+
<link rel="stylesheet" href="global.css" />
305+
</head>
306+
<body>
307+
<header>
308+
<h1>All Pages</h1>
309+
<nav>
310+
<a href="index.html">Back</a>
311+
</nav>
312+
</header>
313+
<main>
314+
<h2>docs root</h2>
315+
<ul>
316+
{render_links(root_links)}
317+
</ul>
318+
<h2>docs/atch (without docs/atch/server)</h2>
319+
<ul>
320+
{render_links(atch_links)}
321+
</ul>
322+
</main>
323+
</body>
324+
</html>
325+
"""
326+
327+
with open(docs_dir / links_page_name, "w") as file:
328+
file.write(html_content)
329+
259330
def validate_profiles():
260331
profile_dir = Path(__file__).parent.parent.joinpath('profiles/public')
261332
for profile in profile_dir.glob("*.json"):

profile_manager/index_template.html

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,16 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<title>{{ PROGRAM_NAME }}</title>
88

9-
<style>
10-
:root { color-scheme: light dark; }
11-
body {
12-
margin: 0;
13-
font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
14-
line-height: 1.6;
15-
}
16-
header {
17-
padding: 24px 16px;
18-
border-bottom: 1px solid #ddd;
19-
}
20-
main {
21-
max-width: 1400px;
22-
margin: 0 auto;
23-
padding: 20px 5px 30px;
24-
}
25-
/* Optional: basic styling for rendered Markdown content */
26-
.markdown h1, .markdown h2, .markdown h3 { line-height: 1.25; margin-top: 1.6em; }
27-
.markdown pre { padding: 12px; overflow: auto; border: 1px solid #ddd; border-radius: 8px; }
28-
.markdown code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
29-
.markdown table { border-collapse: collapse; width: 100%; }
30-
.markdown th, .markdown td { border: 1px solid #ddd; padding: 8px; vertical-align: top; }
31-
.markdown blockquote { margin: 0; padding-left: 12px; border-left: 4px solid #ddd; opacity: 0.9; }
32-
</style>
9+
<link rel="stylesheet" href="global.css" />
3310
</head>
3411

3512
<body>
3613
<header>
3714
<h1>{{ PROGRAM_NAME }}</h1>
3815
<nav>
3916
<a href="impressum-en.html">Imprint</a>
17+
<a href="atch/about.pdf">About PDF</a>
18+
<a href="all-pages.html">All pages</a>
4019
</nav>
4120
</header>
4221

0 commit comments

Comments
 (0)