Skip to content

Commit 87e108c

Browse files
committed
Generate libraries/tools lists from contributions.txt/legacy.txt
1 parent 2bd2794 commit 87e108c

7 files changed

Lines changed: 1097 additions & 1316 deletions

File tree

content/static/libraries.html

100644100755
Lines changed: 864 additions & 1244 deletions
Large diffs are not rendered by default.

content/static/tools.html

100644100755
Lines changed: 63 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,64 @@
1-
<p class="clear">&nbsp;</p>
1+
<div class='contributions'>
2+
<ul>
3+
<li>
4+
<h5><a href="http://code.google.com/p/color-selector-plus/">Color Selector Plus</a></h5>
5+
<span>by Manindra Moharana</span>
6+
<p>Advanced color selector and screen color picker.</p>
7+
</li>
8+
<li>
9+
<h5><a href="http://www.lagers.org.uk/g4ptool/index.html">G4PTool</a></h5>
10+
<span>by <a href='http://www.lagers.org.uk'>Peter Lager</a></span>
11+
<p>Graphic design tool for creating user interfaces with G4P.</p>
12+
</li>
13+
<li>
14+
<h5><a href="https://github.com/Manindra29/Sketch-Outline">Sketch Outline</a></h5>
15+
<span>by <a href='http://www.mkmoharana.com/'>Manindra Moharana</a></span>
16+
<p>Provides an outline view of the member variables, functions and classes within a sketch and allows easy navigation between them. Similar to the outline view in Eclipse.</p>
17+
</li>
18+
<li>
19+
<h5><a href="http://www.lagers.org.uk/appletutil/">AppletMaker</a></h5>
20+
<span>by <a href='http://www.lagers.org.uk'>Peter Lager</a></span>
21+
<p>Applet exporter and signer.</p>
22+
</li>
23+
<li>
24+
<h5><a href="http://poifox.com/templater/">Templater</a></h5>
25+
<span>by <a href='http://poifox.com'>Jonathan Acosta</a></span>
26+
<p>Save your current sketch as a template for later use.</p>
27+
</li>
28+
<li>
29+
<h5><a href="http://poifox.com/bootstrap/">Bootstrap</a></h5>
30+
<span>by <a href='http://poifox.com'>Jonathan Acosta</a></span>
31+
<p>Quickly initialize your new sketch with a predefined template.</p>
32+
</li>
33+
</ul>
234

