Google Groups Home
Help | Sign in
Unwrap Para for HTML?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 37 - Collapse all   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Lane Whittaker  
View profile
 More options Apr 16, 8:13 pm
From: Lane Whittaker <y8norxneaf...@sneakemail.com>
Date: Wed, 16 Apr 2008 17:13:45 -0700 (PDT)
Local: Wed, Apr 16 2008 8:13 pm
Subject: 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.

Anyone have anything or suggestions?

--LaneW


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hayes Smith  
View profile
 More options Apr 16, 8:50 pm
From: "Hayes Smith" <hayes_sm...@hotmail.com>
Date: Wed, 16 Apr 2008 19:50:26 -0500
Local: Wed, Apr 16 2008 8:50 pm
Subject: Re: [TSE] Unwrap Para for HTML?
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.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
S.E. Mitchell  
View profile
 More options Apr 16, 9:30 pm
From: "S.E. Mitchell" <sammy.mitch...@gmail.com>
Date: Wed, 16 Apr 2008 21:30:34 -0400
Local: Wed, Apr 16 2008 9:30 pm
Subject: Re: [TSE] Unwrap Para for HTML?
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

On Wed, Apr 16, 2008 at 8:13 PM, Lane Whittaker


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Weitenberg, J.J.S.  
View profile
 More options Apr 17, 3:16 am
From: "Weitenberg, J.J.S." <J.J.S.Weitenb...@let.leidenuniv.nl>
Date: Thu, 17 Apr 2008 09:16:17 +0200
Local: Thurs, Apr 17 2008 3:16 am
Subject: RE: [TSE] Unwrap Para for HTML?

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.

Anyone have anything or suggestions?

--LaneW

  winmail.dat
5K Download

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
knud van eeden  
View profile
 More options Apr 17, 5:44 am
From: knud van eeden <knud_van_ee...@yahoo.com>
Date: Thu, 17 Apr 2008 02:44:16 -0700 (PDT)
Local: Thurs, Apr 17 2008 5:44 am
Subject: Re: [TSE] Unwrap Para for HTML?
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.

with friendly greetings,
Knud van Eeden


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fred Holmes  
View profile
 More options Apr 17, 9:49 am
From: Fred Holmes <f...@his.com>
Date: Thu, 17 Apr 2008 09:49:22 -0400
Local: Thurs, Apr 17 2008 9:49 am
Subject: Re: [TSE] Unwrap Para for HTML?
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.

http://www.semware.com/html/tseprofiles.php

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:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "XML" by Steve Cramer
Steve Cramer  
View profile
 More options Apr 17, 9:58 am
From: Steve Cramer <cramer...@charter.net>
Date: Thu, 17 Apr 2008 09:58:53 -0400
Local: Thurs, Apr 17 2008 9:58 am
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? ;)

Steve
--
Steve Cramer
Athens, GA
http://www.savvypaddler.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Unwrap Para for HTML?" by Lane Whittaker
Lane Whittaker  
View profile
 More options Apr 17, 11:10 am
From: Lane Whittaker <y8norxneaf...@sneakemail.com>
Date: Thu, 17 Apr 2008 08:10:24 -0700 (PDT)
Local: Thurs, Apr 17 2008 11:10 am
Subject: Re: Unwrap Para for HTML?
From the description it looks like the "1Liner" macro will meet my
needs.

Thanks for everyone's help.

--LaneW

On Apr 17, 9:49 am, Fred Holmes <f...@his.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "XML" by Jim Sylva
Jim Sylva  
View profile
 More options Apr 17, 11:24 am
From: Jim Sylva <jasy...@northrim.net>
Date: Thu, 17 Apr 2008 09:24:24 -0600
Local: Thurs, Apr 17 2008 11:24 am
Subject: Re: [TSE] XML
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.

Here's a good article on XSLT: http://www.ibm.com/developerworks/xml/library/x-xslt/. The author of this article has written top-notch XSLT processors, some of which are free. I still use XSLT v. 1.0, not v. 2.0.

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? ;)

Steve

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Carlo Hogeveen  
View profile
 More options Apr 17, 11:25 am
From: "Carlo Hogeveen" <Carlo.Hogev...@xs4all.nl>
Date: Thu, 17 Apr 2008 17:25:45 +0200 (CEST)
Local: Thurs, Apr 17 2008 11:25 am
Subject: Re: [TSE] XML

This is an XML to text converter:

Using TSE replace "</?.*>" by "" with options "gnx".

Caveat: it depends on the text not containing "<" and ">".


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
knud van eeden  
View profile
 More options Apr 17, 11:57 am
From: knud van eeden <knud_van_ee...@yahoo.com>
Date: Thu, 17 Apr 2008 08:57:41 -0700 (PDT)
Local: Thurs, Apr 17 2008 11:57 am
Subject: Re: [TSE] XML
A few quick remarks

XML:

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.

with friendly greetings,
Knud van Eeden