Xteink-X4-crosspoint-reader/lib
Pavel Liashkov 0332e1103a
Add EPUB 3 nav.xhtml TOC support (#197)
## Summary

* **What is the goal of this PR?** Add EPUB 3 support by implementing
native navigation document (nav.xhtml) parsing with NCX fallback,
addressing issue Fixes: #143.

  * **What changes are included?**
- New `TocNavParser` for parsing EPUB 3 HTML5 navigation documents
(`<nav epub:type="toc">`)
- Detection of nav documents via `properties="nav"` attribute in OPF
manifest
- Fallback logic: try EPUB 3 nav first, fall back to NCX (EPUB 2) if
unavailable
- Graceful degradation: books without any TOC now load with a warning
instead of failing

  ## Additional Context

* The implementation follows the existing streaming XML parser pattern
using Expat to minimize RAM usage on the ESP32-C3
* EPUB 3 books that include both nav.xhtml and toc.ncx will prefer the
nav document (per EPUB 3 spec recommendation)
* No breaking changes - existing EPUB 2 books continue to work as before
* Tested on examples from
https://idpf.github.io/epub3-samples/30/samples.html
2026-01-03 19:10:35 +11:00
..
EpdFont Use sane smaller data types for data in section.bin (#188) 2025-12-31 13:11:36 +11:00
Epub Add EPUB 3 nav.xhtml TOC support (#197) 2026-01-03 19:10:35 +11:00
expat Add expat and swap out EPUB HTML parser (#2) 2025-12-06 20:57:24 +11:00
FsHelpers Add exFAT support (#150) 2025-12-30 16:09:30 +11:00
GfxRenderer Use sane smaller data types for data in section.bin (#188) 2025-12-31 13:11:36 +11:00
JpegToBmpConverter Add exFAT support (#150) 2025-12-30 16:09:30 +11:00
miniz Stream inflated EPUB HTMLs down to disk instead of inflating in memory (#4) 2025-12-08 00:39:17 +11:00
picojpeg Add JPG image support (#23) 2025-12-21 17:15:17 +11:00
Serialization Add exFAT support (#150) 2025-12-30 16:09:30 +11:00
Utf8 Public release 2025-12-03 22:06:45 +11:00
Xtc Add exFAT support (#150) 2025-12-30 16:09:30 +11:00
ZipFile Add exFAT support (#150) 2025-12-30 16:09:30 +11:00
README Public release 2025-12-03 22:06:45 +11:00

This directory is intended for project specific (private) libraries.
PlatformIO will compile them to static libraries and link into the executable file.

The source code of each library should be placed in a separate directory
("lib/your_library_name/[Code]").

For example, see the structure of the following example libraries `Foo` and `Bar`:

|--lib
|  |
|  |--Bar
|  |  |--docs
|  |  |--examples
|  |  |--src
|  |     |- Bar.c
|  |     |- Bar.h
|  |  |- library.json (optional. for custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
|  |
|  |--Foo
|  |  |- Foo.c
|  |  |- Foo.h
|  |
|  |- README --> THIS FILE
|
|- platformio.ini
|--src
   |- main.c

Example contents of `src/main.c` using Foo and Bar:
```
#include <Foo.h>
#include <Bar.h>

int main (void)
{
  ...
}

```

The PlatformIO Library Dependency Finder will find automatically dependent
libraries by scanning project source files.

More information about PlatformIO Library Dependency Finder
- https://docs.platformio.org/page/librarymanager/ldf.html