Beispiel #1
0
 public async Task <IEnumerable <NavigationPoint> > ExtractEpub3NavigationPoints(
     EpubStructure structure, IEnumerable <ManifestItem> manifestItems, IEnumerable <File> files)
 {
     return(xHtmlNavigationExtractor.ExtractNavigationPoints(
                await xHtmlTocLoader.LoadXHtmlToc(manifestItems, structure.Opf.Path, files).ConfigureAwait(false),
                files));
 }
Beispiel #2
0
        public Task <IEnumerable <NavigationPoint> > ExtractNavigationPoints(
            EpubStructure structure, IEnumerable <File> files)
        {
            var manifestItems = manifestExtractor.ExtractManifestItems(structure.Opf);

            return(manifestItems.Any(
                       item => OpfXmlNames.NavPropertiesAttributeValue.EqualsIgnoreCaseWithNull(item.Properties))
                ? ExtractEpub3NavigationPoints(structure, manifestItems, files)
                : ExtractEpub2NavigationPoints(structure, manifestItems, files));
        }
Beispiel #3
0
        public async Task <BookBuilder> CreateBuilder(EpubStructure structure)
        {
            var builder       = new BookBuilder();
            var manifestItems = manifestExtractor.ExtractManifestItems(structure.Opf);
            var meta          = metaExtractor.ExtractMeta(structure.Opf);
            var files         = await fileExtractor.ExtractFiles(structure.Opf, manifestItems, structure.Zip).ConfigureAwait(false);

            var navigationPoints = await navigationExtractor.ExtractNavigationPoints(structure, files).ConfigureAwait(false);

            builder.ReadFromMeta(meta);
            builder.NavigationPoints = navigationPoints.ToList();
            builder.Files            = files.ToList();
            return(builder);
        }