Skip to content

Commit 53248f7

Browse files
committed
Style / CSS fixes for website
1 parent 9c0d709 commit 53248f7

File tree

7 files changed

+60
-34
lines changed

7 files changed

+60
-34
lines changed

doc/src/dllgen/deploy.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -915,8 +915,8 @@ pub fn generate_release_html(version: &str, api_data: &ApiData, assets: &Release
915915
</aside>
916916
917917
<main>
918-
<h1>Azul GUI v{version}</h1>
919-
<a href='https://github.com/fschutt/azul/commit/{git}'>(git {git})</a>
918+
<h1>Azul v{version}</h1>
919+
<a href='https://github.com/fschutt/azul/commit/{git}' style='font-size:18px;'>(git {git})</a>
920920
<style>
921921
main h1 {{ margin-bottom: none; }}
922922
ul {{ margin-left: 20px; margin-top: 20px; list-style-type: none; }}
@@ -926,7 +926,7 @@ pub fn generate_release_html(version: &str, api_data: &ApiData, assets: &Release
926926
#releasenotes ul li {{ margin-bottom: 2px; }}
927927
#releasenotes p {{ margin-bottom: 10px; margin-top: 10px; }}
928928
</style>
929-
<div>
929+
<div style='font-size:18px;'>
930930
931931
<div id='releasenotes'>
932932
{releasenotes}
@@ -983,7 +983,7 @@ pub fn generate_release_html(version: &str, api_data: &ApiData, assets: &Release
983983
<strong>Use Azul as Rust dependency:</strong>
984984
<br/>
985985
986-
<div style='padding:20px;background:rgb(236, 236, 236);margin-top: 20px;'>
986+
<div style='padding:20px;background:rgb(236, 236, 236);margin-top: 20px;font-size:14px;'>
987987
<p style='color:grey;font-family:monospace;'># Cargo.toml</p>
988988
<p style='color:black;font-family:monospace;'>[dependencies.azul]</p>
989989
<p style='color:black;font-family:monospace;'>git = \"https://azul.rs/{version}.git\"</p>
@@ -1035,7 +1035,7 @@ pub fn generate_releases_index(versions: &[String]) -> String {
10351035
{sidebar}
10361036
</aside>
10371037
<main>
1038-
<h1>Choose release version</h1>
1038+
<h1>Releases</h1>
10391039
<div>
10401040
<ul>{}</ul>
10411041
</div>

doc/src/docgen/apidocs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ pub fn generate_api_html(api_data: &ApiData, version: &str) -> String {
9999
]
100100
.join("\r\n");
101101

102-
let title = format!("Azul API docs for version {version}");
102+
let title = format!("API v{version}");
103103
let content = generate_api_content(&version_data);
104104
let header_tags = crate::docgen::get_common_head_tags(false);
105105
let sidebar = crate::docgen::get_sidebar();

doc/src/docgen/blog.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,12 @@ pub fn generate_blog_post_html(post: &BlogPost) -> String {
161161
h2, h3, h4 { cursor: pointer; }
162162
h2 {
163163
font-family: 'Instrument Serif', Georgia, serif;
164-
font-size: 1.6em;
164+
font-size: 28px;
165165
font-weight: normal;
166-
margin-top: 40px;
167-
margin-bottom: 15px;
168166
text-shadow: 0.3px 0 0 currentColor, -0.3px 0 0 currentColor;
169167
}
170-
h3 { margin-top: 35px; margin-bottom: 10px; font-size: 1.3em; }
171-
h4 { margin-top: 25px; margin-bottom: 8px; font-size: 1.1em; }
168+
h3 { font-weight: bold; margin-top: 35px; font-size: 24px; }
169+
h4 { font-weight: bold; margin-top: 25px; font-size: 20px; }
172170
#blog { max-width: 700px; line-height: 1.7; font-size: 1.1em; }
173171
#blog img { max-width: 700px; margin-top: 15px; margin-bottom: 15px;}
174172
#blog ul, #blog ol {

doc/src/docgen/donate.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub fn generate_donation_page(yaml_str: &str) -> anyhow::Result<String> {
109109
.donation-option h2 {
110110
color: #004e92;
111111
margin-bottom: 1rem;
112-
font-size: 1.5rem;
112+
font-size: 2.5rem;
113113
}
114114
115115
.donation-option p {
@@ -203,6 +203,7 @@ pub fn generate_donation_page(yaml_str: &str) -> anyhow::Result<String> {
203203
<p>Azul is an open-source GUI framework that relies on community support to continue development.
204204
Your contributions help maintain the project, implement new features, and keep resources available to everyone.</p>
205205
<p></p>
206+
<br/>
206207
<p>Choose one of the options below to support the project:</p>
207208
</div>
208209
@@ -212,6 +213,7 @@ pub fn generate_donation_page(yaml_str: &str) -> anyhow::Result<String> {
212213
213214
<div class="donation-intro" style="margin-top: 2rem;">
214215
<p>Thank you for considering supporting Azul! Every contribution helps the project grow.</p>
216+
<br/>
215217
<p>If you have any questions about donations, please reach out via
216218
<a href="https://github.com/fschutt/azul/issues">GitHub</a> or
217219
<a href="https://discord.gg/V96ZGKqQvn">Discord</a>.</p>

doc/src/docgen/guide.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,6 @@ pub fn generate_guide_html(guide: &Guide, version: &str) -> String {
205205
margin-bottom: 1em;
206206
margin-top: 1em;
207207
}
208-
#guide p {
209-
margin-bottom: 1.5em;
210-
margin-top: 1.5em;
211-
}
212208
#guide code {
213209
font-family: monospace;
214210
font-weight: bold;
@@ -320,7 +316,7 @@ pub fn generate_guide_mainpage(version: &str) -> String {
320316
<main>
321317
<h1>User Guide</h1>
322318
<div>
323-
<ul>{version_items}</ul>
319+
<ul style='font-size: 18px;'>{version_items}</ul>
324320
</div>
325321
</main>
326322
</div>

doc/src/utils/string.rs

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,16 @@ pub fn strip_fn_arg_types(arg_list: &str) -> String {
7171
/// Format a docstring for HTML
7272
pub fn format_doc(docstring: &str) -> String {
7373
let mut newdoc = docstring.replace('<', "&lt;").replace('>', "&gt;");
74+
75+
// Remove code block markers entirely (```rust, ```python, ```, etc.)
76+
// These are handled at the line level in format_doc_lines
7477
newdoc = newdoc
75-
.replace("```rust", "<code>")
76-
.replace("```", "</code>");
78+
.replace("```rust", "")
79+
.replace("```python", "")
80+
.replace("```c", "")
81+
.replace("```cpp", "")
82+
.replace("```json", "")
83+
.replace("```", "");
7784

7885
// Replace inline code marks
7986
let mut processed = String::new();
@@ -104,16 +111,39 @@ pub fn format_doc(docstring: &str) -> String {
104111

105112
/// Format multi-line documentation for HTML output
106113
/// Each line becomes a separate paragraph with proper HTML escaping
114+
/// - Removes ``` code block markers
115+
/// - Converts empty lines to <br/> for proper spacing
107116
pub fn format_doc_lines(doc_lines: &[String]) -> String {
108117
if doc_lines.is_empty() {
109118
return String::new();
110119
}
111120

112-
doc_lines
113-
.iter()
114-
.map(|line| format_doc(line))
115-
.collect::<Vec<_>>()
116-
.join("\n")
121+
let mut in_code_block = false;
122+
let mut result = Vec::new();
123+
124+
for line in doc_lines {
125+
let trimmed = line.trim();
126+
127+
// Skip code block markers (``` or ```rust, ```python, etc.)
128+
if trimmed.starts_with("```") {
129+
in_code_block = !in_code_block;
130+
continue;
131+
}
132+
133+
// Skip lines inside code blocks
134+
if in_code_block {
135+
continue;
136+
}
137+
138+
// Convert empty lines to <br/> for proper spacing
139+
if trimmed.is_empty() {
140+
result.push("<br/>".to_string());
141+
} else {
142+
result.push(format_doc(line));
143+
}
144+
}
145+
146+
result.join("\n")
117147
}
118148

119149
/// Join documentation lines into a single string for display

doc/templates/main.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ main {
202202
}
203203
}
204204

205-
main h1, main h2, h1, h2 {
205+
main h1, main h2, h1, h2, h3, h4, h5, h6 {
206206
font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
207207
}
208208

@@ -233,7 +233,7 @@ main h1 {
233233
margin: 0;
234234
padding: 8px 15px;
235235
/* Base size for large screens */
236-
font-size: 2.5em;
236+
font-size: 2.8em;
237237
font-weight: normal;
238238
line-height: 1.0;
239239
color: #000;
@@ -245,16 +245,16 @@ main h1 {
245245
}
246246

247247
main h3, h3 {
248-
font-family: "Source Serif Pro", Georgia, "Times New Roman", serif;
249-
font-size: 1.15em;
250-
font-weight: normal;
248+
font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
249+
font-size: 24px;
250+
font-weight: bold;
251251
line-height: 1.6;
252252
color: #333;
253253
}
254254

255255
main p, p {
256256
font-family: "Source Serif Pro", Georgia, "Times New Roman", serif;
257-
font-size: 1.2em;
257+
font-size: 16px;
258258
line-height: 1.6;
259259
color: #444;
260260
}
@@ -744,7 +744,7 @@ main > header h3 {
744744

745745
/* Frontpage h1/h2/tagline sizing for tablet - remove h1 override to keep desktop size */
746746
.feature-image h2.feature-title {
747-
font-size: 2.2em;
747+
font-size: 2.5em;
748748
}
749749

750750
.tagline {
@@ -759,7 +759,7 @@ main > header h3 {
759759
}
760760

761761
.feature-image h2.feature-title {
762-
font-size: 2.3em;
762+
font-size: 2.5em;
763763
}
764764

765765
.tagline {
@@ -774,7 +774,7 @@ main > header h3 {
774774
}
775775

776776
.feature-image h2.feature-title {
777-
font-size: 1.8em;
777+
font-size: 2.2em;
778778
}
779779

780780
.tagline {
@@ -789,7 +789,7 @@ main > header h3 {
789789
}
790790

791791
.feature-image h2.feature-title {
792-
font-size: 1.5em;
792+
font-size: 1.8em;
793793
}
794794

795795
.tagline {

0 commit comments

Comments
 (0)