Filewatcher File Search File Search
Catalog
Content Search
» » » » » wsmake-0.6.4.tgz » Content »
pkg://wsmake-0.6.4.tgz:215855/share/examples/wsmake/ex10/  info  downloads

wsmake…  more info»

README

This is example 10 as described in the Wsmake User Manual.

We cover Clones and "cascading makes" in this example. It would be good to
understand the other examples before attempting this one.

This example can be found in the doc/examples/ex10/ directory of the source
distribution.

Clones were made for the specific purpose of displaying the same
page, but in a different way. Wsmake.org is a good example because I
duplicate nearly every page using clones. One part of the website is
for browsers like mozilla, another part is for the less fortunate
users of netscape and internet explorer, and a third part is meant
to be for lightweight (text-only) browsing.

"Cascading makes" have to do with using the output of one
page made by wsmake as the source for another.

This example is fairly complex, so I've separated the "cascading make" to
be separate from the first example of cloning, which will be discussed
first.

The characteristics of a clone are that it has all of the properties
defined by its original, and some unique properties of its own.

  Page {
    web_page "index.html"

    Clone {
      web_page "index0.html"
      pageorder "header"
    }
  }

We see here that a clone is defined inside the page section. Naturally,
more than one clone may be defined. In order to make the clone unique,
its web_page/output_page must be unique across the website. It will use
the source from its original. Note that a pageorder is defined in the
clone section. That pageorder will apply to the clone, but not to the
original. However, any definitions in the original BEFORE the definition
of the clone DO apply to the clone. For instance:

  Page {
    source_page "index.html"

    SubTag "testing" "not really a test"
    Clone {
      output_page "index-clone.html"
    }
    pageorder "basic"
  }

In this case the SubTag will be applied to both the original and the
clone. However, the pageorder "basic" will only be applied to the original.

The next section uses external commands to demonstarte using clones and
the use of "cascading makes". What happens here is that this Page will be
using the output from the Page clone we just defined above. The clone will
do the same:

  Page {
    source_page "index-clone.html"
    output_page "index-cascaded.html"

    Clone {
      output_page "index-cascaded-clone.html"
      options "<%s >%o && echo \"  \`--> Special output for clone.\""
    }
  }

In this case we see how options can be overridden for clones. The same
is true for the command. 

If we run wsmake on this config file, the output should look like:

shell$ wsmake -f ex10.ws
New Part   : header.html                   
New Webpage: index.html                    [.]
New Clone  : index-clone.html              [..]
New Webpage: index-cascaded.html           [.]
New Clone  : index-cascaded-clone.html     [.]
  `--> Special output for clone.
shell$

The first clone was dependent on a pageorder. Try "touching" the pagepart
in that pageorder and re-running wsmake (with debug level 2), output
should look like:

shell$ touch templates/header.html
shell$ wsmake -f ex10.ws -d 2
Loading configuration:
2 PageGroups, 2 Pages.
Synchronizing database with filesystem:
Upd Part   : header.html                   
Making website:
--- Webpage: index.html                    
PoU Clone  : index-clone.html              [..]
Upd Webpage: index-cascaded.html           [.]
Frc Clone  : index-cascaded-clone.html     [.]
  `--> Special output for clone.
shell$

Now we see that only the clone for the first Page was updated as
expected, and also that because the clone output was updated, the entire
second Page original and clone are updated.

Ok, this is the end of example 10.
Results 1 - 1 of 1
Help - FTP Sites List - Software Dir.
Search over 15 billion files
© 1997-2017 FileWatcher.com