#!perl -w

#cheapo way of showing what a file would look like on Everything 2
#assumes no bad links, like [|fdasfa] or [fdsa|] made, and no line-spanning links

my $baseURL =
#	"http://www.everything.com/index.pl?"	#for creating full page output that links to E2
	"?"	#for only previewing
;

while(<>) {
	chomp;
	s/<!--.*?-->//g;	#remove comments
	s/\[([^|]+?)\]/<a href="${baseURL}node=$1" title="$1">$1<\/a>/g;		#links with no pipes
	s/\[(.+?)\|(.+?)\]/<a href="${baseURL}node=$1" title="$1">$2<\/a>/g;	#links with pipes
	s/\s+$//;	#remove whitespace at end of line
	print $_ , "\n";
}