3-
<div class="threecol">
4-
5-
<h5><a href="http://github.com/fjenett/processingjstool" target="_new">&raquo; Processing.js</a></h5>
6-
<p>by <a href="http://bezier.de" target="_new">Florian Jenett</a><br />
7-
Export your sketch as HTML + Processing.js.
8-
</p>
9-
10-
<h5><a href="http://www.drifkin.net/beziereditor/beziereditor-latest.zip" target="_new">&raquo; Bezier Editor</a></h5>
11-
<p>by <a href="http://www.drifkin.net/" target="_new">Devon Rifkin</a><br />
12-
Visually create Bézier splines and then generate code that represents the splines.
13-
</p>
14-
15-
<h5><a href="http://github.com/sansumbrella/Processing-ObliqueStrategies" target="_new">&raquo; Oblique Strategies</a></h5>
16-
<p>by <a href="http://sansumbrella.com/" target="_new">David Wicks</a><br />
17-
Creates useful dilemmas for your work. Run it whenever you hit a slow spot to
18-
give yourself something new to think about.
19-
</p>
20-
21-
<h5><a href="http://www.lagers.org.uk/g4ptool/index.html" target="_new">&raquo; G4PTool</a> <span style="color:33399CC;font-style:italic;">new</span></h5>
22-
<p>by <a href="http://www.lagers.org.uk" target="_new">Peter Lager</a><br />
23-
Provides a visual environment for the rapid creation and editing of user interfaces using GUI controls from the <a href="http://www.lagers.org.uk/g4p/" target="_new">G4P</a> library. It generates all the source code necessary for the creation of the components and skeleton event handlers for user to complete. The <a href="http://www.lagers.org.uk/g4p/" target="_new">G4P</a> library will need to be installed to run the completed sketch.
24-
</p>
25-
26-
</div>
27-
28-
<div class="threecol">
29-
30-
<h5><a href="http://www.drifkin.net/timeline/" target="_new">&raquo; Timeline</a></h5>
31-
<p>by <a href="http://www.drifkin.net/" target="_new">Devon Rifkin</a><br />
32-
Graphical tool that allows you to draw curves representing variables over time. The Timeline Library allows you to use these variables in your sketches.
33-
</p>
34-
35-
<h5><a href="http://github.com/fjenett/doodle" target="_new">&raquo; Doodle</a></h5>
36-
<p>by <a href="http://bezier.de" target="_new">Florian Jenett</a><br />
37-
Simplistic inline vector editor. Code can be parsed to vector objects to be edited and converted back to code.
38-
</p>
39-
40-
<h5><a href="http://code.google.com/p/color-selector-plus/" target="_new">&raquo; Color Selector Plus</a> <span style="color:33399CC;font-style:italic;">new</span></h5>
41-
<p>by <a href="http://quarkninja.blogspot.in/" target="_new">Manindra Moharana</a><br />
42-
Advanced color selector and screen color picker.
43-
</p>
44-
45-
<h5><a href="https://github.com/Manindra29/Sketch-Outline" target="_new">&raquo; Sketch Outline</a> <span style="color:33399CC;font-style:italic;">new</span></h5>
46-
<p>by <a href="http://www.mkmoharana.com/" target="_new">Manindra Moharana</a><br />
47-
Provides an outline view of the member variables, functions and classes within a sketch and allows easy navigation between them. Similar to the outline view in Eclipse.
48-
</p>
49-
50-
</div>
51-
52-
<div class="threecol">
53-
54-
<h5><a href="http://github.com/fjenett/simplelivecoding" target="_new">&raquo; Simple Live Coding</a></h5>
55-
<p>by <a href="http://bezier.de" target="_new">Florian Jenett</a><br />
56-
Sketches written in basic mode can be run and watched live in the PDE allowing for a sort of live-coding workflow.
57-
</p>
58-
59-
<h5><a href="http://inittemplatep5.sourceforge.net/" target="_new">&raquo; InitSketchFromTemplate</a></h5>
60-
<p>by <a href="http://sourceforge.net/users/opodev" target="_new">0p0</a><br />
61-
Reads a template file you create to initialize the sketch you are currently working on.
62-
</p>
63-
64-
<h5><a href="http://thomasdiewald.com/processing/tools/TabManager/" target="_new">&raquo; TabManager</a> <span style="color:33399CC;font-style:italic;">new</span></h5>
65-
<p>by <a href="http://thomasdiewald.com/" target="_new">Thomas Diewald</a><br />
66-
Lists the tabs (sketchcodes) vertically in a separate window. The tabs order/position/color/height is customizable. This tool can be docked to the Processing IDE on all four sides.
67-
</p>
68-
69-
</div>
70-
71-
<p class="clear">&nbsp;</p>
72-
<br />
73-
<br />
35+
<div class='legacy'>
36+
<h1>Legacy</h1>
37+
<ul>
38+
<li>
39+
<h5><a href="http://www.drifkin.net/beziereditor/beziereditor-latest.zip">Bezier Editor</a></h5>
40+
<span>by <a href='http://www.drifkin.net/'>Devon Rifkin</a></span>
41+
<p>Visually create Bézier splines and then generate code that represents the splines.</p>
42+
</li>
43+
<li>
44+
<h5><a href="http://www.drifkin.net/timeline/">Timeline</a></h5>
45+
<span>by <a href='http://www.drifkin.net/'>Devon Rifkin</a></span>
46+
<p>Graphical tool that allows you to draw curves representing variables over time. The Timeline Library allows you to use these variables in your sketches.</p>
47+
</li>
48+
<li>
49+
<h5><a href="http://github.com/sansumbrella/Processing-ObliqueStrategies">Oblique Strategies</a></h5>
50+
<span>by <a href='http://sansumbrella.com/'>David Wicks</a></span>
51+
<p>Creates useful dilemmas for your work. Run it whenever you hit a slow spot to give yourself something new to think about.</p>
52+
</li>
53+
<li>
54+
<h5><a href="http://github.com/fjenett/doodle">Doodle</a></h5>
55+
<span>by <a href='http://bezier.de'>Florian Jenett</a></span>
56+
<p>Simplistic inline vector editor. Code can be parsed to vector objects to be edited and converted back to code.</p>
57+
</li>
58+
<li>
59+
<h5><a href="http://github.com/fjenett/simplelivecoding">Simple Live Coding</a></h5>
60+
<span>by <a href='http://bezier.de'>Florian Jenett</a></span>
61+
<p>Sketches written in basic mode can be run and watched live in the PDE allowing for a sort of live-coding workflow.</p>
62+
</li>
63+
</ul>
64+
</div>

