]> oss.titaniummirror.com Git - webber.git/blobdiff - in/functions.md
docs: many misc enhancements and clarifications
[webber.git] / in / functions.md
index d45b2c884d637a729d52a677c029db0071ac5730..38a5d1e658fb767d04233c16bc9f74580b97d880 100644 (file)
@@ -1,17 +1,23 @@
 title: Functions
 parent: Webber
-ctime: 2009-06-26
+lang: en
+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:
 
 
-== format_date ==
+== format_date(timestamp) ==
 
 Takes a timestamp (seconds since 1st January 1970) and converts it into
 a string, using to `cfg.date_format`.
@@ -19,58 +25,70 @@ a string, using to `cfg.date_format`.
 Defined in `webber.py`.
 
 
-== get_time ==
+== get_time() ==
 
 Returns the current date/time as a string according to `cfg.date_format`.
 
 Defined in `webber.py`.
 
 
-== get_breadcrumbs ==
+== get_breadcrumbs() ==
 
-Returns the breadcrumbs as "`(linktitle, link)`" tuples.
+Returns the breadcrumbs as "`(page, link)`" tuples, where "`page`" is a "`class
+File`"-object and link is a relative link from the current page to "`page`".
 
 Defined in [[hierarchy.py|hierarchy]], where you find an example.
 
 
-== get_current_file ==
+== get_current_file() ==
 
-Returns the current `class File` object.
+Returns the current "`class File`" object.
 
 Defined in `webber.py`.
 
 
-== get_recently ==
+== get_recently(page) ==
 
-Returns a list of up to 10 pages below the current page. For each
-page, you'll get a "`(mtime, ctime, title, link)`" tuple back.
+Returns a list of up to 10 pages below the specified page. If you don't
+specify a page, the current page will be used. For each page, you'll get a
+"`(page, link)`" tuple back, where "`page`" is a "`class File`"-object and
+link is a relative link from the current page to "`page`".
 
 Defined in [[hierarchy.py|hierarchy]], where you find an example.
 
 
 == get_sidemenu(root) ==
 
-Returns a menu for the current page. For each page in this menu you'll
-get back a "`(level, part_of_path, is_current, title, link)`" tuple.
+Returns a menu for the current page. For each page in this menu you'll get
+back a "`(level, part_of_path, is_current, page, link)`" tuple, where
+"`page`" is a "`class File`"-object and link is a relative link from the
+current page to "`page`".
+
+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(home, 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
+"`page`".
 
-Returns all pages as "`(level, title, link)`" tuples.
+You'll need to specify "`root`" if your top-most page isn't named "`Home`".
 
-You'll need to specify "`root`" if your top-most page is a different one.
+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`".
 
 Defined in [[hierarchy.py|hierarchy]], where you find an example.
 
+== get_toc() ==
 
-== func ==
+Returns an unsorted list with the hierarchy of the table-of-contents.
 
-A sample function in the [[skeleton.py|skeleton]]. See below.
+Defined in [[toc.py|toc]], where you find an example.
 
 
 = Writing functions =