Aug 132012

In the past, creating warnings and notes using templates could sometimes be tricky. That’s because the MindTouch software we used to run didn’t let you start an HTML block in one template, have some text, then use another template to end the block. The Kuma wiki we use now, however, does allow this. This helps alleviate some of the issues we have with the fact that you can’t nest templates in Kuma articles.

To create a complex block, you can now do this:

{{WarningStart()}}Here’s a bunch of text that occurs in a warning, complete with {{bug(2345)}} calls to other templates.{{WarningEnd()}}

Example warning box


{{NoteStart()}}Here’s a bunch of text that occurs in a warning, complete with {{bug(2345)}} calls to other templates.{{NoteEnd()}}

An example note box

We’ll be adding more templates for doing things like this, some of which will really help a lot (such as for building compatibility tables, which are broken right now if you use certain templates for building them). However, that will mean twiddling existing content to use them. Unfortunately, adding support for nested templates is a big project, and we have other things that need doing right now.

If you need a template like this and don’t know how to create it, take a look at those templates’ code. If you still don’t know, ping me and I’ll see what I can do to help. Since KumaScript is really just JavaScript with some provided APIs, you should be able to adapt them pretty easily though. If you need template editing permissions, let me know, and if I know you, you can probably have them.

 Posted by at 3:17 PM

  One Response to “MDN: Creating complex notes and warnings”

  1. […] MDN: Creating complex notes and warnings ( Rate this:Share this:TwitterFacebookLike this:LikeBe the first to like this. […]

This site uses Akismet to reduce spam. Learn how your comment data is processed.