File Coverage

blib/lib/Bryar.pm
Criterion Covered Total %
statement 35 95 36.8
branch 1 26 3.8
condition 0 14 0.0
subroutine 12 17 70.5
pod 4 6 66.6
total 52 158 32.9


line stmt bran cond sub pod time code
1             package Bryar;
2              
3 2     2   60830 use Bryar::Config;
  2         7  
  2         19  
4 2     2   2130 use Time::Local;
  2         4333  
  2         127  
5 2     2   1222 use Bryar::Comment;
  2         6  
  2         26  
6 2     2   2026 use Calendar::Simple;
  2         409769  
  2         159  
7 2     2   19 use DateTime;
  2         2  
  2         10  
8 2     2   42 use List::Util;
  2         4  
  2         115  
9              
10 2     2   49 use 5.006;
  2         7  
  2         68  
11 2     2   11 use strict;
  2         3  
  2         53  
12 2     2   10 use warnings;
  2         4  
  2         45  
13 2     2   10 use Carp;
  2         4  
  2         2477  
14             our $VERSION = '4.0';
15              
16             =head1 NAME
17              
18             Bryar - A modular, extensible weblog tool
19              
20             =head1 SYNOPSIS
21              
22             Bryar->go();
23              
24             =head1 DESCRIPTION
25              
26             Bryar is a piece of blog production software, similar in style to (but
27             considerably more complex than) Rael Dornfest's "blosxom". The main
28             difference is extensibility, in terms of data collection and output
29             formatting. For instance, data can be acquired via DBD from a database,
30             or from the filesystem, or from any other source you can think of;
31             documents can be specified in HTML, or some other format which gets
32             turned into HTML; pages can be rendered with Template Toolkit,
33             HTML::Template, or any other template engine of your choice.
34              
35             =head1 INSTALLING BRYAR
36              
37             The short answer: run F in a directory served by your
38             web server. Then do what it tells you.
39              
40             The long answer:
41              
42             The only front-end working in this release is the CGI one; please don't
43             try this in mod_perl yet.
44              
45             You'll need to write a little driver script which sets some parameters.
46             For instance, my F looks like this:
47              
48             #!/usr/bin/perl
49             use Bryar;
50             Bryar->go(
51             name => "Themes, Dreams and Crazy Schemes",
52             description => "Simon Cozens' weblog",
53             baseurl => "http://blog.simon-cozens.org/bryar.cgi"
54             );
55              
56             You can get away without any configuration options, but it's probably
57             wise to set something like the above up. Bryar will look in its current
58             directory for data files and templates, so if you're keeping your data
59             somewhere else, you'll want to set the F option too:
60              
61             use Bryar;
62             Bryar->go( datadir => "/home/simon/blog" );
63              
64             If Bryar finds a file called F in the data directory,
65             (which as noted above, defaults to the current directory if not
66             specified explicitly) then it'll parse that as a colon-separated file
67             full of other options. I could, for instance, get away with
68              
69             name: Themes, Dreams and Crazy Schemes
70             description: Simon Cozens' weblog
71             baseurl: http://blog.simon-cozens.org/bryar.cgi
72             email: something@example.com
73              
74             in a F, and then would be able to use C<< Bryar->go() >>
75             with no further parameters.
76              
77             For details of interesting parameters, look in L.
78             See also L for how to database-back the blog.
79              
80             Now you will need some templates to make your new blog look nice and
81             shiny. You can copy in the F and F which
82             come with Bryar, and edit those. The F program which
83             comes with Bryar will set all this up for you. Look at
84             L for hints as to how to customize the
85             look-and-feel of the blog.
86              
87             Once you're all up and running, (and your web server knows about
88             F) then you can start blogging! Just dump F<.txt> files into
89             your data directory. If you used F, you should even have
90             a sample blog entry there for you.
91              
92             =head1 USING BRYAR
93              
94             This section describes Bryar from the end-users point of view - that is,
95             what do all those URLs do? If you're familiar with blosxom, this section
96             should be a breeze.
97              
98             http://your.blog.com/
99              
100             will return the most recent 20 posts. The default of 20 can be changed
101             by setting the C configuration option.
102              
103             http://your.blog.com/something
104              
105             will try to find a sub-blog - in blosxom terms, this is a subdirectory
106             underneath the main data directory. Sub-blogs can have their own
107             templates, but by default inherit the templates from the main blog.
108              
109             (Oh, and another thing - you can stick templates either in the
110             F