generate/contributions.php

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
<?php
2+
3+
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~
4+
* Parse contributions.txt
5+
* Jon Gacnik (jmgacnik@gmail.com)
6+
* 04.16.2013
7+
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
8+
9+
require('../config.php');
10+
//$benchmark_start = microtime_float();
11+
12+
//Grab the contributions data from the text file
13+
$contributions = "\n".file_get_contents('../contrib_generate/contributions.txt');
14+
$contributions .= file_get_contents('../contrib_generate/legacy.txt');
15+
16+
//Split the contributions text file by contribution type
17+
$types = "/(\ntool|\nlibrary|\nmode)/";
18+
$flags = PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY;
19+
$items = preg_split( $types, $contributions, -1, $flags);
20+
21+
$byType = array(
22+
'library' => array(),
23+
'tool' => array(),
24+
'mode' => array()
25+
);
26+
27+
for($i = 0; $i < count($items); $i+=2){
28+
$items[$i] = preg_replace("/\n/", "", $items[$i]);
29+
array_push($byType[$items[$i]], $items[$i+1]);
30+
}
31+
32+
//After this we are left the $clean array holding all parsed contribution data
33+
foreach($byType as $type => &$contents){
34+
$count = 0;
35+
foreach($contents as &$entity){
36+
$entity = preg_split( "/(\n)/", $entity);
37+
array_shift($entity);
38+
array_pop($entity);
39+
40+
foreach($entity as &$line){
41+
$line = preg_replace('/=/', '===', $line, 1);
42+
$line = explode('===', $line);
43+
44+
$clean[$type][$count][$line[0]] = $line[1];
45+
}
46+
$count++;
47+
}
48+
}
49+
50+
51+
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~
52+
* Additional Parse Functions
53+
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
54+
55+
function linkParse($input){
56+
return preg_replace('/\[([^\[]+)\]\(([^\)]+)\)/', '<a href=\'\2\'>\1</a>', $input);
57+
}
58+
59+
function anchorSafe($input){
60+
return str_replace(' ','',strtolower($input));
61+
}
62+
63+
64+
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~
65+
* Build Pages
66+
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
67+
68+
///////////////
69+
//Libraries
70+
///////////////
71+
72+
//Push all libraries into array sorted by category
73+
$categories = array();
74+
foreach($clean['library'] as $library){
75+
array_push($categories, $library['category']);
76+
}
77+
$categories = array_unique($categories);
78+
sort($categories);
79+
80+
//Create a nav from each category (Except Legacy)
81+
$librariesHTML = '<div class="contributions">'."\n".'<div class="categories">'."\n";
82+
foreach($categories as $category){
83+
if($category != 'Legacy'){
84+
$librariesHTML .= "\t".'<a href="#'.anchorSafe($category).'">'.$category.'</a>'."\n";
85+
}
86+
}
87+
$librariesHTML .= '</div>'."\n";
88+
89+
//List out the Libraries by category (Except Legacy)
90+
foreach($categories as $category){
91+
if($category != 'Legacy'){
92+
$librariesHTML .= '<div id="'.anchorSafe($category).'">'."\n\t";
93+
$librariesHTML .= '<h1>'.$category.'</h1>'."\n";
94+
$librariesHTML .= "\t<ul>\n";
95+
$libs = array_filter($clean['library'], function($obj) use($category){ return $obj['category'] == $category; });
96+
97+
foreach($libs as $lib){
98+
$librariesHTML .= "\t\t<li>\n";
99+
$librariesHTML .= "\t\t\t".'<h5><a href="'.$lib['url'].'">'.$lib['name'].'</a></h5>'."\n";
100+
$librariesHTML .= "\t\t\t".'<span>by '.linkParse($lib['authorList']).'</span>'."\n";
101+
$librariesHTML .= strlen(trim($lib['sentence'])) ? "\t\t\t".'<p>'.linkParse($lib['sentence']).'</p>'."\n" : "\n";
102+
$librariesHTML .= "\t\t</li>\n";
103+
}
104+
$librariesHTML .= "\t</ul>\n";
105+
$librariesHTML .= '</div>'."\n\n";
106+
}
107+
}
108+
109+
//List out the Legacy Libraries
110+
$legacy = array_filter($clean['library'], function($obj) { return $obj['category'] == 'Legacy'; });
111+
$librariesHTML .= "<div class='legacy'>\n\t<h1>Legacy</h1>\n\t<ul>\n";
112+
foreach($legacy as $lib){
113+
$librariesHTML .= "\t\t<li>\n";
114+
$librariesHTML .= "\t\t\t".'<h5><a href="'.$lib['url'].'">'.$lib['name'].'</a></h5>'."\n";
115+
$librariesHTML .= "\t\t\t".'<span>by '.linkParse($lib['authorList']).'</span>'."\n";
116+
$librariesHTML .= strlen(trim($lib['sentence'])) ? "\t\t\t".'<p>'.linkParse($lib['sentence']).'</p>'."\n" : "\n";
117+
$librariesHTML .= "\t\t</li>\n";
118+
}
119+
$librariesHTML .= "</ul></div></div>";
120+
121+
//Write LibrariesHTML to libraries.html file
122+
$file_dir = CONTENTDIR.'static/';
123+
$file_name = strip_tags('libraries.html');
124+
$file = $file_dir.$file_name;
125+
126+
$create_file = fopen($file, "w+");
127+
$chmod = chmod($file, 0755);
128+
fwrite($create_file, $librariesHTML);
129+
fclose($create_file);
130+
131+
132+
///////////////
133+
//Tools
134+
///////////////
135+
136+
$toolsHTML = "<div class='contributions'>\n<ul>\n";
137+
$legacy = "<div class='legacy'>\n<h1>Legacy</h1>\n<ul>\n";
138+
139+
foreach($clean['tool'] as $tool){
140+
if($tool['category'] != 'Legacy'){
141+
$toolsHTML .= "\t<li>\n";
142+
$toolsHTML .= "\t\t".'<h5><a href="'.$tool['url'].'">'.$tool['name'].'</a></h5>'."\n";
143+
$toolsHTML .= "\t\t".'<span>by '.linkParse($tool['authorList']).'</span>'."\n";
144+
$toolsHTML .= strlen(trim($tool['sentence'])) ? "\t\t".'<p>'.linkParse($tool['sentence']).'</p>'."\n" : "\n";
145+
$toolsHTML .= "\t</li>\n";
146+
} else {
147+
$legacy .= "\t<li>\n";
148+
$legacy .= "\t\t".'<h5><a href="'.$tool['url'].'">'.$tool['name'].'</a></h5>'."\n";
149+
$legacy .= "\t\t".'<span>by '.linkParse($tool['authorList']).'</span>'."\n";
150+
$legacy .= strlen(trim($tool['sentence'])) ? "\t\t".'<p>'.linkParse($tool['sentence']).'</p>'."\n" : "\n";
151+
$legacy .= "\t</li>\n";
152+
}
153+
}
154+
$toolsHTML .= "</ul>\n\n".$legacy."</ul>\n</div>";
155+
156+
//Write toolsHTML to tools.html file
157+
$file_name = strip_tags('tools.html');
158+
$file = $file_dir.$file_name;
159+
160+
$create_file = fopen($file, "w+");
161+
$chmod = chmod($file, 0755);
162+
fwrite($create_file, $toolsHTML);
163+
fclose($create_file);
164+
165+
166+
?>

generate/libraries.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require_once('../config.php');
44
require_once('lib/Ref.class.php');
55
require_once('lib/Translation.class.php');
6+
require_once('./contributions.php');
67

78
$benchmark_start = microtime_float();
89

generate/libraries_local.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require_once('../config.php');
44
require_once('lib/Ref.class.php');
55
require_once('lib/Translation.class.php');
6+
require_once('./contributions.php');
67

78
$benchmark_start = microtime_float();
89

generate/tools.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
require_once('../config.php');
44
require_once('lib/Translation.class.php');
5+
require_once('./contributions.php');
56
$benchmark_start = microtime_float();
67

78

generate/tools_local.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
require_once('../config.php');
44
require_once('lib/Translation.class.php');
5+
require_once('./contributions.php');
56

67
$benchmark_start = microtime_float();
78

0 commit comments

Comments
 (0)