[% chapters = [ { level = 2, id = 'intro', title = 'Introduction', }, { level = 2, id = 'auth', title = 'Authentication', }, { level = 2, id = 'relations', title = 'Resources', }, ]; FOREACH col IN collections.keys.sort; chapters.push({ level = 3, id = col, title = collections.$col.name, uri = collections.$col.uri }); END; chapters.push({ level = 2, id = 'definitions', title = 'Definitions' }); -%]

# Sipwise NGCP HTTP API Documentation

## Table of Contents

[% FOR chapter IN chapters -%] [% IF loop.prev && loop.prev.level >= chapter.level -%]
[% END -%]
[% IF chapter.level != 3; t = 'api/root/' _ chapter.id _ '.tt'; INCLUDE $t level=chapter.level title=chapter.title id=chapter.id uri=chapter.uri; ELSE; t = 'api/root/collection.tt'; colname = chapter.id; INCLUDE $t level=chapter.level title=chapter.title id=chapter.id uri=chapter.uri col=collections.$colname; END; -%]
[% END -%]
[% # vim: set tabstop=4 syntax=html expandtab: -%]