Here's list of functions defined by webber and it's default plugins:
+
== format_date ==
Takes a timestamp (seconds since 1st January 1970) and converts it into
Defined in `webber.py`.
+
+== get_time ==
+
+Returns the current date/time as a string according to `cfg.date_format`.
+
+Defined in `webber.py`.
+
+
== get_breadcrumbs ==
Returns the breadcrumbs as "`(linktitle, link)`" tuples.
Defined in [[hierarchy.py|hierarchy]], where you find an example.
+
== get_current_file ==
Returns the current `class File` object.
Defined in `webber.py`.
+
== get_recently ==
Returns a list of up to 10 pages below the current page. For each
def get_link_from(source, dest):
#print "get_link_from", source, dest
- source = get_file_for(source)
+ #print source
+ if not isinstance(source, File):
+ source = get_file_for(source)
if not source:
+ print "NO SOURCE"
return "."
- dest = get_file_for(dest)
+ if not isinstance(dest, File):
+ dest = get_file_for(dest)
if not dest:
+ print "NO DEST"
return "."
rel_path = relpath(directories[source.direc].abs_path, directories[dest.direc].abs_path)
try:
def format_date(timestamp):
return time.strftime(cfg.date_format, time.localtime(timestamp))
+@set_function("get_time")
+def get_time():
+ return format_date(time.time())
+
@set_function("get_current_file")
def get_current_file():
return current_file