Difference between revisions of "Article Format"
(Created page with '== Article Text == 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 (headlin…') |
Mgautierfr (talk | contribs) (Adapt article description format to new namespace usage.) |
||
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
All content put in a zim archive must be put in the <code>C</code> 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 <code><head></code> tag or any css, scripts and fonts links). | |||
Article's content must be utf-8 encoded. | |||
The | ZIM contents are addressed using the entry's path without the namespace. The references in articles HTML code (<code><a href=""></a></code>, <code><img src=""></code>, etc.) must be valid and usable by a classical web browser (ie, URL-encoded following the [http://www.ietf.org/rfc/rfc1738.txt 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 (<code>C/foo.html</code>) are also forbidden as the namespace may be hidden by the libzim. URLs must not go "too up" in the directory hierarchy (<code>../C/bar.png</code>). <code>../</code> 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. | |||
Latest revision as of 11:35, 15 December 2020
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.