ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/doc/lib/PodHelp.pm
Revision: 1.5
Committed: Tue Aug 28 17:08:06 2007 UTC (19 years, 2 months ago) by pippijn
Branch: MAIN
Changes since 1.4: +2 -2 lines
Log Message:
- changed name
- updated the example config to the new system
- added more documentation
- enhanced documentation generators
- added a link to the pdf to the website
- added an RSS feed generator
- transitioned hooks to c++ callbacks
- did various merges with upstream along the way
- added const where appropriate
- removed the old block allocator
- fixed most memory leaks
- transitioned some dictionaries to std::map
- transitioned some lists to std::vector
- made some free functions members where appropriate
- renamed string to dynstr and added a static string ststr
- use NOW instead of time (NULL) if possible
- completely reworked database backends, crypto handlers and protocol handlers
  to use an object factory
- removed the old module system. ermyth does not do any dynamic loading anymore
- fixed most of the build system
- reworked how protocol commands work

File Contents

# User Rev Content
1 pippijn 1.1 package PodHelp;
2    
3     use strict;
4     use warnings;
5     use utf8;
6    
7 pippijn 1.5 my $rcsid = '$Id: PodHTML.pm,v 1.4 2007-07-25 01:06:22 pippijn Exp $';
8 pippijn 1.2
9 pippijn 1.1 use base "Pod::POM::View";
10    
11     our $subdir;
12    
13     sub view_pod {
14     my ($self, $item) = @_;
15     mkdir "help";
16     mkdir "help/$subdir";
17     $item->content->present ($self)
18     }
19    
20     sub view_head1 {
21     my ($self, $item) = @_;
22     my $file;
23     if ($item->title =~ /\|/) {
24     my @cmds = split /\|/, $item->title;
25     for my $cmd (@cmds) {
26     my $content = "Help for \002$cmd\002:\n" . $item->content->present ($self);
27     $content =~ s/\$CMD/$cmd/g;
28     $file = "help/$subdir/" . lc $cmd;
29     $file =~ s/ /_/g;
30     open my $fh, ">", $file;
31     print $fh $content;
32     close $fh;
33     }
34     } else {
35     $file = "help/$subdir/" . lc $item->title;
36     $file =~ s/ /_/g;
37     open my $fh, ">", $file;
38     print $fh "Help for \002", $item->title->present ($self), "\002\n",
39 pippijn 1.5 $item->content->present ($self);
40 pippijn 1.1 close $fh
41     }
42     }
43    
44     sub view_head2 {
45     my ($self, $item) = @_;
46     "\n", $item->title->present ($self), ":",
47     $item->content->present ($self);
48     }
49    
50     sub view_seq_index { "<$_[1]>" }
51     sub view_seq_bold { "\002$_[1]\002" }
52     sub view_seq_space { "[$_[1]]" }
53     sub view_verbatim { "\n$_[1]" }
54     sub view_textblock { "\n$_[1]\n" }
55    
56     sub view_for {
57     my ($self, $item) = @_;
58     my $format = $item->format;
59     my $text = $item->text;
60     $text =~ s/X<([^>]+)>/<$1>/g;
61     $text =~ s/S<([^>]+)>/[$1]/g;
62    
63     "\n$format $text\n"
64     }
65    
66 pippijn 1.3 =head1 AUTHOR
67    
68     Copyright © 2007 Pippijn van Steenhoven
69    
70     =head1 LICENSE
71    
72     This library is free software, you can redistribute it and/or modify
73 pippijn 1.4 it under the terms of the GNU General Public License.
74 pippijn 1.3
75     =cut
76    
77     1