Article Format

From openZIM
Revision as of 11:35, 15 December 2020 by Mgautierfr (talk | contribs) (Adapt article description format to new namespace usage.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

All content put in a zim archive must be put in the C namespace.

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 Entries

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 (<a href=""></a>, <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 (../C/bar.png). ../ is still possible if the entries is in a sub-directory.

Resources Entries

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.