The Artima Developer Community
Sponsored Link

Python Buzz Forum
Purple Bookmarklet

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ian Bicking

Posts: 900
Nickname: ianb
Registered: Apr, 2003

Ian Bicking is a freelance programmer
Purple Bookmarklet Posted: May 30, 2004 9:35 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Ian Bicking.
Original Post: Purple Bookmarklet
Feed Title: Ian Bicking
Feed URL: http://www.ianbicking.org/feeds/atom.xml
Feed Description: Thoughts on Python and Programming.
Latest Python Buzz Posts
Latest Python Buzz Posts by Ian Bicking
Latest Posts From Ian Bicking

Advertisement
Recent talk about Purple Numbers (e.g.) reminds me of this bookmarklet which makes named anchors visible (reflexively, it was useful when finding that very anchor). Then all you need is blogging tools that put in named anchors automatically (which should be easy enough). That would be a nice addition to the restructured text HTML writer, for instance. Or a simple regex like (in Python, untested):
def anchor_html(html):
    return re.sub(
      r'<[pP][ >]', 
      lambda m: anchor_subber(m, c=[0]),
      html)

def anchor_subber(match, count_list):
    count = count_list[0]
    count_list[0] += 1
    return '<a name="link_%i"></a>%s' \
        % (count, match.group(0))

Read: Purple Bookmarklet

Topic: It Was Coughing Up Blood Last Night Previous Topic   Next Topic Topic: Log it all! Mwahahahahahaha!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use