This is preview!
Consider using a Static Site Generator. (I like Middleman). SSGs give you all the tools of a server language/template system, but at "build" time, rather than at run-time."But for this particular site my goal is to make it useable entirely without a server as well, i.e. via "file://" protocol locally."
"Also, I need to think about carefully differentiating between embedded annotations (i.e. readonly part of the main book module) and user-defined (i.e. potentially shared) annotations --- I suppose for just this function I'll have to write some PHP code interacting with a database on the server and this function will be missing when used via "file://" protocol."
"Btw, I consider duplication of simple text strings not such a bad issue as a duplication of serious code (or site structure in html) would be."