Zim - Application object for the zim desktop wiki
use Zim;my $repo = Zim->new( dir => $dir );my $page = $repo->get_page('Home');
This class defines the public interface to the document repository as used by zim(1). It acts as a dispatcher that manages one or more store objects to handle page requests. It also adds some tests and thus tries to isolate the stores from errors in the GUI. These repositories are called "notebooks" in the UI The interface which child objects should support is defined in Zim::Store. This following signals are emitted by this object: Any othe object changing our config should call "signal_emit" for this signal in order to notify all other objects.
Public Methods The following methods can be used by the GUI. Constructor. Parameters can be:
dir - top leve ldirectory for the notebooktype - type of the (default) top level store objectparent - parent object in case we are nestednamespace - namespace in case we are nested
Initializes a Zim::History to be used with this repository. Returns the history object or undef. This will connect a new child object to this repository under a certain namespace. CHILD is a class name implementing the store interface. The class will be looked for in "Zim::Store::". All remaining arguments will be passed on to the constructor of the object. Save config, history, etc. to disk. Returns self. Returns the base directory for files.
The "base" directories for individual pages should either be the same as this directory or a subdirectory of it. Lists pages in NAMESPACE. Sub-namespaces have a trailing ':' in the listing.
If a page is not present in this list that does not mean that it doesn't exists. This list is used for hierarchical views of the page structure; not all stores need to support a hierarchical order. Returns an object of a class inheriting from Zim::Page. When you ask for a page that doesn't exists yet, you should get a new object. In case it is not possible to create the page in question "undef" is returned. Like "get_page()" but now expecting NAME to be user input, so NAME is sanitized first. Cleans up NAME but does not actually fetch a page object. Returns a namespace string. Used to sanitize user input. Copy page SOURCE to TARGET. Both arguments can be either page names or objects. Returns the (new) TARGET object. The UPDATE_LINKS argument is a boolean that tells whether links to this page should be updated to point to this new name. Move page SOURCE to TARGET. Both arguments can be either page names or objects. Returns the (new) TARGET object.The UPDATE_LINKS argument is a boolean that tells whether links to this page should be updated to point to this new name. Delete PAGE. PAGE can be either a page name or a page object. Returns a list of links to this page. TODO stable api for this using Zim::Selection
Results are given as arguments to CALLBACK in the form "[PAGE, SCORE]". Returns an url for an interwiki link with interwiki name KEY and page PAGE. Lookup for names is case in-sensitive. Return a object of class Zim::History or undef.
Document Interface This interface is used to deal with external documents that belong to the notebook. Think of these documents as attachments. See detailed docs in Zim::Store. Returns the document dir for PAGE. Returns the document root or undef. Stores FILE in the document dir. Resolve a linked file. Returns a relative path for creating links.
Class Methods These methods can be called as "Zim->method(...)". Return a config file for the notebook at DIR. Returns a dir to store e.g. history and other state files. By default this is either ".zim/" in the notebook directory or a directory under XDG_CACHE. Returns true if DIR is the root of a notebook. Returns a path for notebook NAME. Special names are:
_default_ default notebook_doc_ help manual
Returns a list of array references containing name and path for known notebooks. Save a list of array references containing name and path for known notebooks. Please mail the author if you find any bugs. Jaap Karssenberg || Pardus [Larus] <[email protected]> Copyright (c) 2005 Jaap G Karssenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. zim(1), Zim::Store