txt2html - Text to HTML converter

txt2html's main website is http://txt2html.sourceforge.net. The project summary page is at http://sourceforge.net/projects/txt2html/.

There is also a page at CPAN http://search.cpan.org/author/RUBYKAT/.

A similar mirror page is at http://www.katspace.com/tools/text_to_html/

txt2html's original website was at http://www.aigeek.com/txt2html/

Table of Contents

What is txt2html?

txt2html is a Perl program that converts plain text to HTML. It uses the HTML::TextToHTML perl module to do so. Look at the README file.

What is HTML::TextToHTML?

HTML::TextToHTML is a Perl module that converts plain text to HTML.

It supports headings, lists, some tables, simple character markup, and hyperlinking, and is highly customizable. It recognizes some of the apparent structure of the source document (mostly whitespace and typographic layout), and attempts to mark that structure explicitly using HTML.

Our intent in writing this tool is to provide an easier way of converting existing text documents to HTML format.

What is txt2html not?

txt2html is not a program to convert wordprocessor files or other marked-up document formats. It is also not a program to convert HTML to text. Most HTML browsers do that.

If you need to convert something other than plain text to HTML, or you need to convert from HTML, you should look for a more appropriate tool.

txt2html is not a program for automatically generating a table-of-contents from a file. If you want that, then use txt2html to generate a HTML file, and then use htmltoc or hypertoc on the HTML file.

What's the current version?

The current version is v2.52. A list of changes can be found here and in the tar file.

Try it out using a web interface

This runs HTML::TextToHTML using the default options using a simple wrapper script.

Obtaining and installing txt2html

It's a Perl module with the script and everything bundled in the tarball, so installation is pretty easy. You don't need to compile anything.

  1. Get the current version of txt2html/HTML::TextToHTML at sourceforge download txt2html
  2. Untar the tarball somewhere.
  3. Follow the instructions in the README file. Look out for the dependencies!

    This will install the script in /usr/local/bin or /usr/bin by default (depending on your particular setup). It now relies on /usr/bin/env to figure out where your version of perl is, but that should work on most platforms. The global links dictionary is now built-in to the module.

  4. If you want override the global links dictionary, then add your own version to ~/.txt2html.dict so it will be used automatically.

If you prefer an RPM install, look for various RPMs, made by other people. There is also an official Debian package, though naturally all RPMs and Debs will lag behind the official tarball here.

How to Use txt2html

What can txt2html handle?

Look at this sample document for a basic idea. txt2html is more flexible than it looks though. You don't need to make your documents look just like this for txt2html to work.


If you just want to make obvious URL references into hyperlinks, you just have to install the module, and give the --links_only option to the txt2html script.

For learning how to configure your own hyperlinks dictionary, look at the documentation, and you can look at the global links dictionary which is appended to the actual module file. If you have improvements for this links-dictionary, please mail them to me so everyone can benefit.

How is txt2html licensed?

Look at the README file or the plain text README. Basically this is licensed under the Artistic License and the GPL.

What platforms will it run on?

If you can get a copy of Perl (version 5 or later), then you can use txt2html. Don't ask me how, because I've never tried it. Other people tell me it works fine.

What is the future of txt2html?


Thanks to all the people who have given us ideas, patches, bug reports, wish lists, and moral support.

SourceForge.net Logo

[ Home   |   txt2html sourceforge   |   Download ]