Skip to content

Commit e0aef94

Browse files
committed
add discord + email footer to all pages
1 parent f9a5f25 commit e0aef94

171 files changed

Lines changed: 2014 additions & 172 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

about/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ <h2>Support the project</h2>
8080
</a>
8181
</div>
8282
</div>
83-
<footer><p>C++ Mode for Processing</p></footer>
83+
<footer><p>C++ Mode for Processing</p><p class="footer-contact"><a href="mailto:pep84c@gmail.com">pep84c@gmail.com</a> &middot; <a href="https://discord.gg/vShSrPegJT">Discord</a></p></footer>
8484
<script src="../assets/nav.js"></script>
8585
</body>
8686
</html>

apply_footer.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env python3
2+
import glob, os
3+
4+
REPO = os.path.dirname(os.path.abspath(__file__))
5+
6+
NEW_FOOTER = '<footer>\n <p>C++ Mode for Processing</p>\n <p class="footer-contact">\n <a href="mailto:pep84c@gmail.com">pep84c@gmail.com</a>\n <span class="footer-sep">&middot;</span>\n <a href="https://discord.gg/vShSrPegJT">Discord</a>\n </p>\n</footer>'
7+
8+
FOOTER_CSS = '\n .footer-contact { margin-top: 0.4rem; font-size: 12px; }\n .footer-contact a { color: #aaa; border-bottom: 1px solid transparent; }\n .footer-contact a:hover { color: #111; border-bottom-color: #111; }\n .footer-sep { color: #ccc; margin: 0 0.5rem; }'
9+
10+
files = glob.glob(os.path.join(REPO, '**/*.html'), recursive=True)
11+
files = [f for f in files if '/examples/' not in f and '.git' not in f]
12+
13+
changed = 0
14+
for f in sorted(files):
15+
raw = open(f, 'rb').read()
16+
text = raw.decode('utf-8', errors='replace')
17+
18+
if 'discord.gg' in text:
19+
continue
20+
21+
original = text
22+
23+
# Find and replace the footer - try every variant
24+
for old in [
25+
'<footer><p>C++ Mode for Processing</p></footer>',
26+
'<footer><p>Processing for C++</p></footer>',
27+
]:
28+
if old in text:
29+
text = text.replace(old, NEW_FOOTER)
30+
break
31+
32+
# Add CSS if footer was replaced but CSS missing
33+
if text != original and 'footer-contact' not in text and '</style>' in text:
34+
text = text.replace('</style>', FOOTER_CSS + '\n </style>', 1)
35+
36+
if text != original:
37+
open(f, 'w', encoding='utf-8').write(text)
38+
changed += 1
39+
print(f' {os.path.relpath(f, REPO)}')
40+
41+
print(f'\nUpdated {changed} files.')

