Welcome to WebmasterWorld Guest from 23.22.46.195

Forum Moderators: coopster & jatar k & phranque

generating web content from text files

   
10:00 am on Feb 26, 2001 (gmt 0)

10+ Year Member



I'm developing a new site and need to find a way of generating web content from text files or word documents, including generating the links to that content. The text files would be generated by the client and uploaded onto the server.

Can anyone give me any tips?

Cheers.

8:31 pm on Feb 26, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi shakes, welcome to WebmasterWorld.

Word files can be saved in HTML, although I've heard the results are fairly... well... questionable. Generating from a plain text file would be quite straightforward in Perl or PHP, depending on how much formatting you'd need. You'd basically set up a page template in plain HTML, serve it using Perl, and then insert your text at the appropriate point.

This could also be done using SSI (server side includes) if you've got it enabled using the <!--#include file="filename.html" --> instruction to include the contents of filename.html at that specific point in the HTML

Generating the links is a bit more tricky, but can be done with Perl's readdir command to scan the contents of a directory - if you put all your documents in this directory, you can create a set of links to whatever happens to be there when the script is run.

If any of these sound like the kind of thing you're after, shout and I'll do a code snippit.

12:19 pm on Feb 27, 2001 (gmt 0)

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



There are quite a few prerolled solutions too. If you dig through some of the script archives, you'll find a category usually called "text to html". Many of those are on-the-fly translation. Those are great places to dig for ideas.
9:54 am on Mar 2, 2001 (gmt 0)

10+ Year Member



After much deliberation, I've actually managed to do it.

Cheers.

10:40 am on Mar 2, 2001 (gmt 0)

WebmasterWorld Senior Member chiyo is a WebmasterWorld Top Contributor of All Time 10+ Year Member



How shakes?

Please share!

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month