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

We cover themes 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/ex11/ directory of the source
distribution.

The concept of themes was introduced to reduce one more level of code
duplication. If you have a group of subtags, subtaggroups, and/or pageorders
which are defined for many pages, it can become tedious to make changes to
the configuration file. So instead of defining/referencing this group of
attributes, we can put them into a theme and just reference the theme. For
example, the following two sections will operate the same:

--- Section 1 ---

PageGroup {
  Page {
    web_page "news/index.html"

    SubTag "<section>" "News"
    subtaggroup "news"
    pageorder "news
  }

  Page {
    web_page "news/archive.html"

    SubTag "<section>" "News"
    subtaggroup "news"
    pageorder "news
  }
}

--- Section 2 ---

PageGroup {
  Theme {
    name "news"

    SubTag "<section>" "News"
    subtaggroup "news"
    pageorder "news
  }

  Page {
    web_page "news/index.html"
    theme "news"
  }

  Page {
    web_page "news/archive.html"
    theme "news"
  }
}

As you can see, this can become very useful if more and more pages are added
to the news area. Themes can also be used to reduce command/options
definitions:

PageGroup {
  command "cat"
  options "<%i >%o"

  Theme {
    name "cat2"
    command "cat2"
    options "<%i >%o && echo \"not your typical cat\""
  }

  Page {
    web_page "external.html"
    theme "cat2"
  }

  Page {
    web_page "external2.html"
    theme "cat2"
  }
}

The above samples have been similarly implemented in the config file for
this example.

Ok, this is the end of example 11.
