Skip to content

Writer should allow to create _adhoc_ Xapian Title index entries #1049

@kelson42

Description

@kelson42

Since years already, but the tendency gets stronger, we publish ZIM files which work like a single Web Page application. Based on a heavy usage of Javascript and Vue.js, these ZIM files (and their correspongins scrapers) are significantly different from traditional ones:

  • One article is not one HTML page
  • Only one page and lots of json based resources load dynamically
  • Not so many real HTML links A DOM nodes
  • Everything is loaded dynamically via Javascript calls

This leads to many challenges, but the most important one been the following:

For the moment, the solution (I should write the "workaround") is to create an HTML redirection for each entry we want to appear in the suggestions. But these has a few disadvantages:

  • This creates an additional round-trip between the ZIM and the browser and this creates a bad UX (slow and visual flash effect)
  • This can create millions of "heavy" entries in the ZIM files
  • This slows down the ZIM writting process.

A better solution, would be to have ZIM redirections handling the URL fragment as well. See #1001. Unfortunately this is not that easy and actually I believe not even the best solution, because this is not really what we need. We don't need a new article to which an page can link (with fragment) to. What we need is to be able to have suggestions supporting URL fragments... and we need all the suggestions pointing to the same page (remember: single page application).

What I propose is to:

  • Be able to add entries in the Xapian Title index, independently of any new ZIM entry
  • Add support of URL fragements to the Xapian Title index.

It could take the form of a something like:
zim::writer::Creator::addSuggestion(const std::string &path, const std::string &title, const std::string &fragment)

In term of feature introduction, this should be considered:

  • This would need no change at reader side, beside having the latest ZIM library (to support URL fragments, so I guess older reader will just don't handle the fragment)
  • Once the feature implemented we can immediatly release and use it to create ZIM file
  • Probably a ZIM format number minor incrementation
  • We should implement the feature quickly and start only to release ZIM file with it, once all the readers have been released using the latest ZIM library (will take a bit)

My proposal has a drawback. Only readers supporting the Xapian indexes will be able to fully enjoy the ZIM files using this feature.

This proposal does not compete with #1001, this is two different things (but yes, a bit of overlapping topic)

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions