From: Tobias Leich Date: Tue, 17 Nov 2009 18:49:24 +0000 (+0100) Subject: added thumbs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f2a2b915fdd9ae0af4322660b86b52dbc8603c2;p=sdlgit%2FSDL-Site.git added thumbs --- diff --git a/htdocs/assets/SDL_thumb.png b/htdocs/assets/SDL_thumb.png new file mode 100644 index 0000000..613e48f Binary files /dev/null and b/htdocs/assets/SDL_thumb.png differ diff --git a/htdocs/assets/bubble-1-mini.png b/htdocs/assets/bubble-1-mini.png new file mode 100644 index 0000000..613e48f Binary files /dev/null and b/htdocs/assets/bubble-1-mini.png differ diff --git a/htdocs/assets/bubble-2-mini.png b/htdocs/assets/bubble-2-mini.png new file mode 100644 index 0000000..02b30ed Binary files /dev/null and b/htdocs/assets/bubble-2-mini.png differ diff --git a/htdocs/assets/bubble-3-mini.png b/htdocs/assets/bubble-3-mini.png new file mode 100644 index 0000000..75acbc4 Binary files /dev/null and b/htdocs/assets/bubble-3-mini.png differ diff --git a/htdocs/assets/bubble-4-mini.png b/htdocs/assets/bubble-4-mini.png new file mode 100644 index 0000000..639ec20 Binary files /dev/null and b/htdocs/assets/bubble-4-mini.png differ diff --git a/htdocs/assets/bubble-5-mini.png b/htdocs/assets/bubble-5-mini.png new file mode 100644 index 0000000..cf2fbe9 Binary files /dev/null and b/htdocs/assets/bubble-5-mini.png differ diff --git a/htdocs/assets/bubble-6-mini.png b/htdocs/assets/bubble-6-mini.png new file mode 100644 index 0000000..46db2f6 Binary files /dev/null and b/htdocs/assets/bubble-6-mini.png differ diff --git a/htdocs/assets/bubble-7-mini.png b/htdocs/assets/bubble-7-mini.png new file mode 100644 index 0000000..c1f1274 Binary files /dev/null and b/htdocs/assets/bubble-7-mini.png differ diff --git a/htdocs/assets/bubble-8-mini.png b/htdocs/assets/bubble-8-mini.png new file mode 100644 index 0000000..a8b7160 Binary files /dev/null and b/htdocs/assets/bubble-8-mini.png differ diff --git a/pages/documentation.html-inc b/pages/documentation.html-inc index 2f59243..e2bb346 100644 --- a/pages/documentation.html-inc +++ b/pages/documentation.html-inc @@ -1,2 +1,2 @@
-

Documentation (latest development branch)

SDL
SDL::App
SDL::Cdrom
SDL::Color
SDL::Cookbook
SDL::Cookbook::PDL
SDL::Cursor
SDL::Event
SDL::Events
SDL::Font
SDL::Game::Palette
SDL::MPEG
SDL::Mixer
SDL::MultiThread
SDL::Music
SDL::OpenGL
SDL::Overlay
SDL::Palette
SDL::PixelFormat
SDL::Rect
SDL::SFont
SDL::SMPEG
SDL::Sound
SDL::Surface
SDL::TTFont
SDL::Timer
SDL::Tool::Font
SDL::Tool::Graphic
SDL::Tutorial
SDL::Tutorial::Animation
SDL::Tutorial::Images
SDL::Tutorial::LunarLander
SDL::Tutorial::Pong
SDL::Tutorial::Tetris
SDL::Video
SDL::VideoInfo
Time
+

Documentation (latest development branch)

