Skip to content

Commit baffb9d

Browse files
committed
feat(docs): restore Zen Garden aesthetics and fix build
1 parent 56e97ca commit baffb9d

4 files changed

Lines changed: 166 additions & 11 deletions

File tree

content/examples/rosetta/_index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
sort_by = "weight"
21
+++
32
title = "Rosetta Examples"
43
weight = 20

site/syntaxes/zenc.sublime-syntax

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
%YAML 1.2
2+
---
3+
# Zen C syntax definition for Zola (syntect)
4+
# Derived from vscode-zenc/syntaxes/zenc.tmLanguage.json
5+
name: zc
6+
file_extensions:
7+
- zc
8+
- zenc
9+
scope: source.zc
10+
11+
contexts:
12+
main:
13+
# Directives (//> ...)
14+
- match: '//>\s*[a-zA-Z0-9_]+:'
15+
scope: keyword.control.directive.zc
16+
- match: '//>.*$'
17+
scope: comment.line.custom.zc
18+
19+
# Line comments
20+
- match: '//.*$'
21+
scope: comment.line.double-slash.zc
22+
23+
# Block comments
24+
- match: '/\*'
25+
scope: punctuation.definition.comment.begin.zc
26+
push: block_comment
27+
28+
# Attributes (@name)
29+
- match: '@[a-zA-Z_][a-zA-Z0-9_]*'
30+
scope: meta.attribute.zc
31+
32+
# Strings
33+
- match: '"'
34+
scope: punctuation.definition.string.begin.zc
35+
push: string_double
36+
37+
# Character literals
38+
- match: "'(\\\\.|[^'])'"
39+
scope: string.quoted.single.zc
40+
41+
# Control keywords
42+
- match: '\b(if|else|while|for|return|break|continue|do|goto|switch|case|default|match|try|catch|guard|unless|async|await|launch|defer|asm|unsafe|in)\b'
43+
scope: keyword.control.zc
44+
45+
# Declaration/other keywords
46+
- match: '\b(import|module|struct|enum|union|fn|trait|impl|var|const|let|mut|def|alias|opaque|type|typedef|extern|static|volatile|autofree|comptime|embed|ref|sizeof|typeof|undefined|pub)\b'
47+
scope: keyword.other.zc
48+
49+
# Boolean/null constants
50+
- match: '\b(true|false|null)\b'
51+
scope: constant.language.zc
52+
53+
# new/delete
54+
- match: '\b(new|delete)\b'
55+
scope: keyword.operator.new.zc
56+
57+
# Built-in types
58+
- match: '\b(int|uint|char|bool|void|u8|u16|u32|u64|u128|U8|U16|U32|U64|U128|i8|i16|i32|i64|i128|I8|I16|I32|I64|I128|f32|f64|F32|F64|usize|isize|string|c_int|c_uint|c_char|c_uchar|c_short|c_ushort|c_long|c_ulong|c_long_long|c_ulong_long|byte|rune|va_list|String|Vec|Slice|Map|HashMap)\b'
59+
scope: storage.type.zc
60+
61+
# Function calls
62+
- match: '\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()'
63+
captures:
64+
1: entity.name.function.zc
65+
66+
# Hex numbers
67+
- match: '\b0x[0-9a-fA-F_]+\b'
68+
scope: constant.numeric.hex.zc
69+
70+
# Binary numbers
71+
- match: '\b0b[01_]+\b'
72+
scope: constant.numeric.binary.zc
73+
74+
# Decimal numbers (with optional float)
75+
- match: '\b[0-9][0-9_]*(\.[0-9][0-9_]*)?\b'
76+
scope: constant.numeric.decimal.zc
77+
78+
# Operators
79+
- match: '=>|\.\.|\|\>'
80+
scope: keyword.operator.zc
81+
82+
block_comment:
83+
- meta_scope: comment.block.zc
84+
- match: '\*/'
85+
scope: punctuation.definition.comment.end.zc
86+
pop: true
87+
88+
string_double:
89+
- meta_scope: string.quoted.double.zc
90+
- match: '\\.'
91+
scope: constant.character.escape.zc
92+
- match: '\{'
93+
scope: punctuation.section.interpolation.begin.zc
94+
push: string_interpolation
95+
- match: '"'
96+
scope: punctuation.definition.string.end.zc
97+
pop: true
98+
99+
string_interpolation:
100+
- clear_scopes: 1
101+
- meta_scope: meta.interpolation.zc
102+
- include: main
103+
- match: '\}'
104+
scope: punctuation.section.interpolation.end.zc
105+
pop: true

