Skip to content

Commit 819eb3b

Browse files
committed
Cleaned of generation scripts for reference
1 parent 5306ba7 commit 819eb3b

5 files changed

Lines changed: 134 additions & 151 deletions

File tree

generate/environment_local.php

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,23 @@
11
<?
22
require('../config.php');
33
require('lib/Translation.class.php');
4+
45
$benchmark_start = microtime_float();
56

6-
$lang = isSet($_POST['lang']) ? $_POST['lang'] : 'en';
77

8-
$source = CONTENTDIR."/api_".$lang."/environment/";
8+
$source = CONTENTDIR."/api_en/environment/";
99
$path = DISTDIR."/environment/";
1010

11-
// get translation file
12-
//$translation = new Translation($lang);
13-
14-
#echo $source . "\n";
15-
#echo $path . "\n";
16-
1711
$page = new LocalPage('Environment (IDE)', 'Environment', 'Environment', '../');
1812
$page->content(file_get_contents($source.'index.html'));
1913
$page->language($lang);
20-
2114
writeFile($path.'index.html', $page->out());
2215

23-
//if (!is_dir(DISTDIR.'environment/images')) {
24-
rmdir(DISTDIR.'environment/images');
25-
mkdir(DISTDIR.'environment/images', '0751');
26-
//}
27-
copydirr(CONTENTDIR."api_$lang/environment/images", DISTDIR.'environment/images');
16+
if (is_dir(DISTDIR.'environment/images')) {
17+
rmdir(DISTDIR.'environment/images');
18+
}
19+
mkdir(DISTDIR.'environment/images', 0755);
20+
copydirr(CONTENTDIR."api_en/environment/images", DISTDIR.'environment/images');
2821

2922

3023
$benchmark_end = microtime_float();

generate/libraries_local.php

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,66 +3,40 @@
33
require_once('../config.php');
44
require_once('lib/Ref.class.php');
55
require_once('lib/Translation.class.php');
6-
$benchmark_start = microtime_float();
76

8-
// arguments
9-
$lang = isset($_POST['lang']) ? $_POST['lang'] : 'en';
7+
$benchmark_start = microtime_float();
108

11-
// get translation file
12-
//$translation = new Translation($lang);
139

14-
// each lib
15-
$libraries = array('net', 'serial', 'video', 'opengl', 'dxf', 'pdf');
1610

11+
$libraries = array('net', 'serial', 'video', 'dxf', 'pdf');
1712
$lib_dir = DISTDIR.'libraries';
1813

19-
//if (!is_dir(DISTDIR.'libraries/images')) {
20-
// mkdir(DISTDIR.'libraries/images', '0757');
21-
//}
22-
//copydirr(CONTENTDIR."api_$lang/libraries/images", DISTDIR.'libraries/images');
23-
//make_necessary_directories(DISTDIR.'libraries/images/include.php');
24-
//copydirr(CONTENTDIR."api_$lang/LIB_images", DISTDIR.'libraries/images');
2514

26-
// get library index
27-
$index = CONTENTDIR."api_$lang/libraries/index.html";
15+
// Create Library index
16+
$index = CONTENTDIR."api_en/libraries/index.html";
2817
$page = new LocalPage('Libraries', 'Libraries', 'Libraries', '../');
2918
$page->content(file_get_contents($index));
3019
writeFile('distribution/libraries/index.html', $page->out());
3120

32-
// foreach lib
21+
// For each Library
3322
foreach ($libraries as $lib)
3423
{
35-
$source = "api_$lang/LIB_$lib";
24+
$source = "api_en/LIB_$lib";
3625
$destination = "libraries/$lib";
3726
make_necessary_directories(DISTDIR.$destination.'/images/include');
38-
39-
// get xml files
40-
//if (!$files = getXMLFiles(CONTENTDIR.$source)) {
41-
//echo "couldn't open files";
42-
//} else {
43-
// parse xml files and create pages
44-
// foreach ($files as $file)
45-
// {
46-
// $page = new LocalLibReferencePage(new Ref($source.'/'.$file), $lib, $translation, '../../');
47-
// $page->write();
48-
// }
49-
//}
50-
51-
// template and copy index
27+
5228
$index = CONTENTDIR.$source.'/index.html';
5329
$page = new LocalPage(ucfirst($lib) . ' \\ Libraries', 'Libraries', 'Libraries', '../../');
5430
$page->content(file_get_contents($index));
5531
writeFile('distribution/'.$destination.'/index.html', $page->out());
56-
57-
// copy images directory
58-
//copydirr(CONTENTDIR.$source.'/images', DISTDIR.$destination.'/images');
5932
}
6033

