Manso Trick: simple strip HTML tags using Python

WireframeWhen designing desktop apps, websites, and mobile applications, more than once I have tried using an application like mockingbird or Pencil Project. On one hand, mockingbird, is a web application that can be accessed from any browser and allows you to design multiple pages with different elements. On the other hand, Pencil Project, initially born as a Firefox extension, now has a multiplatform desktop application that allows you to mockup easily.

The drawback I see on these two applications is that for some reason, I always end up making simple mockups with a simple pen and paper. This way I can organize my ideas faster than using these applications. I guess the main reason for this is that I’m not a designer, so to me it is the same doing a shitty design in paper, than a shitty design with an application. Moreover, usually using a computer app for this task I end up spending more time to do the same…

Anyway, the other day I discovered, and the truth is that I was quite impressed by the UI. It is super-easy and fast to use. You just drag the mouse while clicking and voila, you have an item of the size of your selection. You click on the type of item you want and you are done with the item. Even if you want to change attributes, you just have to double click on it, and select the attributes you want to change.

Actually, it is the first time I feel that I do not waste my time doing mockups with an application of this kind. From what I’ve seen, this application is starting, and it still lacks of some functionalities and needs some polishment, but I suppose that those will be added in the future. Even I think this lack of complexity and lack of tons of box types is what makes you go faster.

I think choosing the right tool for a job is a matter of personal preferences and personal needs, but I would recommend trying and taking a look at the other apps I pointed out at the beginning of the post.

Feel free to share any other tool you find useful in the comments 😉

Trackback URL

, , , ,

  1. Philip
    12/10/2010 at 1:45 pm Permalink

    Cool approach! Works well enough for text only view of HTML emails.

  2. Patrick
    09/11/2010 at 5:13 pm Permalink

    Hi there, I am just learning python for a project to do just this but with xml. When I am trying this code I am getting an invalid syntax with no more information but it is highlighting the last ‘ of each line in the rules. Any idea why that might be happening?


  3. Pau Sánchez
    13/11/2010 at 3:19 am Permalink

    A problem with spaces, might be? I don’t know, which version of python are you using?

    That code should work fine on Python 2.5 to Python 2.7 for sure.

  4. e1000
    02/03/2012 at 2:06 am Permalink

    Cool ! I simplified the rules a bit, btw making them just a list of tuples:

    # apply rules in given order!
    rules = [
    (r'\s+', ' '), # replace consecutive whitespace
    (r'\s*\s*', '\n'), # newline after a
    (r'\s*\s*' , '\n'), # newline after and and ...
    (r'\s*\s*' , '\n\n'), # newline after and and ...
    (r'.*]*>' , ''), # remove to
    (r']*>.*' , r'\1'), # show links instead of texts
    (r'<[^\s*', ''), # remove remaining tags

    for rgx, val in rules:
    regex = re.compile(rgx)
    text = regex.sub(val, text)

  5. bj
    16/07/2012 at 9:52 am Permalink

    Does not work with tables.

  6. Abhiram
    31/10/2012 at 11:44 am Permalink

    Thank you. Your approach reminds me of my old lex days 🙂