site/templates/base.html

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -501,16 +501,48 @@
501501
rgba(255, 255, 255, 0.025) 16px);
502502
}
503503

504-
/* HERO CODE SNIPPETS */
505504
.doc-content pre {
506505
background: #0d0d0c;
507-
padding: 1.5rem;
506+
padding: 2.25rem 2rem;
508507
border: 1px solid rgba(255, 255, 255, 0.1);
509508
border-radius: 12px;
510509
margin-bottom: 2.5rem;
511510
overflow-x: auto;
512511
position: relative;
513-
box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.5);
512+
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
513+
cursor: pointer;
514+
transition: transform 0.2s ease, border-color 0.2s ease;
515+
}
516+
517+
.doc-content pre:hover {
518+
transform: translateY(-2px);
519+
border-color: rgba(255, 255, 255, 0.2);
520+
}
521+
522+
.doc-content pre::after,
523+
.admonition::after {
524+
content: "";
525+
position: absolute;
526+
top: 20px;
527+
right: 20px;
528+
width: 10px;
529+
height: 10px;
530+
background: rgba(255, 255, 255, 0.3);
531+
border-radius: 50%;
532+
transition: all 0.3s ease;
533+
}
534+
535+
.admonition::after {
536+
background: rgba(0, 0, 0, 0.1);
537+
}
538+
539+
[data-theme="dark"] .admonition::after {
540+
background: rgba(255, 255, 255, 0.2);
541+
}
542+
543+
.doc-content pre.copied::after {
544+
background: #10b981;
545+
box-shadow: 0 0 10px #10b981;
514546
}
515547

516548
.doc-content pre code {
@@ -540,28 +572,37 @@
540572
color: var(--str);
541573
}
542574

543-
.z-keyword {
575+
.z-keyword,
576+
.z-storage,
577+
.z-control {
544578
color: var(--kwd);
545579
font-weight: 600;
546580
}
547581

548-
.z-type {
582+
.z-type,
583+
.z-class,
584+
.z-interface {
549585
color: var(--typ);
550586
}
551587

552-
.z-function {
588+
.z-function,
589+
.z-method {
553590
color: var(--fn);
554591
}
555592

556-
.z-number {
593+
.z-number,
594+
.z-constant,
595+
.z-boolean {
557596
color: var(--num);
558597
}
559598

560-
.z-punctuation {
599+
.z-punctuation,
600+
.z-operator {
561601
color: var(--punctuation);
562602
}
563603

564-
.z-variable {
604+
.z-variable,
605+
.z-parameter {
565606
color: var(--variable);
566607
}
567608

@@ -1147,6 +1188,16 @@ <h4>{{ trans(key="newsletter-title") }}</h4>
11471188
localStorage.setItem('theme', newTheme);
11481189
});
11491190
}
1191+
// --- Code Copy Logic ---
1192+
document.querySelectorAll('.doc-content pre').forEach(pre => {
1193+
pre.addEventListener('click', function () {
1194+
const code = this.querySelector('code').innerText;
1195+
navigator.clipboard.writeText(code).then(() => {
1196+
this.classList.add('copied');
1197+
setTimeout(() => this.classList.remove('copied'), 2000);
1198+
});
1199+
});
1200+
});
11501201
</script>
11511202
</body>
11521203

www

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 44bf7a53db62550e9413cc21cddf40067f9d59ca
1+
Subproject commit 075f76e8bfc3fefb274b5262dde8d1009e19390a

0 commit comments

Comments
 (0)