class documentation

class BaseLinker(object): (source)

Known subclasses: zim.export.linker.ExportLinker, zim.formats.StubLinker

View In Hierarchy

Base class for linker objects Linker object translate links in zim pages to (relative) URLs. This is used when exporting data to resolve links. Relative URLs start with "./" or "../" and should be interpreted in the same way as in HTML. Both URLs and relative URLs are already URL encoded.
Method file_object Turn a File object in a relative link or URI @implementation: must be implemented by child classes
Method img Returns an url for image file 'src' @implementation: must be implemented by child classes
Method link Returns an url for a link in a zim page This method is used to translate links of any type.
Method page_object Turn a Path object in a relative link or URI
Method resolve_source_file No summary
Method resource Return an url for template resources @implementation: must be implemented by child classes
def file_object(self, file): (source)
Turn a File object in a relative link or URI
Unknown Field: implementation
must be implemented by child classes
def img(self, src): (source)
Returns an url for image file 'src'
Unknown Field: implementation
must be implemented by child classes
def link(self, link): (source)
Returns an url for a link in a zim page This method is used to translate links of any type.
Parameters
linklink to be translated
Returns
url, uri, or relative path context of this linker
Unknown Field: implementation
must be implemented by child classes
def page_object(self, path): (source)
Turn a Path object in a relative link or URI
def resolve_source_file(self, link): (source)
Find the source file for an attachment Used e.g. by the latex format to find files for equations to be inlined. Do not use this method to resolve links, the file given here might be temporary and is not guaranteed to be available after the export.
Returns
a File object or None if no file was found
Unknown Field: implementation
must be implemented by child classes
def resource(self, path): (source)
Return an url for template resources
Unknown Field: implementation
must be implemented by child classes