X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=in%2Ffunctions.md;h=38a5d1e658fb767d04233c16bc9f74580b97d880;hb=07e692ef713a7d0d65296cd62b978539ac1ed683;hp=c91418c43d59d52cb55c465ed921556a2798ba16;hpb=02dc66719998ae8faa7f8f6adef090b6de585543;p=webber.git diff --git a/in/functions.md b/in/functions.md index c91418c..38a5d1e 100644 --- a/in/functions.md +++ b/in/functions.md @@ -5,12 +5,15 @@ ctime: 2009-06-24 mtime: 2010-06-24 change: described get_toc() -= Calling functions = +You can call functions only from [[template_mako]], not from +[[pages|pageformat]]. If you need the latter, look at [[macros]]. -You can call functions only from [[template_mako]]. An example: += Example = Modified ${format_date(mtime)} += List of functions = + Here's list of functions defined by webber and it's default plugins: @@ -66,7 +69,7 @@ You'll need to specify "`root`" if your top-most page isn't named "`Home`". Defined in [[hierarchy.py|hierarchy]], where you find an example. -== get_sitemap(root, show_orphans) == +== get_linear_sitemap(root, show_orphans, level) == Returns all pages as "`(level, page, link)`" tuples, where "`page`" is a "`class File`"-object and link is a relative link from the current page to @@ -74,6 +77,8 @@ Returns all pages as "`(level, page, link)`" tuples, where "`page`" is a You'll need to specify "`root`" if your top-most page isn't named "`Home`". +The "`level`" will by default start at 1. + To put pages into the sitemap that are outside the parent/child relationships, specify "`True`" for "`show_orphans`". @@ -85,10 +90,6 @@ Returns an unsorted list with the hierarchy of the table-of-contents. Defined in [[toc.py|toc]], where you find an example. -== func == - -A sample function in the [[skeleton.py|skeleton]]. See below. - = Writing functions =