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

RE: TOC tag (table of contents)



Hi,

Viorel Anghel wrote:
> I recently "discovered" the <toc> tag (wml::std::toc) and is very usefull.
> But, is there any expert which can rewrite (or add a style to) "toc" in
order
> to use nested lists?

Good idea.

I just modified wml::std::toc to implement some new styles, "list",
"list-ol", and "list-ul" to implement a table of contents using nested
lists. I think this should work for what you want. The "list-ol" style uses
ordered lists so that the list items have numbers, while the "list-ul" style
uses unordered lists for bullets. The style "list" is just an alias to
"list-ul".

If you want to change the style of the lists, such as adding an option to
the <ul> or <ol> tags, just modify the diversions TOC_L and TOC_UNL. This
will override the  "list-ol" or "list-ul" settings. For example, to create
an un-ordered list with style=box, use the following:

---
#use "where-you-install-file" style=list

..TOC_L>><ul style="box"><<..
..TOC_UNL>></ul><<..
---

I've attached the modified toc.wml file from the $(WML_HOME)/lib/include/std
directory. I hope it goes through the list server. This is, of course, free
for all to use.

 - David Harris
   Principal Engineer, DRH Internet Services


mytoc.wml