downloads/cmake-setup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ <h2>Configure, build, and run</h2>
208208
</div>
209209
</div>
210210
</div>
211-
<footer><p>C++ Mode for Processing</p></footer>
211+
<footer><p>C++ Mode for Processing</p><p class="footer-contact"><a href="mailto:pep84c@gmail.com">pep84c@gmail.com</a> &middot; <a href="https://discord.gg/vShSrPegJT">Discord</a></p></footer>
212212
<script>
213213
function switchTab(name, el) {
214214
document.querySelectorAll('.platform-tab').forEach(t => t.classList.remove('active'));

downloads/dragdrop-setup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ <h2>Steps 2 onwards same as macOS</h2>
194194
</div>
195195
</div>
196196
</div>
197-
<footer><p>C++ Mode for Processing</p></footer>
197+
<footer><p>C++ Mode for Processing</p><p class="footer-contact"><a href="mailto:pep84c@gmail.com">pep84c@gmail.com</a> &middot; <a href="https://discord.gg/vShSrPegJT">Discord</a></p></footer>
198198
<script>
199199
function switchTab(name, el) {
200200
document.querySelectorAll('.platform-tab').forEach(t => t.classList.remove('active'));

downloads/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ <h3>CMake</h3>
147147

148148
</div>
149149
</div>
150-
<footer><p>C++ Mode for Processing</p></footer>
150+
<footer><p>C++ Mode for Processing</p><p class="footer-contact"><a href="mailto:pep84c@gmail.com">pep84c@gmail.com</a> &middot; <a href="https://discord.gg/vShSrPegJT">Discord</a></p></footer>
151151
<script src="../assets/nav.js"></script>
152152
</body>
153153
</html>

examples/acceleration-with-vectors.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
.welcome h1 { font-size: 1.8rem; font-weight: 600; margin-bottom: 1rem; }
3838
.welcome p { color: #555; line-height: 1.8; max-width: 500px; }
3939
footer { border-top: 1px solid #e0e0e0; padding: 2rem; text-align: center; font-size: 13px; color: #888; }
40+
.footer-contact { margin-top: 0.4rem; font-size: 12px; }
41+
.footer-contact a { color: #aaa; border-bottom: 1px solid transparent; }
42+
.footer-contact a:hover { color: #111; border-bottom-color: #111; }
43+
.footer-sep { color: #ccc; margin: 0 0.5rem; }
4044
@media (max-width: 768px) {
4145
.hamburger { display: block; }
4246
.sidebar-outer { position: fixed; top: 60px; left: -240px; width: 240px; height: calc(100vh - 60px); background: #fff; z-index: 200; transition: left 0.25s ease; box-shadow: 2px 0 12px rgba(0,0,0,0.08); }
@@ -146,7 +150,14 @@ <h1>Acceleration With Vectors</h1>
146150
</div>
147151
</div>
148152
</div>
149-
<footer><p>C++ Mode for Processing</p></footer>
153+
<footer>
154+
<p>C++ Mode for Processing</p>
155+
<p class="footer-contact">
156+
<a href="mailto:pep84c@gmail.com">pep84c@gmail.com</a>
157+
<span class="footer-sep">&middot;</span>
158+
<a href="https://discord.gg/vShSrPegJT">Discord</a>
159+
</p>
160+
</footer>
150161
<script>function copyCode() {
151162
navigator.clipboard.writeText(document.getElementById('code-pre').innerText).then(() => {
152163
const btn = document.querySelector('.copy-btn');

examples/additive-wave.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
.welcome h1 { font-size: 1.8rem; font-weight: 600; margin-bottom: 1rem; }
3838
.welcome p { color: #555; line-height: 1.8; max-width: 500px; }
3939
footer { border-top: 1px solid #e0e0e0; padding: 2rem; text-align: center; font-size: 13px; color: #888; }
40+
.footer-contact { margin-top: 0.4rem; font-size: 12px; }
41+
.footer-contact a { color: #aaa; border-bottom: 1px solid transparent; }
42+
.footer-contact a:hover { color: #111; border-bottom-color: #111; }
43+
.footer-sep { color: #ccc; margin: 0 0.5rem; }
4044
@media (max-width: 768px) {
4145
.hamburger { display: block; }
4246
.sidebar-outer { position: fixed; top: 60px; left: -240px; width: 240px; height: calc(100vh - 60px); background: #fff; z-index: 200; transition: left 0.25s ease; box-shadow: 2px 0 12px rgba(0,0,0,0.08); }
@@ -207,7 +211,14 @@ <h1>Additive Wave</h1>
207211
</div>
208212
</div>
209213
</div>
210-
<footer><p>C++ Mode for Processing</p></footer>
214+
<footer>
215+
<p>C++ Mode for Processing</p>
216+
<p class="footer-contact">
217+
<a href="mailto:pep84c@gmail.com">pep84c@gmail.com</a>
218+
<span class="footer-sep">&middot;</span>
219+
<a href="https://discord.gg/vShSrPegJT">Discord</a>
220+
</p>
221+
</footer>
211222
<script>function copyCode() {
212223
navigator.clipboard.writeText(document.getElementById('code-pre').innerText).then(() => {
213224
const btn = document.querySelector('.copy-btn');

examples/alpha-mask.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
.welcome h1 { font-size: 1.8rem; font-weight: 600; margin-bottom: 1rem; }
3838
.welcome p { color: #555; line-height: 1.8; max-width: 500px; }
3939
footer { border-top: 1px solid #e0e0e0; padding: 2rem; text-align: center; font-size: 13px; color: #888; }
40+
.footer-contact { margin-top: 0.4rem; font-size: 12px; }
41+
.footer-contact a { color: #aaa; border-bottom: 1px solid transparent; }
42+
.footer-contact a:hover { color: #111; border-bottom-color: #111; }
43+
.footer-sep { color: #ccc; margin: 0 0.5rem; }
4044
@media (max-width: 768px) {
4145
.hamburger { display: block; }
4246
.sidebar-outer { position: fixed; top: 60px; left: -240px; width: 240px; height: calc(100vh - 60px); background: #fff; z-index: 200; transition: left 0.25s ease; box-shadow: 2px 0 12px rgba(0,0,0,0.08); }
@@ -124,7 +128,14 @@ <h1>Alpha Mask</h1>
124128
</div>
125129
</div>
126130
</div>
127-
<footer><p>C++ Mode for Processing</p></footer>
131+
<footer>
132+
<p>C++ Mode for Processing</p>
133+
<p class="footer-contact">
134+
<a href="mailto:pep84c@gmail.com">pep84c@gmail.com</a>
135+
<span class="footer-sep">&middot;</span>
136+
<a href="https://discord.gg/vShSrPegJT">Discord</a>
137+
</p>
138+
</footer>
128139
<script>function copyCode() {
129140
navigator.clipboard.writeText(document.getElementById('code-pre').innerText).then(() => {
130141
const btn = document.querySelector('.copy-btn');

examples/animated-sprite.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
.welcome h1 { font-size: 1.8rem; font-weight: 600; margin-bottom: 1rem; }
3838
.welcome p { color: #555; line-height: 1.8; max-width: 500px; }
3939
footer { border-top: 1px solid #e0e0e0; padding: 2rem; text-align: center; font-size: 13px; color: #888; }
40+
.footer-contact { margin-top: 0.4rem; font-size: 12px; }
41+
.footer-contact a { color: #aaa; border-bottom: 1px solid transparent; }
42+
.footer-contact a:hover { color: #111; border-bottom-color: #111; }
43+
.footer-sep { color: #ccc; margin: 0 0.5rem; }
4044
@media (max-width: 768px) {
4145
.hamburger { display: block; }
4246
.sidebar-outer { position: fixed; top: 60px; left: -240px; width: 240px; height: calc(100vh - 60px); background: #fff; z-index: 200; transition: left 0.25s ease; box-shadow: 2px 0 12px rgba(0,0,0,0.08); }
@@ -178,7 +182,14 @@ <h1>Animated Sprite</h1>
178182
</div>
179183
</div>
180184
</div>
181-
<footer><p>C++ Mode for Processing</p></footer>
185+
<footer>
186+
<p>C++ Mode for Processing</p>
187+
<p class="footer-contact">
188+
<a href="mailto:pep84c@gmail.com">pep84c@gmail.com</a>
189+
<span class="footer-sep">&middot;</span>
190+
<a href="https://discord.gg/vShSrPegJT">Discord</a>
191+
</p>
192+
</footer>
182193
<script>function copyCode() {
183194
navigator.clipboard.writeText(document.getElementById('code-pre').innerText).then(() => {
184195
const btn = document.querySelector('.copy-btn');

examples/arctangent.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
.welcome h1 { font-size: 1.8rem; font-weight: 600; margin-bottom: 1rem; }
3838
.welcome p { color: #555; line-height: 1.8; max-width: 500px; }
3939
footer { border-top: 1px solid #e0e0e0; padding: 2rem; text-align: center; font-size: 13px; color: #888; }
40+
.footer-contact { margin-top: 0.4rem; font-size: 12px; }
41+
.footer-contact a { color: #aaa; border-bottom: 1px solid transparent; }
42+
.footer-contact a:hover { color: #111; border-bottom-color: #111; }
43+
.footer-sep { color: #ccc; margin: 0 0.5rem; }
4044
@media (max-width: 768px) {
4145
.hamburger { display: block; }
4246
.sidebar-outer { position: fixed; top: 60px; left: -240px; width: 240px; height: calc(100vh - 60px); background: #fff; z-index: 200; transition: left 0.25s ease; box-shadow: 2px 0 12px rgba(0,0,0,0.08); }
@@ -173,7 +177,14 @@ <h1>Arctangent</h1>
173177
</div>
174178
</div>
175179
</div>
176-
<footer><p>C++ Mode for Processing</p></footer>
180+
<footer>
181+
<p>C++ Mode for Processing</p>
182+
<p class="footer-contact">
183+
<a href="mailto:pep84c@gmail.com">pep84c@gmail.com</a>
184+
<span class="footer-sep">&middot;</span>
185+
<a href="https://discord.gg/vShSrPegJT">Discord</a>
186+
</p>
187+
</footer>
177188
<script>function copyCode() {
178189
navigator.clipboard.writeText(document.getElementById('code-pre').innerText).then(() => {
179190
const btn = document.querySelector('.copy-btn');

0 commit comments

Comments
 (0)