class documentation

class ExportLinker(BaseLinker): (source)

Known subclasses: zim.export.linker.StaticExportLinker, zim.www.WWWLinker

View In Hierarchy

This 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
Unknown Field: todo
info on formats to know how to set "usebase"
Method __init__ No summary
Method file_object Turn a File object in a relative link or URI
Method img Returns an url for image file 'src'
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_dest_file Find the destination file for an attachment @returns: a File object
Method resolve_source_file No summary
Method resource Return an url for template resources
Instance Variable base Undocumented
Instance Variable document_root_url Undocumented
Instance Variable layout Undocumented
Instance Variable notebook Undocumented
Instance Variable output Undocumented
Instance Variable source Undocumented
Instance Variable usebase Undocumented
Method _link_file Undocumented
Method _link_interwiki Undocumented
Method _link_mailto Undocumented
Method _link_notebook Undocumented
Method _link_page Undocumented
Method _resolve_file Undocumented
def __init__(self, notebook, layout, source=None, output=None, usebase=False, document_root_url=None): (source)
Contructor
Parameters
notebookthe source Notebook for resolving links
layoutthe ExportLayout for resolving target files
sourceis the Path of the source page being exported
outputis a File object for the destination file
usebaseif True the format allows returning relative paths
document_root_urloptional URL for the document root
def file_object(self, file): (source)
overridden in zim.www.WWWLinker
Turn a File object in a relative link or URI
def img(self, src): (source)
Returns an url for image file 'src'
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
def page_object(self, path): (source)
overridden in zim.www.WWWLinker
Turn a Path object in a relative link or URI
def resolve_dest_file(self, link): (source)
Find the destination file for an attachment
Returns
a File object
def resolve_source_file(self, link): (source)
overridden in zim.www.WWWLinker
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
def resource(self, path): (source)
overridden in zim.www.WWWLinker
Return an url for template resources
base = (source)

Undocumented

document_root_url = (source)

Undocumented

layout = (source)

Undocumented

notebook = (source)

Undocumented

output = (source)

Undocumented

source = (source)

Undocumented

usebase = (source)

Undocumented

def _link_file(self, link): (source)

Undocumented

def _link_interwiki(self, link): (source)

Undocumented

def _link_mailto(self, link): (source)

Undocumented

def _link_notebook(self, link): (source)

Undocumented

def _link_page(self, link): (source)

Undocumented

def _resolve_file(self, link): (source)

Undocumented