~ubuntu-branches/ubuntu/trusty/libhtml-widgets-navmenu-perl/trusty

« back to all changes in this revision

Viewing changes to examples/article-examples/complex/H-W-NM-complex.pl

  • Committer: Package Import Robot
  • Author(s): Xavier Guimard, Ansgar Burchardt, Xavier Guimard
  • Date: 2012-12-09 16:00:54 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20121209160054-wpsifb48isn5ul91
Tags: 1.0603-1
[ Ansgar Burchardt ]
* debian/control: Convert Vcs-* fields to Git.

[ Xavier Guimard ]
* Imported Upstream version 1.0603
* Bump Standards-Version to 3.9.4
* Update debian/copyright format
* Update spelling patch (reported)

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
    padding-top : 0em;
16
16
    margin-left : 1em;
17
17
    background-color : white
18
 
    
 
18
 
19
19
}
20
20
.navbar {
21
21
    float : left;
22
 
    background-color : moccasin; 
 
22
    background-color : moccasin;
23
23
    width : 20%;
24
24
    border-color : black;
25
25
    border-width : thick;
49
49
        {
50
50
            'text' => "About Myself",
51
51
            'url' => "me/",
52
 
            'subs' => 
 
52
            'subs' =>
53
53
            [
54
54
                {
55
55
                    'text' => "Bio",
76
76
                        },
77
77
                    ],
78
78
                },
79
 
            ],               
 
79
            ],
80
80
        },
81
81
        {
82
 
            'text' => "Humour", 
 
82
            'text' => "Humour",
83
83
            'url' => "humour/",
84
84
            'title' => "My Humorous Creations",
85
 
            'subs' => 
 
85
            'subs' =>
86
86
            [
87
87
                {
88
 
                    'text' => "The Enemy", 
 
88
                    'text' => "The Enemy",
89
89
                    'url' => "humour/TheEnemy/",
90
90
                    'title' => "The Enemy and How I Helped to Fight It",
91
91
                },
138
138
            'text' => "Software",
139
139
            'url' => "open-source/",
140
140
            'title' => "Pages related to Software (mostly Open-Source)",
141
 
            'subs' => 
 
141
            'subs' =>
142
142
            [
143
143
                {
144
144
                    'text' => "Freecell Solver",
192
192
            ],
193
193
        },
194
194
        {
195
 
            'text' => "Lectures", 
 
195
            'text' => "Lectures",
196
196
            'url' => "lecture/",
197
197
            'title' => "Presentations I Wrote (Mostly Technical)",
198
 
            'subs' => 
 
198
            'subs' =>
199
199
            [
200
200
                {
201
201
                    'text' => "Perl for Newbies",
259
259
 
260
260
my %hosts =
261
261
(
262
 
    'hosts' => 
263
 
    { 
264
 
        'default' => 
265
 
        { 
266
 
            'base_url' => ("http://web-cpan.berlios.de/modules/" . 
 
262
    'hosts' =>
 
263
    {
 
264
        'default' =>
 
265
        {
 
266
            'base_url' => ("http://web-cpan.berlios.de/modules/" .
267
267
                "HTML-Widgets-NavMenu/article/examples/simple/dest/"),
268
 
        }, 
 
268
        },
269
269
    },
270
270
);
271
271
 
272
272
my @page_paths =
273
 
("", "me/", "personal.html", "me/contact-me/", "me/resumes/", "resume.html", 
274
 
"resume_detailed.html", "humour/", "humour/TheEnemy/", "humour/TOWTF/", 
275
 
"humour/Pope/", "humour.html", "humour/fortunes/", "MathVentures/", 
276
 
"art/", "art/bk2hp/", "art/linux_banner/", "open-source/", 
277
 
"open-source/projects/freecell-solver/", "jmikmod/", "rwlock/", 
278
 
"open-source/projects/quad-pres/", "open-source/favourite/", 
279
 
"open-source/interviews/", "open-source/contributions/", 
280
 
"open-source/bits.html", "abstraction/", "software-tools/", "lecture/", 
281
 
"lecture/Perl/Newbies/", "lecture/Freecell-Solver/", "lecture/lc/", 
282
 
"lecture/Gimp/", "lecture/Autotools/", "lecture/WebMetaLecture/", 
283
 
"essays/", "essays/Index/", "essays/open-source/", "essays/life/", 
 
273
("", "me/", "personal.html", "me/contact-me/", "me/resumes/", "resume.html",
 
274
"resume_detailed.html", "humour/", "humour/TheEnemy/", "humour/TOWTF/",
 
275
"humour/Pope/", "humour.html", "humour/fortunes/", "MathVentures/",
 
276
"art/", "art/bk2hp/", "art/linux_banner/", "open-source/",
 
277
"open-source/projects/freecell-solver/", "jmikmod/", "rwlock/",
 
278
"open-source/projects/quad-pres/", "open-source/favourite/",
 
279
"open-source/interviews/", "open-source/contributions/",
 
280
"open-source/bits.html", "abstraction/", "software-tools/", "lecture/",
 
281
"lecture/Perl/Newbies/", "lecture/Freecell-Solver/", "lecture/lc/",
 
282
"lecture/Gimp/", "lecture/Autotools/", "lecture/WebMetaLecture/",
 
283
"essays/", "essays/Index/", "essays/open-source/", "essays/life/",
284
284
"links.html");
285
285
 
286
286
 
287
 
my @pages = 
288
 
    (map { 
289
 
        +{ 'path' => $_, 'title' => "Title for $_", 
 
287
my @pages =
 
288
    (map {
 
289
        +{ 'path' => $_, 'title' => "Title for $_",
290
290
        'content' => "<p>Content for $_</p>" }
291
291
    } @page_paths);
292
292
 
295
295
    my $path = $page->{'path'};
296
296
    my $title = $page->{'title'};
297
297
    my $content = $page->{'content'};
298
 
    my $nav_menu = 
 
298
    my $nav_menu =
299
299
        HTML::Widgets::NavMenu->new(
300
300
            path_info => "/$path",
301
301
            current_host => "default",
306
306
    my $nav_menu_results = $nav_menu->render();
307
307
 
308
308
    my $nav_menu_text = join("\n", @{$nav_menu_results->{'html'}});
309
 
    
 
309
 
310
310
    my $file_path = $path;
311
311
    if (($file_path =~ m{/$}) || ($file_path eq ""))
312
312
    {
314
314
    }
315
315
    my $full_path = "dest/$file_path";
316
316
    $full_path =~ m{^(.*)/[^/]+$};
317
 
    # mkpath() throws an exception if it isn't successful, which will cause 
 
317
    # mkpath() throws an exception if it isn't successful, which will cause
318
318
    # this program to terminate. This is what we want.
319
319
    mkpath($1, 0, 0755);
320
320
    open my $out, ">", $full_path or
321
321
        die "Could not open \"$full_path\" for writing!";
322
 
    
 
322
 
323
323
    print {$out} <<"EOF";
324
324
<?xml version="1.0" encoding="iso-8859-1"?>
325
325
<!DOCTYPE html
326
326
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
327
 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">    
 
327
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
328
328
<html>
329
329
<head>
330
330
<title>$title</title>