leo charre


text to html

I’ve been trying out text2html. It’s pretty cool.
You point it to a text file (or stdin), and it spits out html.
There are some fucked up things about it though..

For one, by default, it does nothing.
Nah, I’m not kidding. It does nothing- spits out same shit that came in. Can you imagine if you ate an apple and shat and apple out, unchanged? That would not be cool. Ok ok.. so it does html entities.. fuck me..
Second- there’s no help option.
Every unix command must have a -h or –help option. Because it’s expected. The empirical *I* fucking expect it.
Instead you have to use $ man ‘text2html’. Oh- but.. wait.. what’s this? Not the complete manual? You have to read $ man HTML::FromText for the full options.
Shit.
This is enough to piss me the fuck off.

It does cool shit, but you have to wine and dine it before it’ll suck your dick. It won’t just take your fifty bucks to do it. And you know the unix way.. By default, this program should suck your dick, no surprises, and shut up.
It should eat my apple and shit out a shit.

Workaround..

Create an alias in your ~/.bashrc file. Add this line:

alias text2html='text2html --blockcode --bold --bullets --email --numbers --paras --tables --underline --urls'

Note that it won’t work until you start another shell session.

Now all options are on, and the thing behaves closer to what is expected.

To install this fine mess of a program… Well.. the application is awesome- the api is a fucking cracked out microsoft whore.
As root..

# cpan HTML::FromText
# man html2text

Here’s some example input and output…

Original Text:

I AM TEXT THAT WILL BE TRANSFORMED TO HTML

Let's see and try what happens here.. shall we.

And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will.


And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will. This is to test that the next word
will be wrapped up, and there won't be a break between the 'word' and 'will'.


   - thank you
   - i am also thanked of course
   - you think?

ALSO WHAT ABOUT

   A definition.
      I am goint to think so very much

   And what about this on?
      I will also think that. Thank you.



Great. What about a link? http://leocharre.com

Done.
Html output..

I AM TEXT THAT WILL BE TRANSFORMED TO HTML

Let's see and try what happens here.. shall we.

And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will.

And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will. And hopefully what we expect to happen will. This is to test that the next word will be wrapped up, and there won't be a break between the 'word' and 'will'.

  • thank you
  • i am also thanked of course
  • you think?

ALSO WHAT ABOUT

A definition.
   I am goint to think so very much

And what about this on?
   I will also think that. Thank you.

Great. What about a link? http://leocharre.com

Done.


You may want to look at the source of this page for the little details. It’s pretty clean, very nice job. (No, it’s not being trasformed by freaking wordpress.. See wordpress raw html plugin )


Linux User