You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The writer API will be rewrite to better expose the (new) functionalities of libzim, and avoid potential mistake.
The main idea is to stop provide a somehow unique method addArticle and have all the specific article handling in the Article class (that the user need to implement).
Metadata will be added with a specific method addMetadata(name, content)
Redirection will be added with a method addRedirect(target, url, title)
Other articles will be added using the "classic" method addArticle.
Article interface would be adapted :
No isRedirect, isLinkTarget, isDeleted nor getRedirectUrl.
No shouldCompress (inferred from the mimetype)
No shouldIndex (infered from the getIndexData and the article's hint)
New method getIndexData. The user code would have to provide a content to index (potentially different from the data to store).
New method getHint return a set of hints for the creator. This hint could be used by the creator to take better decision about the article. Hint could be if the article is chrome articles (css/js), if it should be compressed or not (despite of its mimetype), ...
While the creator will need a object fulfilling an Article interface, libzim will provide a basic implementation of the interface to simplify user code. For specific usage, one would still be able to implement the interface.
This issue is about the API of the writer only. This doesn't include a change in the format of the zim file.
The text was updated successfully, but these errors were encountered:
The writer API will be rewrite to better expose the (new) functionalities of libzim, and avoid potential mistake.
The main idea is to stop provide a somehow unique method
addArticle
and have all the specific article handling in theArticle
class (that the user need to implement).addMetadata(name, content)
addRedirect(target, url, title)
addArticle
.Article
interface would be adapted :isRedirect
,isLinkTarget
,isDeleted
norgetRedirectUrl
.shouldCompress
(inferred from the mimetype)shouldIndex
(infered from thegetIndexData
and the article's hint)getIndexData
. The user code would have to provide a content to index (potentially different from the data to store).getHint
return a set of hints for the creator. This hint could be used by the creator to take better decision about the article. Hint could be if the article is chrome articles (css/js), if it should be compressed or not (despite of its mimetype), ...While the creator will need a object fulfilling an
Article
interface, libzim will provide a basic implementation of the interface to simplify user code. For specific usage, one would still be able to implement the interface.This issue is about the API of the writer only. This doesn't include a change in the format of the zim file.
The text was updated successfully, but these errors were encountered: