Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New libzim writer API #364

Closed
mgautierfr opened this issue Jul 9, 2020 · 1 comment
Closed

New libzim writer API #364

mgautierfr opened this issue Jul 9, 2020 · 1 comment
Assignees
Milestone

Comments

@mgautierfr
Copy link
Collaborator

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.

@mgautierfr
Copy link
Collaborator Author

Closed by #402

@kelson42 kelson42 closed this as completed Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants