File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ <h1>Pie Chart</h1>
108108 </ div >
109109 < pre id ="code-pre "> /**
110110 * Pie Chart
111- * Translated to C++ by Jose Llamas.
111+ * Translated to C++ by Jose Gonzalez Llamas.
112112 *
113113 * Uses the arc() function to generate a pie chart from the data
114114 * stored in an array.
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ <h1>C++ Mode for<br><span class="proc">Processing</span></h1>
183183 < a class ="hero-link " href ="/reference "> Reference</ a >
184184 < a class ="hero-btn-download " href ="/downloads "> Download</ a >
185185 </ div >
186- < p style ="margin-top:10rem;font-size:0.85rem;color:#aaa; "> Independently developed by Jose Llamas</ p >
186+ < p style ="margin-top:10rem;font-size:0.85rem;color:#aaa; "> Independently developed by Jose Gonzalez Llamas</ p >
187187 </ div >
188188 < div class ="right ">
189189 < img src ="assets/cpp-logo.png " alt ="Processing for C++ ">
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ """
3+ Generate assets/cppmode-keywords.js from sketchbook/modes/CppMode/keywords.txt
4+ Run whenever keywords.txt changes.
5+ """
6+ from pathlib import Path
7+
8+ KEYWORDS_TXT = Path .home () / "sketchbook/modes/CppMode/keywords.txt"
9+ OUT = Path (__file__ ).parent / "assets/cppmode-keywords.js"
10+
11+ cats = {}
12+
13+ for line in KEYWORDS_TXT .read_text ().splitlines ():
14+ line = line .strip ()
15+ if not line or line .startswith ('#' ):
16+ continue
17+ parts = line .split ()
18+ if len (parts ) >= 2 :
19+ word , cat = parts [0 ], parts [1 ]
20+ cats .setdefault (cat , []).append (word )
21+
22+ def js_set (words ):
23+ quoted = ", " .join (f'"{ w } "' for w in sorted (set (words )))
24+ return f"new Set([{ quoted } ])"
25+
26+ lines = ["// AUTO-GENERATED from keywords.txt -- do not edit manually" ,
27+ "// Run: python3 regen_keywords.py" ,
28+ "" ,
29+ "var CPPMODE_KEYWORDS = {" ]
30+
31+ for cat , words in sorted (cats .items ()):
32+ lines .append (f" { cat } : { js_set (words )} ," )
33+
34+ lines += ["};" , "" ]
35+
36+ OUT .write_text ("\n " .join (lines ))
37+ total = sum (len (v ) for v in cats .values ())
38+ print (f"Written { OUT } ({ total } entries across { len (cats )} categories)" )
39+ for cat , words in sorted (cats .items ()):
40+ print (f" { cat } : { len (words )} words" )
You can’t perform that action at this time.
0 commit comments