|−|== Article Text == |+|
be in the .
|−|Articles to be parsed and shown directly by the ZIM reader are stored as HTML body, without any layout except the formattings used in the article text (headlines, tables, images...). | |
| || |
|−|Shortly, the A namespace contains the ''visible'' data of an article. |+|
| || |
|−|* '''Namespace:''' A |+|
|−|* ' ''Path:''' /A/ ''URL'' |+|
'/, and ).
|−|** whereas ''URL'' is often identical to the ''Article Name'', but this is not a requirement (see [[ZIM File Format#URL Pointer List (urlPtrPos)|URL pointer list]] and [[ZIM File Format#Title Pointer List (titlePtrPos)|title pointer list]] for details). | |
| || |
|−|== Meta Data == |+|
|−|Some publisher want to provide additional header information for the reader application to individual articles, such as HTML Meta Data or a special layout around the article text. | |
| || |
|−|Shortly, the B namespace contains the ''invisible'' part of an article. |+|
the namespacethe .
| || |
|−|By default the Meta Data can be non-existant or empty. |+|
the be .
| || |
|−|Typically the article text and article meta data are linked to each other by having the same URL. |+|
the by the .////is the .
|−|* '''Namespace:''' B |+|
|−|* '''Path:''' / B/ ''URL'' |+|
|−|** whereas / B/ ''URL'' is the Meta Data used for /A/''URL''. |+|
to , of the and .
= Content Inclusion === | |
|−|The Article Text needds to be combined with Article Meta Data, therefore the Meta Data needs to define a placeholder where the Article Text has to be inserted. | |
|−|== Fetching Article Text vs. Article Meta Data == | |
|−|Links inside articles always use the A namespace to refer to other articles, so the zimlib does provide Article Text by default for any requests of namespace A. | |
|−|To request the pure article data from namespace A use the <tt>getData()</tt> method in zimlib. | |
|−|To get an article included inside the layoutpage and with meta data use the <tt>getPage()</tt> method in zimlib. | |
All content put in a zim archive must be put in the
Entries can be :
- Articles : Html content intended to be displayed to the user
- Resources : Any other kind of file, mainly intended to be included in articles or other resources (css, images, js, ...)
Article's contents are full html pages. (including any
<head> tag or any css, scripts and fonts links).
Article's content must be utf-8 encoded.
ZIM contents are addressed using the entry's path without the namespace. The references in articles HTML code (
<img src="">, etc.) must be valid and usable by a classical web browser (ie, URL-encoded following the RFC 1738 rules).
Absolute URLs, ie. with a leading slash (/), are forbidden, because this avoid including the ZIM contents in any HTTP sub-hierachy. URLs must consequently be relative.
URLs with namespace (
C/foo.html) are also forbidden as the namespace may be hidden by the libzim. URLs must not go "too up" in the directory hierarchy (
../ is still possible if the entries is in a sub-directory.
There is no strong constraints on resources entries :
- Mimetype must be correctly set.
- We advice textual contents to be utf-8 encoded but we cannot enforce it, it depends of the resource and how it is used.