thumbSDL Simple DirectMedia Layer for Perl
thumbSDL::App a SDL perl extension
thumbSDL::Cdrom a SDL perl extension for managing CD-ROM drives
thumbSDL::Color Format independent color description
thumbSDL::Cookbook
thumbSDL::Cookbook::PDL
thumbSDL::Cursor a SDL perl extension
thumbSDL::Event General event structure
thumbSDL::Events Bindings to the Events Category in SDL API
thumbSDL::Font a SDL perl extension
thumbSDL::Game::Palette a perl extension
thumbSDL::MPEG a SDL perl extension
thumbSDL::Mixer a SDL perl extension
thumbSDL::MultiThread Bindings to the MultiThread category in SDL API
thumbSDL::Music a perl extension
thumbSDL::OpenGL a perl extension
thumbSDL::Overlay YUV Video overlay
thumbSDL::Palette a perl extension
thumbSDL::PixelFormat Stores surface format information
thumbSDL::Rect Defines a rectangular area
thumbSDL::SFont a perl extension
thumbSDL::SMPEG a SDL perl extension
thumbSDL::Sound a perl extension
thumbSDL::Surface
thumbSDL::TTFont a SDL perl extension
thumbSDL::Timer a SDL perl extension to handle timers
thumbSDL::Tool::Font a perl extension
thumbSDL::Tool::Graphic
thumbSDL::Tutorial introduction to Perl SDL
thumbSDL::Tutorial::Animation
thumbSDL::Tutorial::Images
thumbSDL::Tutorial::LunarLander a small tutorial on Perl SDL
thumbSDL::Tutorial::Pong
thumbSDL::Tutorial::Tetris
thumbSDL::Video Bindings to the video category in SDL API
thumbSDL::VideoInfo Video Target Information
thumbTime a SDL perl extension for managing timers.
diff --git a/tools/PM-Pod2html-snippet.pl b/tools/PM-Pod2html-snippet.pl index 09c30bf..f93cf9a 100644 --- a/tools/PM-Pod2html-snippet.pl +++ b/tools/PM-Pod2html-snippet.pl @@ -18,6 +18,7 @@ my $pages_path = catdir($parent_dir, 'pages'); my $assets_path = catdir($parent_dir, 'htdocs/assets'); my $parser = Pod::Xhtml->new(FragmentOnly => 1, StringMode => 1); my %module_names = (); +my %thumbnails = (); my $fh; read_file($input_path); @@ -25,15 +26,28 @@ read_file($input_path); # creating index file open($fh, '>', File::Spec->catfile($pages_path, 'documentation.html-inc')); binmode($fh, ":utf8"); -print($fh "
\n

Documentation (latest development branch)

"); +print($fh "
\n

Documentation (latest development branch)

"); for my $module_name (sort keys %module_names) { - print($fh '', - $module_name, - '
' - ); + my $icon = sprintf('thumb', int((rand() * 7) + 1)); + my $name = $module_name; + my $desc = ''; + + if($module_name =~ /^([^\-]+)\-(.+)$/) + { + $name = $1; + $desc = $2; + } + + if(defined $thumbnails{$module_name}) + { + $icon = sprintf('thumb', $thumbnails{$module_name}); + } + + printf($fh '', + $icon, $module_names{$module_name}, $name, $desc); } -print($fh "\n"); +print($fh "
%s%s%s
\n"); close($fh); sub read_file @@ -46,6 +60,23 @@ sub read_file read_file($_) if(-d $_); if($_ =~ /\.pod$/i) { + my $file_name = $_; + $file_name =~ s/^$input_path\/*//; + my $module_name = $file_name; + $module_name =~ s/\//::/g; + $module_name =~ s/(\.pm|\.pod)$//i; + $file_name =~ s/\//-/g; + $file_name =~ s/(\.pm|\.pod)$/.html-inc/i; + my $file_path = $file_name; + $file_path =~ s/\-inc$//; + $file_name = File::Spec->catfile($pages_path, $file_name); + $parser->parse_from_file($_); #, $file_name); + + $module_name .= " - $1" if $parser->asString =~ /
\s*

\s*[^<>\-]+\-([^<>]+)\s*<\/p>\s*<\/div>/; + + $module_names{$module_name} = $file_path; + + # handling images my $image_path = $_; $image_path =~ s/\.pod$//; my @images = <$image_path*>; @@ -54,32 +85,25 @@ sub read_file foreach my $image_file (@images) { - if($image_file =~ /^($image_path)(_\d+){0,1}\.(jpg|jpeg|png|gif)$/) + if($image_file =~ /^($image_path)(_\w+){0,1}\.(jpg|jpeg|png|gif)$/) { my (undef, undef, $image_file_name) = splitpath($image_file); - $image_html .= sprintf('' - . '%s' - . '', $image_file_name, $image_file_name, $image_file_name); - + if($image_file_name =~ /_thumb\.(jpg|jpeg|png|gif)$/) + { + $thumbnails{$module_name} = $image_file_name; + } + else + { + $image_html .= sprintf('' + . '%s' + . '', $image_file_name, $image_file_name, $image_file_name); + } + copy($image_file, File::Spec->catfile($assets_path, $image_file_name)); } } - my $file_name = $_; - $file_name =~ s/^$input_path\/*//; - my $module_name = $file_name; - $module_name =~ s/\//::/g; - $module_name =~ s/(\.pm|\.pod)$//i; - $file_name =~ s/\//-/g; - $file_name =~ s/(\.pm|\.pod)$/.html-inc/i; - my $file_path = $file_name; - $file_path =~ s/\-inc$//; - $module_names{$module_name} = $file_path; - $file_name = File::Spec->catfile($pages_path, $file_name); - - $parser->parse_from_file($_); #, $file_name); - # modifying the html-snippet and insert the images my $html = $parser->asString; $html =~ s//$image_html


/ if $image_html;