Tue, Feb 13, 2007

code Plain Text Script

Posted at 10:32 pm MST to Code

I've joined Critters, a writers' on-line workshop and critiquing group that has a good reputation. I read a lot of blogs by writers, professional editors and such. I saw Critters mentioned several places before I visited the site.

The deal is that if I critique other people's stories, at least one a week, three weeks out of four on the average, when I have a complete story I can have it put into the queue and lots of other people will critique it.

The kicker is that submissions need to be plain text, and the Techlands stories don't exist in plain text. They are typed and revised directly in xhtml-transitional format, using a text editor that leaves all of the tags visible and can validate the formatting.

I don't mind HTML tags... before I found my niche in Configuration Management I worked on bug fixes, new features and technical support for an SGML editor. HTML tags and entities make sense to me: no worse than extra punctuation (though a little bulkier) at least when dealing with something that doesn't involve complex tables.

The editor was written in C and ran on both Windows and OS/2. That job was where I was introduced to OS/2, which I ran on my home machines for several years, until general software and device drivers were too hard to find, and Linux became available.

Where most people write text and then need to wrap it in HTML tags (often using various tools to do it), I've been writing HTML and needed a tool to clean out the tags. So my latest non-work-related coding has been a Perl tool to strip and translate the tags and put the resulting text into a reasonable plain-text format, with hard linefeeds inside the paragraphs, blank lines between paragraphs, etc.

I threw in a wordcount routine while I was at it. Two of them, actually: one count is actual words -- as in pieces of text with white-space on each side -- and the other is closer to the standard word count that publishers use: character count divided by 6.

I'm not generating manuscript submission format, yet. The Critters style is a bit different and aimed a bit more to on-line rather than hardcopy readers. But if or when I want to generate submission format from HTML, this provides a base to work from.

The truly geeky way to do the reformatting would probably be to generate an alternate printing CSS format for the HTML that would make it print out in the standard format. Maybe I'll eventually use that as a project to seriously learn CSS. I want to pick up the new 3rd edition of CSS: The Definitive Guide from O'Reilly, first, though.

permanent link || trackback || 0 comments || Add a comment