> when I run it I end up with an empty file... ?

Well, you should be able to trace through it by entering
each of the commands individually instead of sourcing the
file to see where things are going funky.  Places matters
could go awry:

I solved it like this:

:1,/received/d
:$?^\s*For subscribe options?,$d
:let @a=''
:g/hole\|relativistic\|LISA\|black\|supermassive\|intermediate/?^\s*astro-ph?,/^\s*astro-ph/-y
A
:%d
:put a
:1d
:%s!^\s*astro-ph/\(\d\+\)!<a href="http://xxx.lanl.gov/pdf/astro-ph/\1";>&</a>
:w! /tmp/2.html
:q

and using the

cat /tmp/1.html | vim -s foo_arXiv.vim -


Well, we all have our peculiar areas of specialty.  When it
comes to things like plugins, syntax-highlighting nuances,
i18n/encoding stuff, and indentation, I leave that to the
folks on the list that are far more well-versed than myself.
  I'm more of an "ex" & regexp sorta guy, doing some crazy
stuff there, but otherwise, just using pretty stock
unadorned vim.

I guess I am one of the syntax-highlighting guys...

Now, as you can see, I am trying to generate an html out of the result
... the idea is to
create not a web page but an htmlized file to include it later into a
"real" web page...

The problem is that I have to tell vim to convert the end of line and
empty spaces into <br>, and I do it like this:

:1,/received/d
:$?^\s*For subscribe options?,$d
:let @a=''
:g/hole\|relativistic\|LISA\|black\|supermassive\|intermediate/?^\s*astro-ph?,/^\s*astro-ph/-y
A
:%d
:put a
:1d
:%s!^\s*astro-ph/\(\d\+\)!<a href="http://xxx.lanl.gov/pdf/astro-ph/\1";>&</a>
:%s!/^./<br>/
:%s!/^$/<br>/
:w! /tmp/2.html
:q

But it doesn't work...

In case you are interested in what I am doing, try this:

------------------------------------------------
#!/usr/bin/env zsh

links -dump http://lanl.arxiv.org/list/astro-ph/new | sed 's/\[abs,
ps, pdf, other\]//' | sed 's/Title:/\<b\>Title\<\/b\>/g'| sed
's/Authors:/\<b\>Autors\<\/b\>/g'  > /tmp/1.html &&

cat /tmp/1.html | vim -s ~pau/bin/foo_arXiv.vim -
------------------------------------------------

where foo_arXiv.vim is posted above

And, btw, if you also tell me how to make vim embed the resulting file
into a determined position of the real web page (let's call it
real_web.html) , I will be more than grateful!!

Pau



-tim





Reply via email to