Re: [elinks-users] Trying to get hooks.pl working

2013-08-06 Thread John Magolske
* Witold Filipczyk  [130806 12:00]:
> W dniu 06.08.2013 o 17:12 John Magolske  pisze:
> > I just came across this hooks.pl snippet that allows ELinks to
> > display threaded comments on Hacker News nicely indented:
> > 
> > sub pre_format_html_hook {
> >   my ($url, $html) = (shift, shift);
> >   if ($url =~ m|news.ycombinator.com/item\?id=|) {
> > $html =~ s| > width=([0-9]{1,3})>|' 'x($1/10)|eg;
> >   }
> >   return $html;
> > }
> > 
> > http://pastebin.com/P4frn4N7
> > https://news.ycombinator.com/item?id=6151718
> > 
> > ... tried compiling with Perl support:
> >
> > % ./configure --with-lua --with-perl
> >   [...]
> >   checking for Perl... no
> >
> > Not sure why perl isn't found...
> 
> Did you install libperl-dev?

Ah, but of course...installing libperl-dev did the trick, works
perfectly now. Nice to be reading indented HN comments in ELinks.

Thanks!

John

-- 
John Magolske
http://B79.net/contact
___
elinks-users mailing list
elinks-users@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-users


Re: [elinks-users] Trying to get hooks.pl working

2013-08-06 Thread Witold Filipczyk
W dniu 06.08.2013 o 17:12 John Magolske  pisze:

> Hi,
>
> I just came across this hooks.pl snippet that allows ELinks to display
> threaded comments on Hacker News nicely indented:
>
> sub pre_format_html_hook {
>   my ($url, $html) = (shift, shift);
>   if ($url =~ m|news.ycombinator.com/item\?id=|) {
> $html =~ s| width=([0-9]{1,3})>|' 'x($1/10)|eg;
>   }
>   return $html;
> }
>
> http://pastebin.com/P4frn4N7
> https://news.ycombinator.com/item?id=6151718
>
> Hacker News uses "s.gif" with varying width values to adjust the
> indenting of comments, which ELinks doensn't recognise. The above code
> swaps those out with   entities. Looks like a nice solution, but I
> can't seem to get it working. I've had success using hooks.lua, which
> required compiling ELinks with Lua support. So I tried compiling with
> Perl support:
>
> % ./configure --with-lua --with-perl
>   [...]
>   checking for Perl... no
>   checking for Lua... yes
>   [...]
>
> Not sure why perl isn't found...

Did you install libperl-dev?
___
elinks-users mailing list
elinks-users@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-users


[elinks-users] Trying to get hooks.pl working

2013-08-06 Thread John Magolske
Hi,

I just came across this hooks.pl snippet that allows ELinks to display
threaded comments on Hacker News nicely indented:

sub pre_format_html_hook {
  my ($url, $html) = (shift, shift);
  if ($url =~ m|news.ycombinator.com/item\?id=|) {
$html =~ s||' 'x($1/10)|eg;
  }
  return $html;
}

http://pastebin.com/P4frn4N7
https://news.ycombinator.com/item?id=6151718

Hacker News uses "s.gif" with varying width values to adjust the
indenting of comments, which ELinks doensn't recognise. The above code
swaps those out with   entities. Looks like a nice solution, but I
can't seem to get it working. I've had success using hooks.lua, which
required compiling ELinks with Lua support. So I tried compiling with
Perl support:

% ./configure --with-lua --with-perl
  [...]
  checking for Perl... no
  checking for Lua... yes
  [...]

Not sure why perl isn't found...

% which perl
  /usr/bin/perl
% which lua
  /usr/bin/lua

A subsequent `make` leaves a binary that has no mention of Perl:

./elinks --version
ELinks 0.13.GIT
Built on Aug  5 2013 22:48:20
Features:
[...] Scripting (Lua)

Any ideas as to why? Is it possible to have support for more than one
scripting language in a given binary? FWIW, this is on Debian Sid.

Thanks,

John

-- 
John Magolske
http://B79.net/contact
___
elinks-users mailing list
elinks-users@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-users