Skip to content

Commit 0f77346

Browse files
Supply mandatory metadata in writer example (#193)
* Supply mandatory metadata in writer example A zim file has certain mandatory requirements in the metadata; for example, Language, Date, and Illustration must be present. If they aren't, then some ZIM reader apps (such as Kiwix for iOS) will refuse to open the zim file. So, add these mandatory pieces to the example code in the readme, so that if you generate a zim file by following the example code, it will be valid. * Apply suggestions from code review Co-authored-by: rgaudin <reg@rskg.org> --------- Co-authored-by: rgaudin <reg@rskg.org>
1 parent 0562ffd commit 0f77346

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,16 @@ with Creator("test.zim").config_indexing(True, "eng") as creator:
117117
creator.set_mainpath("home")
118118
creator.add_item(item)
119119
creator.add_item(item2)
120+
illustration = pathlib.Path("icon48x48.png").read_bytes()
121+
creator.add_illustration(48, illustration)
120122
for name, value in {
121123
"creator": "python-libzim",
122124
"description": "Created in python",
123125
"name": "my-zim",
124126
"publisher": "You",
125127
"title": "Test ZIM",
128+
"language": "eng",
129+
"date": "2024-06-30"
126130
}.items():
127131

128132
creator.add_metadata(name.title(), value)

0 commit comments

Comments
 (0)