61-
//if (!is_dir(DISTDIR.'libraries/images')) {
62-
rmdir(DISTDIR.'libraries/images');
63-
mkdir(DISTDIR.'libraries/images', '0751');
64-
//}
65-
copydirr(CONTENTDIR."api_$lang/libraries/images", DISTDIR.'libraries/images');
34+
if (!is_dir(DISTDIR.'libraries/images')) {
35+
rmdir(DISTDIR.'libraries/images');
36+
}
37+
mkdir(DISTDIR.'libraries/images', 0755);
38+
copydirr(CONTENTDIR."api_en/libraries/images", DISTDIR.'libraries/images');
39+
6640

6741
$benchmark_end = microtime_float();
6842
$execution_time = round($benchmark_end - $benchmark_start, 4);

generate/tools_local.php

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,28 @@
22

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

7-
// arguments
8-
$lang = isset($_POST['lang']) ? $_POST['lang'] : 'en';
9-
//$tools_dir = 'reference/'.($lang != 'en' ? "$lang/" : '').'tools';
10-
$tools_dir = DISTDIR.'tools';
118

12-
// get translation file
13-
//$translation = new Translation($lang);
9+
$tools_dir = DISTDIR.'tools';
1410

15-
// get tools index
11+
// Create Tools index
1612
$index = CONTENTDIR."api_en/tools/index.html";
17-
//$page = new Page('Tools', 'Tools');
1813
$page = new LocalPage('Tools', 'Tools', 'Tools', '../');
1914
$page->content(file_get_contents($index));
20-
//make_necessary_directories(BASEDIR.$tools_dir.'/images/include.php');
2115
writeFile('distribution/tools/index.html', $page->out());
2216

23-
//if (!is_dir(DISTDIR.'tools/images')) {
24-
rmdir(DISTDIR.'tools/images');
25-
mkdir(DISTDIR.'tools/images', '0751');
26-
//}
27-
copydirr(CONTENTDIR."api_$lang/tools/images", DISTDIR.'tools/images');
17+
// Create folder for images and copy them over
18+
if (is_dir(DISTDIR.'tools/images')) {
19+
rmdir(DISTDIR.'tools/images');
20+
}
21+
mkdir(DISTDIR.'tools/images', 0755);
22+
//chmod(DISTDIR.'tools/images', 0755);
23+
copydirr(CONTENTDIR.'api_en/tools/images', DISTDIR.'tools/images');
2824

29-
// copy over the files for the contributed libraries
25+
// Copy file for the contributed Tools
3026
copy(CONTENTDIR."static/tools.html", DISTDIR.'tools/tools.html');
31-
//copy(CONTENTDIR."static/tools.html", BASEDIR.$tools_dir.'/tools.html');
32-
//copydirr(CONTENTDIR.$source.'/images', DISTDIR.$destination.'/images');
3327

3428

3529
$benchmark_end = microtime_float();

generate/tutorials.php

Lines changed: 89 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,107 @@
1-
<?
2-
3-
require('../config.php');
4-
$benchmark_start = microtime_float();
5-
6-
// make troubleshooting page
7-
$source = CONTENTDIR."static/tutorials/";
8-
$path = BASEDIR;
9-
10-
11-
// update the files on the server via SVN
12-
13-
// look for the .subversion folder somewhere else
14-
// otherwise will go looking for /home/root/.subversion or some other user
15-
$where = CONTENTDIR . 'static/tutorials';
16-
putenv('HOME=' . CONTENTDIR);
1+
<?
172

