[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Filter Development
From:       Thomas <zander () xs4all ! nl>
Date:       2000-10-18 19:32:06
[Download RAW message or body]

Sorry for the slow reply.

There is one thing that would be really nice, and also good for a
starting project. A good ascii import filter.

You might think that that is really easy, let me show you what is missing
in the current version.

- smart detection when a new paragraph is started. Currently we start a 
  new paragraph on every line-break. This is bad.
- deletion of extra spaces. People tend to use spaces in front or 
  at the end of lines, they look bad in a WP
- Auto detection of enumerated lists would be nice. Setting that to the
  right style.

The above list illustrates my second and thirth point. 

This whole text illustrates the use of the first point.

Consider reading this email with the current filter and doing it again 
after you used the following perl script on the file.

Have fun!!

> I saw Werner Troben's page on file filter development and decided 
> to try my hand at working on one. I see that several filters are 
> either available or are being worked on. Does anyone have some 
> suggestions as to what is needed? The Microsoft filters will cover 
> about 95 per cent of the users at least according to Microsoft.What 
> else is pressing?


----
#!/usr/bin/perl -n
 
$line=$_;
$line=~s/^ *//;     # remove leading spaces
$line=~s/ *$//;     # remove trailing spaces
chomp($line);       # remove unix style new line
$line=~s/\r//;      # remove windows style new line
 
if($line eq "") {$empty++; next;}   # dont print empty lines.
if($empty>0) {print "\n"; $empty=0;}    #if the last line was an empty line, we are 
                                        # at a new paragraph.
if($line=~s/-$//) {print $line}     # remove '-' at end of line.
else {print "$line ";}


-- 
Thomas Zander                                            zander@earthling.net
The only thing worse than failure is the fear of trying something new
_______________________________________________
Koffice-devel mailing list
Koffice-devel@master.kde.org
http://master.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic