Re: HTML tags optimization [ interesting problem]

2005-09-02 Thread DENG
hi, Sybren,

thanks for your reply, if use CSS:

texttexttext

optimise to:

texttexttext

what i need is the METHOD to do optimization, in fact, i have ready
write a program to analyse the syntax of CSS, to make it works with all
situation

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: HTML tags optimization

2005-09-02 Thread Michael . Coll-Barth

Maybe you can get some ideas over at http://validator.w3.org/docs/.  At
least they have the whole parser thing worked out.

-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
n.org]On Behalf Of DENG
Sent: Friday, September 02, 2005 8:36 AM
To: python-list@python.org
Subject: HTML tags optimization


hi all,

i want to do some optimizations for HTML tags,
___
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure.  If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof.  Thank you.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [OT] HTML tags optimization

2005-09-02 Thread bruno modulix
DENG wrote:
(snip same post as two days ago)


In case you don't know, google.groups is just a web interface (and
archive) to usenet groups. No need to repost the same question twice...


BTW, for what you want to do (which is mostly a waste of time IMHO, but
what, that's your time, not mine), the obvious, CS101 answer is to first
build an AST of your document, then transform this AST - collapsing
nodes when possible etc -, then write it back as (if possible valid) html.


-- 
bruno desthuilliers
ruby -e "print '[EMAIL PROTECTED]'.split('@').collect{|p|
p.split('.').collect{|w| w.reverse}.join('.')}.join('@')"
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: HTML tags optimization

2005-09-02 Thread Steve Holden
DENG wrote:
> hi all,
> 
> i want to do some optimizations for HTML tags,
> 
> something like this:
> 
> TEXT1TEXT2
> 
> optimise to
> 
> TEXT1TEXT2
> 
> at the very beginning, i was thinking of analysing each text-block, to
> know their color, size, if is bold or italic, but i found it was too
> complicated.
> 
[etc ...]

Are you expecting the answers to be different that they were two days ago?

regards
  Steve
-- 
Steve Holden   +44 150 684 7255  +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

-- 
http://mail.python.org/mailman/listinfo/python-list


HTML tags optimization

2005-09-02 Thread DENG
hi all,

i want to do some optimizations for HTML tags,

something like this:

TEXT1TEXT2

optimise to

TEXT1TEXT2

at the very beginning, i was thinking of analysing each text-block, to
know their color, size, if is bold or italic, but i found it was too
complicated.

e.g

TEXT1

optimise to

TEXT1

but if there is TEXT2 exist

TEXT1TEXT2

we can not do any optimization.

my problem is I can not find a method to treat all those situation, I
had too much thinking and get fool now

anyone can give me some advices?

thanks

PS:

other examples:

1
TEXT
=>
TEXT

2
TEXT TEXT
=>
TEXT TEXT

3
TEXTTEXT
=>
TEXT

etc...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: HTML tags optimization [ interesting problem]

2005-09-01 Thread Sybren Stuvel
DENG enlightened us with:
> i use SGMLParser to process HTML files, in order to do some
> optimizations,
>
> something like this:
>
>TEXT1TEXT2
>
> optimise to
>
>TEXT1TEXT2

Why not optimize it to:

TEXT1
TEXT2?

> [ snipped stuff about  tags ]

If you're serious about using HTML, I suggest you read a book that's
not ten years old.

> anyone can give me some advices?

Yes, read the following:

http://www.w3.org/QA/Tips/
http://www.w3.org/TR/CSS21/
http://www.w3.org/TR/xhtml1/
http://validator.w3.org/

Sybren
-- 
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself? 
 Frank Zappa
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: HTML tags optimization [better learn CSS]

2005-09-01 Thread bruno modulix
DENG wrote:
> I know very well Tidy, sir
> 
> Tidy do a nice job but it is writen in Java,

Seems like we're not talking about the same program here. Tidy (aka
HTMLTidy) is written in C. You must be talking about it's Java port JTidy.

> and have Python ported
> 
> my aim is to learn Python, learn how to program

No one could have guess from your post, and I dont have psychic powers,
ok ?

>From a professional POV, using existing tools that have proven to be
reliable is far better than reinventing the square wheel, hence my answer.

> you are french, right? peut etre we can talk about it in ecole
> polytechnique? 

Peut-être pas, je ne mets jamais les pieds chez les polytechniciens.

> i'll be there waiting for you

I'm afraid you'll learn a long time.

Regards,
-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: HTML tags optimization [ interesting problem]

2005-09-01 Thread DENG
I know very well Tidy, sir

Tidy do a nice job but it is writen in Java, and have Python ported

my aim is to learn Python, learn how to program

I know many people write "hello the world" in 2005, why I can not write
this program in 2005?

you are french, right? peut etre we can talk about it in ecole
polytechnique? i'll be there waiting for you

thanks

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: HTML tags optimization [better learn CSS]

2005-09-01 Thread DENG
I know very well Tidy, sir

Tidy do a nice job but it is writen in Java, and have Python ported

my aim is to learn Python, learn how to program

I know many people write "hello the world" in 2005, why I can not write
this program in 2005?

you are french, right? peut etre we can talk about it in ecole
polytechnique? i'll be there waiting for you

thanks

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: HTML tags optimization [better learn CSS]

2005-08-31 Thread Bruno Desthuilliers
DENG a écrit :
> hi all,
> 
> i use SGMLParser to process HTML files, in order to do some
> optimizations,
> 
> something like this:
> 
> TEXT1TEXT2
> 
> optimise to
> 
> TEXT1TEXT2

Doesn't Tidy do this already ?

> 
> at the very beginning, i was thinking of analysing each text-block, to
> know their color, size, if is bold or italic, but i found it was too
> complicated.
> 
> e.g
> 
> TEXT1

Whoever writes such a thing in 2005 ought to be shot down for the sake 
of mankind !-)

> optimise to
> 
> TEXT1

You call this "optimized HTML" ? Even MS Word produces better code...

> 
> but if there is TEXT2 exist
> 
> TEXT1TEXT2
> 
> we can not do any optimization.
> 
> my problem is I can not find a method to treat all those situation,

Tidy is open source AFAICT.

> I
> had too much thinking and get fool now
> 
> 
> anyone can give me some advices?

Learn to use Tidy and CSS.
-- 
http://mail.python.org/mailman/listinfo/python-list


HTML tags optimization [ interesting problem]

2005-08-31 Thread DENG

hi all,

i use SGMLParser to process HTML files, in order to do some
optimizations,

something like this:

TEXT1TEXT2

optimise to

TEXT1TEXT2


at the very beginning, i was thinking of analysing each text-block, to
know their color, size, if is bold or italic, but i found it was too
complicated.

e.g

TEXT1

optimise to

TEXT1


but if there is TEXT2 exist

TEXT1TEXT2

we can not do any optimization.

my problem is I can not find a method to treat all those situation, I
had too much thinking and get fool now


anyone can give me some advices?

thanks




PS:

other examples:

1
TEXT
=>
TEXT

2
TEXT TEXT
=>
TEXT TEXT

3
TEXTTEXT
=>
TEXT

etc...

-- 
http://mail.python.org/mailman/listinfo/python-list