diff --git a/include/zim/writer/creator.h b/include/zim/writer/creator.h index f61f7c661..60d1c546f 100644 --- a/include/zim/writer/creator.h +++ b/include/zim/writer/creator.h @@ -197,7 +197,26 @@ namespace zim /** + * Add a clone of a existing entry. * + * The existing entry pointed by `targetPath` is cloned and updated with + * `path` and `title`. + * + * The clone entry will shared the same type (redirection or item) + * and namespace than `targetPath`. + * + * If the `targetPath` is a item, the new entry will be item pointing + * to the same data than `targetPath` item. (Not a redirection to `targetPath`). + * However, the cloned entry is not counted in the media type counter + * and it is not fulltext indexed (only title indexed). + * + * Hints can be given to influence creator handling (front article, ...) + * as it is done for redirection. + * + * @param path the path of the clone + * @param title the title of the clone + * @param targetPath the path of the cloned entry. + * @param hints hints associated to the clone. */ void addClone( const std::string& path, diff --git a/src/writer/_dirent.h b/src/writer/_dirent.h index 80eafba96..548ee80b6 100644 --- a/src/writer/_dirent.h +++ b/src/writer/_dirent.h @@ -169,7 +169,7 @@ namespace zim // Creator for a "redirection" dirent Dirent(NS ns, const std::string& path, const std::string& title, NS targetNs, const std::string& targetPath); - // Creator for a "clone" dirent + // Creator for a "clone" dirent. Reuse the namespace of the targeted Dirent. Dirent(const std::string& path, const std::string& title, const Dirent& target); // Creator for "temporary" dirent, used to search for dirent in container. diff --git a/src/writer/creator.cpp b/src/writer/creator.cpp index 2746c8707..d38621624 100644 --- a/src/writer/creator.cpp +++ b/src/writer/creator.cpp @@ -214,7 +214,7 @@ namespace zim if (existing_dirent_it == data->dirents.end()) { std::ostringstream ss; - ss << "Impossible to clone C/" << targetPath << " to " << path << std::endl; + ss << "Impossible to clone C/" << targetPath << " to C/" << path << std::endl; ss << "C/" << targetPath << " doesn't exist." << std::endl; throw InvalidEntry(ss.str()); }