Template:PrintWikiTree

    Table of contents
    No headers
    /* Template merges all subpages of a given path into a new page */
    
    /* Input parameters */
    var pth     = $path;            // path to the parent page of the subpages to merge
    
    /* Admin parameters */
    var toctext = 'Contents';
    
    if ($include_toc) {
        if (String.toupper($include_toc) == 'TRUE') {
            web.html("<h1>"..(toctext).."</h1>");
            wiki.toc(page.path);
        }
    } else {
        web.html("<h1>"..(toctext).."</h1>");
        wiki.toc(page.path);
    }
    if ($include_root) {
        if (String.toupper($include_root) == 'TRUE') {
            web.html("<h1>"..wiki.getpage(pth).title.."</h1>");
            wiki.page(""..(pth));
        }
    }
    var data = list.sort(wiki.getsearch("+type:wiki +path:"..string.searchescape(pth).."/*", 1000), "path");
    foreach (var p in data) {
        var s = '<h'..(#p.parents-#wiki.getpage(pth).parents)..' style="page-break-before: always;">'..p.title..'</h'..(#p.parents-#wiki.getpage(pth).parents)..'>';
        web.html(s);
        wiki.page(p.path);
    }
    
    Tag page (Edit tags)
    • No tags
    You must login to post a comment.
    Powered by MindTouch Core