1234567891011121314151617181920(*****************************************************************************)(* *)(* Copyright (C) 2024 Yves Ndiaye *)(* *)(* This Source Code Form is subject to the terms of the Mozilla Public *)(* License, v. 2.0. If a copy of the MPL was not distributed with this *)(* file, You can obtain one at https://mozilla.org/MPL/2.0/. *)(* *)(*****************************************************************************)typet={handler:Zip.in_file;files:stringlist}letresolve_path_relative~fileepubfilename=lettoc=List.find(String.ends_with~suffix:file)epub.filesinlettoc=toc|>Util.Path.of_string|>Util.Path.popinletfilename=Util.Path.concattoc(Util.Path.of_stringfilename)infilename|>Util.Path.reduce|>Util.Path.to_stringletresolve_path_relative_to_toc=resolve_path_relative~file:"toc.ncx"letresolve_path_relative_to_opf=resolve_path_relative~file:"content.opf"