Skip to content

Commit

Permalink
Fix multiple modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Sep 21, 2014
1 parent 17cebc7 commit 54377c4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions doxydown.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Data::Dumper;
use Digest::MD5 qw(md5_hex);

my %modules = ();
my @modules;
my %options = ();
my $cur_module;
my $example_language = "lua";
Expand Down Expand Up @@ -116,7 +116,8 @@ sub print_function_markdown {
}

sub print_markdown {
while ( my ( $mname, $m ) = each %modules ) {
for my $m (@modules) {
my $mname = $m->{name};
print_module_markdown( $mname, $m );

print
Expand Down Expand Up @@ -225,17 +226,17 @@ sub parse_function {
sub parse_module {
my ( $module, @data ) = @_;

my ($name) = ( $module =~ /^\@module\s*(.+)\s*$/ );

$modules{$name} = {
my ( $name ) = ( $module =~ /^\@module\s*(.+)\s*$/ );

my $f = {
name => $name,
functions => [],
methods => [],
data => '',
example => undef,
example_language => $example_language,
id => make_id( $name, "module" ),
};
my $f = $modules{$name};
my $example = 0;

foreach (@data) {
Expand All @@ -261,10 +262,11 @@ sub parse_module {
chomp $f->{'example'};
}
$cur_module = $f;
push @modules, $f;
}

sub parse_content {
my @func = grep /^\@(?:function)|(?:method).+$/, @_;
my @func = grep /^(?:\@function)|(?:\@method).+$/, @_;
if ( scalar @func > 0 ) {
parse_function( $func[0], @_ );
}
Expand Down Expand Up @@ -337,5 +339,5 @@ sub HELP_MESSAGE {
}
}

#print Dumper( \%modules );
#print Dumper( \@modules );
print_markdown;

0 comments on commit 54377c4

Please sign in to comment.