-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublications.pl
executable file
·80 lines (67 loc) · 2.53 KB
/
publications.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/lib";
use Publications;
use Getopt::Long;
my $opts = {};
GetOptions(
$opts,
'help',
'nodividers',
'labbib_dir:s',
'pubs_dir:s',
'count:i',
'type:s',
'keyword:s',
'template:s',
'index:s',
'url:s',
) or usage();
if (exists $opts->{help}) {
usage();
}
if ($ARGV[0]) {
$opts->{bibfile} = $ARGV[0];
}
my $pubs = Publications->new(%$opts);
my $html = $pubs->get_publications(
count => $opts->{count},
type => $opts->{type},
nodiv => $opts->{nodividers},
keyword => $opts->{keyword},
index => $opts->{index},
);
binmode STDOUT, ":encoding(UTF-8)";
print $html;
sub usage {
print qq|($0 [options] <bibfiles>
Creates an HTML lists of publications based on the data in your
local lab.bib and labweb.bib files.
Specify the bib files on the command line if you are not using
the default lab.bib and labweb.bib files to store our bibtex data.
options:
-h, --help : Print this message and exit
-l <dir>, --labbib_dir=<dir> : The directory that contains all the bibtex files.
[default: $ENV{HOME}/labbib ]
-p <dir>, --pubs_dir=<dir> : Path to the publications directory that contains pdfs
and supplemental material.
[default: $ENV{HOME}/selab/publications ]
-k <string>, --keyword=<string>: Limit the output to entries that match the keyword input.
This is entered as a boolean search string. examples:
'hmmer AND lab'
'(lab NOT hmmer) AND recent'
'NOT lab'
--type=<type> : Limit the output to the selected entry type. eg [ARTICLE]
-n, --nodividers : Turn off the dividers between years
-u <url>, --url=<url> : The base url for the site. eg [http://eddylab.org]
-i <index>, --index=<index> : Limit results to an article key. eg [Eddy01].
--template=<template> : should point to an alternative template to be used for
displaying the processed articles. The <template> value
should be the name of the template file with no path
information. The script expects this template to be in the
directory it is executed in.
|;
exit 1;
}