Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Numbered Headings

September 17, 2001

In addition to the basic heading format, Curl adds has a numbered headings format that allows you to add further structure. Numbered headings are specified in almost exactly the same way as normal headings:

{numbered-heading level=level-number,  text }

However, the way in which they work is slightly more complex. For starters when they are displayed, the heading automatically places a number, so if you wrote the following code:

|| numbered.curl
{curl 1.7 applet}
{applet license = "development"}
{numbered-heading level=1,  This is a level 1 numbered heading }

An extra one indicating the heading number is added to the text:

1 This is a level 1 numbered heading

Numbered-headings display the number based on where they are in relation to other numbered headings and other headings. So the following code:

|| numbered2.curl
{curl 1.7 applet}
{applet license = "development"}
{numbered-heading level=1,  This is a level 1 numbered heading }
{numbered-heading level=2,  This is a subsection of a level one numbered
    
heading }

would produce the following text:

1 This is a level 1 numbered heading
1.1 This is a level 1.1 subsection of a level one numbered heading

If you placed this second line under a normal heading as follows:

|| numbered3.curl
{curl 1.7 applet}
{applet license = "development"}
{heading level=1,  This is a level 1 heading }
{numbered-heading level=2, This is a subsection of a level one heading }

then the numbered heading would still start as the next number down from the level in the heading, despite the fact that the original heading has no number:

This is a level 1 heading 1.1 This is a subsection of a level one heading

Ideally for this reason, it's best not to mix headings and numbered headings.

The numbered headings can be used to create a large number of subsections. If you want to have a set of numbered subsections you could do the following:

|| numbered4.curl
{curl 1.7 applet}
{applet license = "development"}

{numbered-heading level=1, A level one heading}
{numbered-heading level=2, A subsection of a level one heading}
{numbered-heading level=2, A subsection of a level one heading}
{numbered-heading level=3, A subsection of a level two heading}

This would display:

So each new number creates a new level, while each number, within the same level creates a new subsection on the same level. Headings are a good way to organize content, in particular for items such as a table of contents.

Headings
Early Adopter Curl
Lists


Up to => Home / Authoring / Languages / Curl / Early




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers