diff options
author | Norbert Preining <preining@logic.at> | 2015-06-14 13:37:04 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2015-06-14 13:37:04 +0000 |
commit | 7ea3b3e8d653b705a9ff6d3ff5aef6e1a2e4d38f (patch) | |
tree | b69ab4101f2f0ad0a5ef86ac921ec4df66f6ff3c /Master/tlpkg | |
parent | f78168070c9d00b91ffccb7b70a50e290f409afc (diff) |
TeX Catalogue: evaluate 'also' and 'topic' entries
git-svn-id: svn://tug.org/texlive/trunk@37521 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rw-r--r-- | Master/tlpkg/TeXLive/TeXCatalogue.pm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TeXCatalogue.pm b/Master/tlpkg/TeXLive/TeXCatalogue.pm index 2500cdf990e..7bf937b536a 100644 --- a/Master/tlpkg/TeXLive/TeXCatalogue.pm +++ b/Master/tlpkg/TeXLive/TeXCatalogue.pm @@ -45,6 +45,8 @@ sub new { texlive => $params{'texlive'}, miktex => $params{'miktex'}, version => $params{'version'}, + also => defined($params{'also'}) ? $params{'also'} : [], + topic => defined($params{'topic'}) ? $params{'topic'} : [], }; bless $self, $class; if (defined($self->{'ioref'})) { @@ -89,6 +91,20 @@ sub initialize { if ($details) { $self->{'docs'}{$docfile}{'details'} = "$details"; } if ($language) { $self->{'docs'}{$docfile}{'language'} = "$language"; } } + # parse the also entries + foreach my $node ($parser->find('/entry/also')->get_nodelist) { + my $alsoid = $parser->find('./@refid',$node); + push @{$self->{'also'}}, "$alsoid"; + } + # parse the keyval/topic entries + foreach my $node ($parser->find('/entry/keyval')->get_nodelist) { + my $k = $parser->find('./@key',$node); + my $v = $parser->find('./@value',$node); + # for now we only support evaluating the 'topic' key + if ("$k" eq 'topic') { + push @{$self->{'topic'}}, "$v"; + } + } } sub beautify { @@ -154,6 +170,18 @@ sub entry { if (@_) { $self->{'entry'} = \%newentry } return $self->{'entry'}; } +sub also { + my $self = shift; + my @newalso = @_; + if (@_) { $self->{'also'} = \@newalso } + return $self->{'also'}; +} +sub topics { + my $self = shift; + my @newtopics = @_; + if (@_) { $self->{'topic'} = \@newtopics } + return $self->{'topic'}; +} ################################################################ |