XP1tx2web

Text to Web converts text files to HTML, to simplify the construction of web pages.

Note: it doesn’t make any HTML header or footer. You can cut and paste your preferred header and footer, and I’m assuming you’ll be editing the HTML to put in links, images etc. anyway.

All it does is put in paragraph tags, convert sexless quotes (single or double) into proper opening and closing quotes and apostrophes (mostly correctly!) and convert space-hyphen-space to space-endash-space.

It does not convert &, > or < into HTML entities, so you can include HTML that you’ve written yourself in your text file without it being converted into gibberish! If you want them as HTML entities (for example, if you wanted to put examples of HTML into a page as text without it being interpreted as HTML by the user’s browser) then you can do it yourself, easily.

It knows about HTML tags. If you include any HTML that you do want to work in the users’ browsers, it won’t convert any quotes within tags into sexed quotes. If however you’re putting HTML examples in your page, you’ll have to insert any quotes within the example tags as HTML entities.

It indents the HTML the way I do, and I’m not likely to make any options for that.

It breaks lines at spaces to keep the HTML lines to a maximum of 100 characters (you can change that default number by editing the runfile, it’s obvious how) – but only if there’s a space to break at. Not having paragraph tags, these breaks make no difference to the resulting pages. They’re just to stop the line lengths being awkward in a text editor.

It’s pretty easy to edit the runfile yourself, as long as you don’t want to add options. All the actual work on the files is near the top of the program, and all the wimp stuff is out of the way down the bottom. If you don’t need to add options, there’s no need to mess with the wimp stuff at all. It’s quite easy to change the program to suit your preferred indentation style or whatever.

This was a very quick and easy hack compared to my other apps. If you know BBC BASIC at all, you could easily alter it to do completely different tricks.

Download XP1tx2web here

(It’s a self-extracting archive, so all you have to do is download the file into a suitable directory, set the file type to FFC, and double-click on it, which will create the whole application in the same directory. You can then delete the original downloaded file.)

© Clive K Semmens 2018