---
name: "Zim::Formats"
section: "3pm"
platform: "linux"
package: "zim"
version: "0.25-1"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/Zim::Formats"
---

# Zim::Formats(3pm)

Zim::Formats - Common routines for Zim formats TODO\
 **Registration** TODO TODO\
 **Using templates** Returns a file name or undef. Returns a hash with name =\> filename pairs of available templates. Used for exporting.

TODO: also look in NOTEBOOK/\_templates/ Setup TEMPLATE to export PAGE. TODO

\---

When a subclass has defined a `%Tags` this method will wrap the text context of each parse-tree node in this tag.

The hash `%Tags` uses the tag names as keys and has as values array refs consisting of a start string, a closing string and a boolean whether this tag can span multiple lines.

For all tags not found in this hash a method `"dump_TAG()"` is called, where TAG is the tag name.\
 **Parse-tree manipulation** Returns the link type and link target for LINK. The type can be e.g. 'page', 'file', 'mail' or 'man' - for urls the protocol is used as type.

The link target is e.g. a fully specified page name, a fully specified path, or an url. For file:// urls the path is returned. For mail a 'mailto:' url is returned.

If NO\_RESOLVE is set we only check the type, but do not try to fully specify the target. Returns a list with references to nodes of type TYPE in the tree. Deletes and returns the first node of type TYPE from the tree. Returns the level and the text content of the first head.

STRIP is a boolean, if set to TRUE the head is removed from the tree. Given a parse tree this method updates the level of all headings. MIN is the minimum level, so all headings will be shifted down with this amount (default is 1). MAX is the max level, any heading below this level will be flattened to the maximum level (default is undefined).

It is assumed that heads can only occur toplevel in the parse tree. (They can not be nested indside paragraphs etc.) Make sure that the last piece of text in the tree ends with a newline. This increases the change of the file resulting from dumping the tree to end in a newline. Jaap Karssenberg (Pardus) \<pardus@cpan.org\> Copyright (c) 2006 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
