Unify books_dir into the existing ~/hero/var/books/ library tree #46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The system currently maintains two separate locations for book data:
books_dir(CLI--books-dir, defaults to.) — flat TOML files with__namespace prefix (e.g.geomind__nitrograph.toml)~/hero/var/books/— persistent library tree where exports go (rendered HTML, PDFs,book.json, collections,.ai/metadata)This split means:
__prefix convention is non-obviousbooks_dirdefaults to.which is error-proneSolution: Complete the Existing Library Tree
The
~/hero/var/books/{library}/structure (implemented inlibrary.rs) already organizes exports, collections, and metadata per library. The fix is to move book TOMLs into this same tree, eliminating the separatebooks_dir.Final unified structure
Why this structure
library.tomlanddoctree.tomlsit at the library root — metadata about the library, not mixed with individual booksbook.tomllives alongside its output (book.json,content/,img/) — source and output together per book__prefix convention — namespace is the parent directoryls ~/hero/var/books/shows everything deployedlibrary.rsalready implements this directory layout, we just addbook.tomlplacementImplementation
--books-dirCLI flag with--libraries-dir(default~/hero/var/books/), env varHERO_BOOKS_LIBRARIES_DIRBooksScannerto scan{library}/books/{book}/book.tomlrecursively instead of flat*.tomlexport_books_for_serving()to write output alongsidebook.toml(already mostly does this){library}/books/{book_name}/book.tomlmake demo/make devcopy example TOMLs fromexamples/into the library treedocs/manual/to reflect the unified structurebooks_dirlayouts and log a warning with migration instructionsNotes
examples/ebooks_localandexamples/ebooks_gitremain as dev-time seed data, copied into the library tree on startuplibrary.rshelper functions (library_book_dir(),ensure_library_dirs(), etc.) already support this layoutexport_dirconcept inServerConfigbecomes redundant — remove it and always uselibraries_base_dir()~/hero/code/{server}/{account}/{repo}/— never mixed with~/hero/var/books/Default books_dir to ~/hero/var/hero_books/books/ per hero ecosystem conventionsto Unify books_dir and export_dir into a single libraries/ directory treeUnify books_dir and export_dir into a single libraries/ directory treeto Unify books_dir into the existing ~/hero/var/books/ library tree