[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: Idea how not to need future enhancement of WML - Environment

Hello Jan!

On Wed, 5 Jul 2000, Jan Holler wrote:
> > Ok - this would be a solution for your this case - but I want to use
> > different environments at one page!
> That is why I mentioned CSS, the cascading makes it
> interesting.

:-) I agree...

> I also think the effort of creating e.g. <ptable> is not
> worth result since it differs from site to site too much
> and could not easily be reused in new sites.

You don't know <ptable> and its function!

It does the following:

* You can define cells for pictures and cells for text, which can span
multiple rows and columns

* According to a total width set in the opening <ptable> tag it tries to
find out the best geometry of each picture to fit into this layout: for
example a row of three pictures is layed out with three pictures of the
same height, the total width as set.

* More complex like the following is also possible (A, B and C different
pictures of different original size and different aspect ratios):

	|     | B |
	|  A  +---+
	|     | C |

* And even more complex layouts are also possible ;-)

So, the main function is not to `draw´ table elements but to calculate the
needed size of the pictures ;-) (and to resize them)

I used that to make a photo album of about 188 photos on 59 pages,
calculating the size of the pictures by hand would last too long...

I wrote these functions not very site-specific - almost everything can be
set up by the user - and I'll publish these set of macros in the moment,
when I've set up a computer with Linux and WML here in Vienna (I changed
from Spain three weeks ago) to do the necessary changes to use them with
the latest WML version. 

In that moment also a public version with pictures will be available, this
photo album is a little bit to private to publish the URL on the list.

Another example which is ready yet:

I've programmed something like a table of content (TOC) generator which
can organize different pages. This is done by adding a special line to the
TOC file and the text to view as link to this page. Of course, a type of
sorting is provided (and also links to the previous and next file,
according of the level).

Imagine the following TOC file (the lines with #TOC# are these special
lines used by the macro to make the sorting):

#TOC# 101 1 toc_1.html
<TOCENTRY src="toc_1.html" level=1>Inhaltsverzeichnis</TOCENTRY>
#TOC# 111 1
<TOCENTRY level=1>Weihnachten</TOCENTRY>
#TOC# 112 2 xmas_2.html
<TOCENTRY src="xmas_2.html" level=2>Weihnachten in Valencia</TOCENTRY>
#TOC# 113 2 xmas_3.html
<TOCENTRY src="xmas_3.html" level=2>Abschied von Marcos</TOCENTRY>

Imagine that you want to use this TOC in two kinds: in a small version at
the left side of each page, in another version as start page...

With environments you can use it in the following way:

<lefttoc> 		# lefttoc is an environment and also 
			# <lefttoc:tocentry> is defined
#include 'std.toc'

and at the mainpage:

<maintoc>		# <maintoc:tocentry> is defined
#include 'std.toc'

So - now I wrote very much of my idea of environments. Is there anybody
out there who wants another explanation? ;-)

Few words about site-specifiness of macros: 

I'd like to write the macros in a way that another person can reuse them -
this way we could share our work and make WML more powerful. I think that
wml::mod::MakeMaker was introduced by Denis Barbier to do this.

Greetings from Vienna,

Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com