3+
require('../config.php');
4+
$benchmark_start = microtime_float();
5+
6+
// make troubleshooting page
7+
$source = CONTENTDIR."static/tutorials/";
8+
$path = BASEDIR;
9+
10+
11+
// update the files on the server via SVN
12+
13+
// look for the .subversion folder somewhere else
14+
// otherwise will go looking for /home/root/.subversion or some other user
15+
$where = CONTENTDIR . 'static/tutorials';
16+
putenv('HOME=' . CONTENTDIR);
1817
// From: http://code.google.com/p/processing/source/checkout
18+
1919
// # Non-members may check out a read-only working copy anonymously over HTTP.
20+
2021
// svn checkout http://processing.googlecode.com/svn/trunk/ processing-read-only
21-
22-
// do the initial checkout
23-
//`cd /var/www/processing && /usr/bin/svn checkout http://processing.googlecode.com/svn/trunk/web/content/`;
24-
25-
`cd $where && /usr/bin/svn update`;
26-
27-
// Copy over the images for the tutorials index
28-
if (!is_dir($path.'learning/imgs')) {
22+
23+
// do the initial checkout
24+
//`cd /var/www/processing && /usr/bin/svn checkout http://processing.googlecode.com/svn/trunk/web/content/`;
25+
26+
`cd $where && /usr/bin/svn update`;
27+
28+
// Copy over the images for the tutorials index
29+
if (!is_dir($path.'learning/imgs')) {
30+
2931
mkdir($path.'learning/imgs', '0757');
32+
3033
}
31-
if (is_dir($path.'learning/imgs')) {
32-
copydirr($source.'imgs', $path.'learning/imgs', null, 0757, true);
33-
}
3434

35-
// Index page
35+
if (is_dir($path.'learning/imgs')) {
36+
copydirr($source.'imgs', $path.'learning/imgs', null, 0757, true);
3637

37-
$page = new Page("Tutorials", "Tutorials");
38-
$page->content(file_get_contents($source."index.html"));
39-
writeFile('learning/index.html', $page->out());
38+
}
4039

40+
// Index page
41+
$page = new Page("Tutorials", "Tutorials");
42+
$page->content(file_get_contents($source."index.html"));
43+
writeFile('learning/index.html', $page->out());
4144

4245
// Start making the individual tutorial pages
4346

44-
//////////////// NOW WE WILL HAVE A LOOP TO DO INDIVIDUAL TUTORIALS /////////////
45-
//////////////// BASED ON AN XML FILE TO READ /////////////
47+
48+
49+
// NOW WE WILL HAVE A LOOP TO DO INDIVIDUAL TUTORIALS
50+
51+
// BASED ON AN XML FILE TO READ
52+
4653

4754

4855
if( ! $xml = simplexml_load_file($source.'tutorials.xml') )
49-
{
50-
echo 'XML file missing';
56+
{
57+
58+
echo 'XML file missing';
59+
60+
5161
}
5262
else
53-
{
54-
foreach( $xml as $tutorial )
55-
{
56-
$title = $tutorial->title;
57-
$directory = $tutorial->directory;
58-
$imgs = $tutorial->imgs;
59-
$code = $tutorial->code;
60-
echo 'About to generate tutorial '.$title.' in directory '.$directory.', imgs dir = '.$imgs.', code dir = '.$code.'<br \>';
61-
echo 'Copying '.$source.$directory.'/index.html to ' . 'learning/'.$directory.'/index.html<br \>';
62-
63-
$page = new Page($title, "Tutorials");
64-
$page->content(file_get_contents($source.$directory.'/index.html'));
65-
writeFile('learning/'.$directory.'/index.html', $page->out());
66-
67-
if ($imgs == 'true') {
68-
$newpath = $path.'learning/'.$directory.'/imgs';
69-
if (!is_dir($newpath)) {
70-
mkdir($newpath, '0757');
71-
}
72-
if (is_dir($newpath)) {
73-
copydirr($source.$directory.'/imgs', $newpath, null, 0757, true);
74-
}
75-
}
76-
if ($code == 'true') {
77-
$newpath = $path.'learning/'.$directory.'/code';
78-
if (!is_dir($newpath)) {
79-
mkdir($newpath, '0757');
80-
}
81-
if (is_dir($newpath)) {
82-
copydirr($source.$directory.'/code', $newpath, null, 0757, true);
83-
}
84-
}
85-
}
86-
}
87-
$benchmark_end = microtime_float();
88-
$execution_time = round($benchmark_end - $benchmark_start, 4);
89-
90-
?>
91-
92-
<h2>Static page generation Successful</h2>
93-
<h2>Updated <?=$where?> </h2>
94-
<p>Generated files in <?=$execution_time?> seconds.</p>
95-
<!--<p>Page put here: <?=$source."faq.html"?></p>-->
96-
<!--<p>Page put here: <?=$path.'faq.html'?></p>-->
63+
{
64+
65+
foreach( $xml as $tutorial )
66+
{
67+
$title = $tutorial->title;
68+
$directory = $tutorial->directory;
69+
$imgs = $tutorial->imgs;
70+
$code = $tutorial->code;
71+
echo 'About to generate tutorial '.$title.' in directory '.$directory.', imgs dir = '.$imgs.', code dir = '.$code.'<br \>';
72+
echo 'Copying '.$source.$directory.'/index.html to ' . 'learning/'.$directory.'/index.html<br \>';
73+
$page = new Page($title, "Tutorials");
74+
$page->content(file_get_contents($source.$directory.'/index.html'));
75+
writeFile('learning/'.$directory.'/index.html', $page->out());
76+
if ($imgs == 'true') {
77+
$newpath = $path.'learning/'.$directory.'/imgs';
78+
if (!is_dir($newpath)) {
79+
mkdir($newpath, '0757');
80+
}
81+
if (is_dir($newpath)) {
82+
copydirr($source.$directory.'/imgs', $newpath, null, 0757, true);
83+
}
84+
}
85+
if ($code == 'true') {
86+
$newpath = $path.'learning/'.$directory.'/code';
87+
if (!is_dir($newpath)) {
88+
mkdir($newpath, '0757');
89+
}
90+
if (is_dir($newpath)) {
91+
copydirr($source.$directory.'/code', $newpath, null, 0757, true);
92+
}
93+
}
94+
}
95+
}
96+
97+
$benchmark_end = microtime_float();
98+
$execution_time = round($benchmark_end - $benchmark_start, 4);
99+
100+
?>
101+
102+
<h2>Static page generation Successful</h2>
103+
<h2>Updated <?=$where?> </h2>
104+
<p>Generated files in <?=$execution_time?> seconds.</p>
105+
<!--<p>Page put here: <?=$source."faq.html"?></p>-->
106+
<!--<p>Page put here: <?=$path.'faq.html'?></p>-->
97107
<!--<p><?=$path.'learning/eclipse/imgs'?></p>-->

java_generate/ReferenceGenerator/processingrefBuild.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/sh
22

3+
4+
# GENERATE REFERENCE ENTRIES AND INDEX THROUGH JAVADOC - BY DAVID WICKS
5+
36
#remove everything old
47
rm -rf ../../reference
58
mkdir ../../reference
@@ -24,8 +27,11 @@ javadoc -doclet ProcessingWeblet \
2427
../../../processing/java/libraries/video/src/processing/video/*.java \
2528
../../../processing/core/src/processing/core/*.java
2629

30+
31+
# COPY IMAGES FROM CONTENT FOLDER TO CORRECT FOLDERS
32+
2733
# manage web reference
28-
cp -R ../../css ../../reference/
34+
#cp -R ../../css ../../reference/
2935
mkdir -p ../../reference/images
3036
cp -R ../../content/api_media/*.jpg ../../reference/images/
3137
cp -R ../../content/api_media/*.gif ../../reference/images/
@@ -38,6 +44,9 @@ cp -R ../../content/api_media/*.jpg ../../distribution/images/
3844
cp -R ../../content/api_media/*.gif ../../distribution/images/
3945
cp -R ../../content/api_media/*.png ../../distribution/images/
4046

47+
48+
# COPY IMAGES
49+
4150
# copy images for web reference isn't needed because they are already on server
4251

4352
# copy images for local reference
@@ -49,11 +58,14 @@ cp ../../img/processing_cover.gif ../../distribution/img/
4958
cp ../../img/about/people-header.gif ../../distribution/img/about/
5059
cp ../../content/api_en/images/header.gif ../../distribution/img/
5160

61+
62+
# GENERATE OTHER REFERENCE CONTENT
63+
5264
# move to folder for generating other files
5365
cd ../../generate/
5466

5567
# run web reference creations files
56-
# the static pages are best run separately, the tools and libraries are run by the librarian
68+
# the static pages are run separately, the tools and libraries are run by the librarian
5769
#php staticpages.php
5870
#php tools.php
5971
#php libraries.php

0 commit comments

Comments
 (0)