Skip to content

Commit

Permalink
Adding POD
Browse files Browse the repository at this point in the history
  • Loading branch information
phochste committed Jul 7, 2016
1 parent 51f3958 commit d95a5f1
Show file tree
Hide file tree
Showing 12 changed files with 141 additions and 2,020 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -10,9 +10,9 @@ Build.PL
META.*
MYMETA.*
Catmandu-MARC-*
data
local
cpanfile.snapshot
.perl-version
nytprof.out
nytprof/
bench/
6 changes: 6 additions & 0 deletions lib/Catmandu/Fix/Condition/marc_match.pm
Expand Up @@ -54,6 +54,12 @@ Catmandu::Fix::Condition::marc_match - Conditionals on MARC fields
Evaluate the enclosing fixes only if the MARC (sub)field matches a
regular expression.
=head1 METHODS
=head2 marc_match(MARC_PATH, REGEX)
Evaluates to true when the MARC_PATH values matches the REGEX, false otherwise.
=head1 SEE ALSO
L<Catmandu::Fix>
Expand Down
20 changes: 20 additions & 0 deletions lib/Catmandu/Fix/marc_add.pm
Expand Up @@ -39,6 +39,26 @@ Catmandu::Fix::marc_add - add new fields to marc
Add a new subfield to MARC record.
=head1 METHODS
=head2 marc_add(MARC_FIELD, SUBFIELD, VALUE, [ SUBFIELD, VALUE , ... ])
Add new subfields to a MARC record. The MARC_FIELD should contain a marc field
name, all other arguments contain the subfields to be added.
By default literal values will be added. To point to an existing value in
a record use the JSON_PATH syntax with a dollar '$.' added in front.
=head1 INLINE
This Fix can be used inline in a Perl script:
use Catmandu::Fix::marc_add as => 'marc_add';
my $data = { record => [...] };
$data = marc_add($data,'245','a','title');
=head1 SEE ALSO
L<Catmandu::Fix>
Expand Down
16 changes: 14 additions & 2 deletions lib/Catmandu/Fix/marc_decode_dollar_subfields.pm
Expand Up @@ -36,9 +36,21 @@ then the $h = subsubfield will not be accessible with normal MARC processing too
Use the 'marc_decode_dollar_subfields()' fix to re-evaluate all the MARC subfields
for these hidden data.
=head1 USAGE
=head1 METHODS
catmandu convert MARC --type RAW --fix 'marc_decode_dollar_subfields()' < data.mrc
=head2 marc_decode_dollar_subfields()
Decode double encoded dollar subfields into real MARC subfields.
=head1 INLINE
This Fix can be used inline in a Perl script:
use Catmandu::Fix::marc_decode_dollar_subfields as => 'marc_decode_dollar_subfields';
my $data = { record => [...] };
$data = marc_decode_dollar_subfields($data);
=head1 SEE ALSO
Expand Down
26 changes: 26 additions & 0 deletions lib/Catmandu/Fix/marc_in_json.pm
Expand Up @@ -46,6 +46,32 @@ Catmandu::Fix::marc_in_json - transform a Catmandu MARC record into MARC-in-JSON
Convert the MARC record into MARC-in-JSON format
=head1 METHODS
=head2 marc_in_json( [OPT1:VAL, OPT2: VAL])
Convert a Catmandu MARC record into the MARC-in-JSON format.
=head1 OPTIONS
=head2 reverse: 0|1
Convert a MARC-in-JSON record back into the Catmandu MARC format.
=head2 record: STR
Specify the JSON_PATH where the MARC record can be found (default: record).
=head1 INLINE
This Fix can be used inline in a Perl script:
use Catmandu::Fix::marc_in_json as => 'marc_in_json';
my $data = { record => [...] };
$data = marc_in_json($data);
=head1 SEE ALSO
L<Catmandu::Fix>
Expand Down
14 changes: 13 additions & 1 deletion lib/Catmandu/Fix/marc_map.pm
Expand Up @@ -209,7 +209,19 @@ each matched field, one array of strings for each matched subfield).
=head2 record: STR
Specify the JSON_PATH where the MARC record can be found (default: record)
Specify the JSON_PATH where the MARC record can be found (default: record).
=head1 INLINE
This Fix can be used inline in a Perl script:
use Catmandu::Fix::marc_map as => 'marc_map';
my $data = { record => [...] };
$data = marc_map($data,'245a','title');
print $data->{title} , "\n";
=head1 SEE ALSO
Expand Down
22 changes: 22 additions & 0 deletions lib/Catmandu/Fix/marc_remove.pm
Expand Up @@ -38,6 +38,28 @@ Catmandu::Fix::marc_remove - remove marc (sub)fields
Remove (sub)fields in a MARC record
=head1 METHODS
=head2 marc_remove( MARC_PATH , [OPT1:VAL, OPT2: VAL])
Delete the (sub)fields from the MARC record as indicated by the MARC_PATH.
=head1 OPTIONS
=head2 record: STR
Specify the JSON_PATH where the MARC record can be found (default: record).
=head1 INLINE
This Fix can be used inline in a Perl script:
use Catmandu::Fix::marc_remove as => 'marc_remove';
my $data = { record => [...] };
$data = marc_remove($data,'600');
=head1 SEE ALSO
L<Catmandu::Fix>
Expand Down
23 changes: 23 additions & 0 deletions lib/Catmandu/Fix/marc_set.pm
Expand Up @@ -45,6 +45,29 @@ Catmandu::Fix::marc_set - set a marc value of one (sub)field to a new value
Set the value of a MARC subfield to a new value.
=head1 METHODS
=head2 marc_set( MARC_PATH , VALUE , [OPT1:VAL, OPT2: VAL])
Set a MARC subfield to a particular new value. This valeu can be a literal or
reference an existing field in the record using the dollar JSON_PATH syntax.
=head1 OPTIONS
=head2 record: STR
Specify the JSON_PATH where the MARC record can be found (default: record).
=head1 INLINE
This Fix can be used inline in a Perl script:
use Catmandu::Fix::marc_set as => 'marc_xmarc_setml';
my $data = { record => [...] };
$data = marc_set($data, '245a', 'test');
=head1 SEE ALSO
L<Catmandu::Fix>
Expand Down
16 changes: 16 additions & 0 deletions lib/Catmandu/Fix/marc_xml.pm
Expand Up @@ -32,6 +32,22 @@ Catmandu::Fix::marc_xml - transform a Catmandu MARC record into MARCXML
Convert MARC data into a MARCXML string
=head1 METHODS
=head2 marc_xml(PATH)
Transform the MARC record found at PATH to MARC XML.
=head1 INLINE
This Fix can be used inline in a Perl script:
use Catmandu::Fix::marc_xml as => 'marc_xml';
my $data = { record => [...] };
$data = marc_xml($data);
=head1 SEE ALSO
L<Catmandu::Fix>
Expand Down
14 changes: 0 additions & 14 deletions t/bench.pl

This file was deleted.

0 comments on commit d95a5f1

Please sign in to comment.