Download EpubReader/Source/VersOne.Epub.ConsoleDemo/PrintNavigation.cs from dlxjj/LediReader: direct link, hf CLI and curl.
- Browser
- Download file 1 kB
-
https://huggingface.co/datasets/dlxjj/LediReader/resolve/main/EpubReader/Source/VersOne.Epub.ConsoleDemo/PrintNavigation.cs
- Command line
-
hf download hf://datasets/dlxjj/LediReader/EpubReader/Source/VersOne.Epub.ConsoleDemo/PrintNavigation.cs
-
curl -L -o PrintNavigation.cs https://huggingface.co/datasets/dlxjj/LediReader/resolve/main/EpubReader/Source/VersOne.Epub.ConsoleDemo/PrintNavigation.cs
1 kB
| using System; | |
| namespace VersOne.Epub.ConsoleDemo | |
| { | |
| internal static class PrintNavigation | |
| { | |
| public static void Run(string filePath) | |
| { | |
| using (EpubBookRef bookRef = EpubReader.OpenBook(filePath)) | |
| { | |
| Console.WriteLine("Navigation:"); | |
| foreach (EpubNavigationItemRef navigationItemRef in bookRef.GetNavigation()) | |
| { | |
| PrintNavigationItem(navigationItemRef, 0); | |
| } | |
| } | |
| Console.WriteLine(); | |
| } | |
| private static void PrintNavigationItem(EpubNavigationItemRef navigationItemRef, int identLevel) | |
| { | |
| Console.Write(new string(' ', identLevel * 2)); | |
| Console.WriteLine(navigationItemRef.Title); | |
| foreach (EpubNavigationItemRef nestedNavigationItemRef in navigationItemRef.NestedItems) | |
| { | |
| PrintNavigationItem(nestedNavigationItemRef, identLevel + 1); | |
| } | |
| } | |
| } | |
| } | |