-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathatx-v20030406
224 lines (155 loc) · 5.1 KB
/
atx-v20030406
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# Blosxom Plugin: atx
# Author(s): Aaron Swartz <[email protected]>
# Version: 2003-04-06
# Documentation: See the bottom of this file or type: perldoc atx
package atx;
# --- Configurable variables -----
# --------------------------------
sub start {
exists &_start and return &_start();
1;
}
sub entries {
exists &_entries and return \&_entries;
return undef;
}
sub filter {
my($pkg, $files_ref) = @_;
exists &_filter and $files_ref = _filter($files_ref);
1;
}
sub entries {
exists &_entries and return \&_entries();
return undef;
}
sub template {
exists &_template and return \&_template();
return undef;
}
sub sort {
exists &_sort and return \&_sort();
return undef;
}
sub head {
my($pkg, $path, $head_ref) = @_;
exists &_head and ($path, $$head_ref) = _head($path, $$head_ref);
1;
}
sub date {
my ($pkg, $date_ref, $mtime, $dw,$mo,$mo_num,$da,$ti,$yr) = @_;
exists &_date
and ($$date_ref, $mtime, $dw,$mo,$mo_num,$da,$ti,$yr)
= _date($$date_ref, $mtime, $dw,$mo,$mo_num,$da,$ti,$yr);
1;
}
sub story {
my ($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;
exists &_story
and ($path, $filename, $$story_ref, $$title_ref, $$body_ref)
= _story($path, $filename, $$story_ref, $$title_ref, $$body_ref);
1;
}
sub foot {
my($pkg, $path, $foot_ref) = @_;
exists &_foot and ($path, $$foot_ref) = _foot($path, $$foot_ref);
1;
}
sub end {
exists &_end and return &_end();
1;
}
1;
# PYTHON BITS
use Inline Python => <<'END';
import atx
#def _start():
# return 1
#def _filter(files_hash):
# return (files_hash)
#def _template(path, chunk, flavour)
# return template_string
#def _entries():
# return (files_hash, indexes_hash)
#def _sort(entries_hash):
# return sorted_entries_array
#def _head(path, head_template):
# return (path, head_template)
#def _date(date_template, mtime, dw,mo,mo_num,da,ti,yr):
# return (date_template, mtime, dw,mo,mo_num,da,ti,yr)
def _story(path, filename, story_template, title, body):
body = atx.atx(body, full=0)
return (path, filename, story_template, title, body)
#def _foot(path, foot_template):
# return (path, foot_template)
END
__END__
=head1 NAME
Blosxom Plug-in: atx
=head1 SYNOPSIS
Allows you to write Blosxom entries in atx.
=head1 REQUIREMENTS
1. Python
2. The Inline and Inline::Python Perl modules, found at:
http://search.cpan.org/search?query=inline%3A%3Apython&mode=all
3. The atx module, found at:
http://www.aaronsw.com/2002/atx/atx.py
=head1 INSTALLATION
1. Install the Inline and Inline::Python Perl modules.
2. Drop the atx plugin and atx.py into your Blosxom plugins directory.
=head1 USAGE
Write your entries in atx, documented here:
http://www.aaronsw.com/2002/atx/
=head1 BUGS
If you encounter an error like:
Couldn't find an appropriate DIRECTORY for Inline to use.
You need to make the directory Blosxom is in writable by the web server.
If you encounter an error like:
--
Error. You have specified 'Python' as an Inline programming language.
I currently only know about the following languages:
C, Foo, PDLPP, Pdlpp, foo, pdlpp
If you have installed a support module for this language, try deleting the
config file from the following Inline DIRECTORY, and run again:
$datadir/_Inline
at blosxom.cgi line 0
INIT failed--call queue aborted.
--
you've not got Python configured as one of the Inline language choices.
You'll need to add the appropriate Python bits to the appropriate sections
of the "config" file found in $datadir/_Inline...
languages : %
Python : Python
types : %
Python : interpreted
modules : %
Python : Inline::Python
suffixes : %
Python : py
Address bug reports and comments to the Blosxom mailing list
[http://www.yahoogroups.com/group/blosxom].
=head1 VERSION
2003-04-06
=head1 AUTHOR
Aaron Swartz <[email protected]>, http://www.aaronsw.com/
=head1 SEE ALSO
Blosxom Home/Docs/Licensing: http://www.raelity.org/apps/blosxom/
Blosxom Plugin Docs: http://www.raelity.org/apps/blosxom/plugin.shtml
atx: http://www.aaronsw.com/2002/atx/
=head1 LICENSE
Blosxom and this Blosxom Plug-in
Copyright 2003, Rael Dornfest
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.