True Line numbering reference

Hello,

I’m a beginner in Ruby and currently working on finding a solution to
the
current text filter code distributed with typo. It is a matter of
personal
preference and not an issue or a bug. I wanted to use true line number
reference starting at a given line number when posting code blocks. If
you
get a free minute, please look at my post at this url (
http://isi-p.com/articles/2007/09/14/wicked-sexy-ruby-codes ) where I
explained what I’ve done so far. The solution that I have does not
eliminate
overflow problems with various browsers. I think that using ordered list
instead of tables should do the trick, however with my limited Ruby
knowledge I’m stuck.

I’ve added an additional attribute after line#36 of the
typo_textfilter_code.rb
listline = attrib[‘listline’]

then I added a control block to check if it is in use

if(listline)
lines = text.split(/\n/)
for line in lines do
listlines += “

  • #{line}

  • text = “<ol start="#{listline}">#{listlines}”
    end

    The problem is I don’t know how to test this outside of the web
    environment
    and my website is down each mistake I make.

    Any advise on any part of this would be greatly appreciated.

    sincerely,
    Mon

    On Fri, Sep 14, 2007 at 07:54:12PM -0600, alain monteleon wrote:

    Hello,

    Hello Alain,

    […]
    The solution that I have does not eliminate overflow problems with various
    browsers. I think that using ordered list instead of tables should do the
    trick, however with my limited Ruby knowledge I’m stuck.

    I think this explains what you want:
    http://www.tjkdesign.com/articles/how_to_style_a_code_listing.asp

    […]
    The problem is I don’t know how to test this outside of the web environment and
    my website is down each mistake I make.

    Maybe I misunderstand your problem, but have you tried running
    a local copy of typo?

    Any advise on any part of this would be greatly appreciated.

    HTH,

    Hi Matijs,

    Thank you for your reply. I have examined the article that you have
    mentioned and true enough, it provided me with the information that I
    need
    to build an ordered list to wrap the pre codes with. Take a look at this
    article
    http://isi-p.com/articles/2007/09/15/wicked-sexy-ruby-codes-part-2to
    see what I’ve done so far, unfortunately, using ordered list offers
    another problem. When copying the code from firefox and pasting it to an
    editor, the markers are included, this is not true with IE7, therefore
    this
    solution once again is not the final solution that I am looking for. I
    have
    also seen the workaround of offering a text version of the code solely
    for
    those who wishes to copy it. Maybe that is a good start and could very
    well
    be a good workaround, spcecially now that ajax is here. I can probably
    find
    a way to offer an alternative (without the ordered list) and at the same
    time avoid rendering the page all over again. I don’t know for sure,
    just a
    thought that’s lingering in my mind right now.

    Once again thank you for your reply.