Before I try to re-invent the wheel, has anyone done anything along
the lines of a macro to "unwrap" a paragraph? Probably in regards to
HTML.
The situation is I have a number of text files created in TSE that I
want to put on a Wiki website. While the page size suits me, my very
slight nodding acquaintance with HTML indicates it's preferable to not
have embedded EoLs in text bodies to make the page display cleanly for
others with different display requirements. So, I need to unwrap all
my paragraphs. The Wiki will recognize HTML code, but doesn't require
it. It will automatically adjust pasted long lines to fit the
display.
I've done it manually, so I know the issues. But over the course of
several thousand KB that gets tedious real fast. The real kicker is
detecting "lists". I don't see any way except the "Mark I Eyeball"
to catch them and skip over them. But even something that deals with
one para at time is an improvement over concatenating a line at a time
working backwards through a paragraph.
One way is to select the Options pulldown menu, set the right margin to 16000, go back to the text, make sure the paragraphs are separated by at least one empty line, mark with a line block all of the paragraphs you want unwrapped, and use the wordwrap command. You wind up with all of the paragraphs becoming one line each (as long as the total number of characters in the paragraph was less than 16000.)
I do this all the time when doing any kind of text in TSE that I plan to put in internet messages or transfer to Word, Notepad, or other word processors.
----- Original Message ----- From: "Lane Whittaker" <y8norxneaf...@sneakemail.com> To: "SemWare" <semware@googlegroups.com> Sent: Wednesday, April 16, 2008 7:13 PM Subject: [TSE] Unwrap Para for HTML?
> Before I try to re-invent the wheel, has anyone done anything along > the lines of a macro to "unwrap" a paragraph? Probably in regards to > HTML.
> The situation is I have a number of text files created in TSE that I > want to put on a Wiki website. While the page size suits me, my very > slight nodding acquaintance with HTML indicates it's preferable to not > have embedded EoLs in text bodies to make the page display cleanly for > others with different display requirements. So, I need to unwrap all > my paragraphs. The Wiki will recognize HTML code, but doesn't require > it. It will automatically adjust pasted long lines to fit the > display.
> I've done it manually, so I know the issues. But over the course of > several thousand KB that gets tedious real fast. The real kicker is > detecting "lists". I don't see any way except the "Mark I Eyeball" > to catch them and skip over them. But even something that deals with > one para at time is an improvement over concatenating a line at a time > working backwards through a paragraph.
Here is what I use. But it relies on a marked block, and has no notion regarding lists:
integer temp_id
/************************************************************** Copy a block to the Windows clipboard. Before being copied, the block is wrapped at the maximum line length. **************************************************************/ proc main() integer right_margin, marked_it
marked_it = False if isBlockMarked() if not isBlockInCurrFile() Warn("Block not in current file") return () endif elseif Query(UseCurrLineIfNoBlock) MarkLine() marked_it = True else Warn("No block") return () endif
right_margin = Set(RightMargin, MAXLINELEN) PushBlock() PushPosition() if temp_id == 0 or not GotoBufferId(temp_id) temp_id = CreateTempBuffer() endif EmptyBuffer() CopyBlock() BegFile() repeat until not WrapPara() BegFile() MarkChar() EndFile() MarkChar() CopyToWinClip()
Set(RightMargin, right_margin) PopPosition() PopBlock() if marked_it or Query(UnMarkAfterPaste) <> Off UnMarkBlock() endif end
> Before I try to re-invent the wheel, has anyone done anything along > the lines of a macro to "unwrap" a paragraph? Probably in regards to > HTML.
> The situation is I have a number of text files created in TSE that I > want to put on a Wiki website. While the page size suits me, my very > slight nodding acquaintance with HTML indicates it's preferable to not > have embedded EoLs in text bodies to make the page display cleanly for > others with different display requirements. So, I need to unwrap all > my paragraphs. The Wiki will recognize HTML code, but doesn't require > it. It will automatically adjust pasted long lines to fit the > display.
> I've done it manually, so I know the issues. But over the course of > several thousand KB that gets tedious real fast. The real kicker is > detecting "lists". I don't see any way except the "Mark I Eyeball" > to catch them and skip over them. But even something that deals with > one para at time is an improvement over concatenating a line at a time > working backwards through a paragraph.
There is a macro docmode that a.o. saves a paragraph as a single line
Jos Weitenberg
________________________________
From: semware@googlegroups.com on behalf of Lane Whittaker Sent: Thu 4/17/2008 2:13 AM To: SemWare Subject: [TSE] Unwrap Para for HTML?
Before I try to re-invent the wheel, has anyone done anything along the lines of a macro to "unwrap" a paragraph? Probably in regards to HTML.
The situation is I have a number of text files created in TSE that I want to put on a Wiki website. While the page size suits me, my very slight nodding acquaintance with HTML indicates it's preferable to not have embedded EoLs in text bodies to make the page display cleanly for others with different display requirements. So, I need to unwrap all my paragraphs. The Wiki will recognize HTML code, but doesn't require it. It will automatically adjust pasted long lines to fit the display.
I've done it manually, so I know the issues. But over the course of several thousand KB that gets tedious real fast. The real kicker is detecting "lists". I don't see any way except the "Mark I Eyeball" to catch them and skip over them. But even something that deals with one para at time is an improvement over concatenating a line at a time working backwards through a paragraph.
Possibly let be known if the proposed solutions are fulfilling the issue.
If there still are wishes after using this macros or techniques, possibly supply some specific source code examples about how it should be and how it is now.
----- Original Message ---- From: Lane Whittaker <y8norxneaf...@sneakemail.com> To: SemWare <semware@googlegroups.com> Sent: Thursday, April 17, 2008 2:13:45 AM Subject: [TSE] Unwrap Para for HTML?
Before I try to re-invent the wheel, has anyone done anything along the lines of a macro to "unwrap" a paragraph? Probably in regards to HTML.
The situation is I have a number of text files created in TSE that I want to put on a Wiki website. While the page size suits me, my very slight nodding acquaintance with HTML indicates it's preferable to not have embedded EoLs in text bodies to make the page display cleanly for others with different display requirements. So, I need to unwrap all my paragraphs. The Wiki will recognize HTML code, but doesn't require it. It will automatically adjust pasted long lines to fit the display.
I've done it manually, so I know the issues. But over the course of several thousand KB that gets tedious real fast. The real kicker is detecting "lists". I don't see any way except the "Mark I Eyeball" to catch them and skip over them. But even something that deals with one para at time is an improvement over concatenating a line at a time working backwards through a paragraph.
There is a macro, 1liner.s, that is (should be) in the macros on the Semware web site, that unwraps paragraphs for the whole document or within a marked block. It's been around for a long while.
It seems it's called 1liner2.zip at this point and is at the top of the list.
The version I'm using came programmed to put two spaces after every period (like old typewriter formatting for the period at the end of a sentence). You may want to rem out that part of the code.
>Before I try to re-invent the wheel, has anyone done anything along >the lines of a macro to "unwrap" a paragraph? Probably in regards to >HTML.
>The situation is I have a number of text files created in TSE that I >want to put on a Wiki website. While the page size suits me, my very >slight nodding acquaintance with HTML indicates it's preferable to not >have embedded EoLs in text bodies to make the page display cleanly for >others with different display requirements. So, I need to unwrap all >my paragraphs. The Wiki will recognize HTML code, but doesn't require >it. It will automatically adjust pasted long lines to fit the >display.
>I've done it manually, so I know the issues. But over the course of >several thousand KB that gets tedious real fast. The real kicker is >detecting "lists". I don't see any way except the "Mark I Eyeball" >to catch them and skip over them. But even something that deals with >one para at time is an improvement over concatenating a line at a time >working backwards through a paragraph.
Anybody have an XML to text converter? A client wants to send me a data file in XML but our software is set up to read flat ASCII.
I can't see why XML is any kind of advantage for storing data, when you have something like <gender>M</gender> for every person instead of a simple M. That's almost a 20:1 inflation. Can you tell I started out with cards? ;)
> There is a macro, 1liner.s, that is (should be) in the macros on the Semware web site, that unwraps paragraphs for the whole document or within a marked block. It's been around for a long while.
> It seems it's called 1liner2.zip at this point and is at the top of the list.
> The version I'm using came programmed to put two spaces after every period (like old typewriter formatting for the period at the end of a sentence). You may want to rem out that part of the code.
> Fred Holmes
> At 08:13 PM 4/16/2008, Lane Whittaker wrote:
> >Before I try to re-invent the wheel, has anyone done anything along
> >the lines of a macro to "unwrap" a paragraph? Probably in regards to
> >HTML.
> >The situation is I have a number of text files created in TSE that I
> >want to put on a Wiki website. While the page size suits me, my very
> >slight nodding acquaintance with HTML indicates it's preferable to not
> >have embedded EoLs in text bodies to make the page display cleanly for
> >others with different display requirements. So, I need to unwrap all
> >my paragraphs. The Wiki will recognize HTML code, but doesn't require
> >it. It will automatically adjust pasted long lines to fit the
> >display.
> >I've done it manually, so I know the issues. But over the course of
> >several thousand KB that gets tedious real fast. The real kicker is
> >detecting "lists". I don't see any way except the "Mark I Eyeball"
> >to catch them and skip over them. But even something that deals with
> >one para at time is an improvement over concatenating a line at a time
> >working backwards through a paragraph.
I use XML for much of my data storage. I then write
XSLT style sheets to convert the data to HTML, using CSS to style the
HTML elements. I find this method to be highly flexible. For example,
using this method one can create various views of the same data.
You could strip the tags using regular expressions
in TSE, or you could write a XSLT style sheet to accomplish the task.
The later would require an investment of time learning XSLT, but I
think it would be worth the effort.
Steve Cramer wrote:
Anybody have an XML to text converter? A client wants to send me a data
file in XML but our software is set up to read flat ASCII.
I can't see why XML is any kind of advantage for storing data, when you
have something like <gender>M</gender> for every person
instead of a simple M. That's almost a 20:1 inflation. Can you tell I
started out with cards? ;)
> Anybody have an XML to text converter? A client wants to send me a data > file in XML but our software is set up to read flat ASCII.
> I can't see why XML is any kind of advantage for storing data, when you > have something like <gender>M</gender> for every person instead of a > simple M. That's almost a 20:1 inflation. Can you tell I started out > with cards? ;)
1. Easier data exchange: you can convert your data rather automatically to other formats (at the price of putting some extra information in it). E.g. RSS.
2. Standard format: It uses a standard format
3. Formats to simplify XML have been created, e.g. JSON
4. In general I would go for tables (that is rows and columns to store the data in) which I store and handle in TSE on my local machine or USB stick. Then convert it e.g. to SQL which I copy/paste in a MySql client. And MySql has converting routines from database tables to XML. Similar to mathematics, where the rectangle is one of the simplest geometric figures, the table (this rectangular collection of rows and columns) is one of the simplest structures (and most versatile structures) to store your data in.
5. XSLT is certainly not an intuitive language. It is a special case of a tree processing language (of which XML is a special case). So using recursion and the like. Rather difficult to learn. You usually copy paste from something that works, and adapt it to your needs.
----- Original Message ---- From: Steve Cramer <cramer...@charter.net> To: semware@googlegroups.com Sent: Thursday, April 17, 2008 3:58:53 PM Subject: [TSE] XML
Anybody have an XML to text converter? A client wants to send me a data file in XML but our software is set up to read flat ASCII.
I can't see why XML is any kind of advantage for storing data, when you have something like <gender>M</gender> for every person instead of a simple M. That's almost a 20:1 inflation. Can you tell I started out with cards? ;)