Skip to content

Conversation

yunhailuo
Copy link
Contributor

In general, there are 3 parts:

  1. xhtml filename for chapters are messed up.
    This is because asciidoctor assume a chapter title is level-0 heading while it is actually level-1 in ProGit for now. Instead of changing ProGit chapter title to level-1, I instructed a change of leveloffset in the spine "progit.asc". Besides, chapter 4, 9 and the three appendix chapters don't have a explicit ID declaration. I added based on the title (it seems asciidoctor won't do automatic ID generation for level-1 chapter title). To be clear, the current status actually doesn't follow asciidoctor-epubs rule 1 (main chapter files being under the root directory) and rule 2 (chapter title being level-0 and ID matching filename).

  2. Cross reference breaks
    asciidoctor requires cross references follow the format <<chapter-id#chapter-id or section id>> while ProGit has <> for now. This leads to "invalid reference to unknown local anchor (or valid bibref)" errors from asciidoctor-epubs and "Fragment identifier is not defined" from epub validator. All xrefs should have been fixed.

  3. ID collisions
    Asciidoctor automatically creates an anchor for every section and discrete heading. These anchors may be the same as the one explicitly declared. There are three cases: "_git_p4" in client-p4.asc, "_task_lists" in 2-contributing.asc and "_audit_log" in 4-managing-organization.

asciidoctor-epubs fix its own bug recently. To make things work, I used "1.5.0.alpha.8.dev" instead of any releases. As I tested myself, the epub generated from "1.5.0.alpha.8.dev" should be able to pass EPUB Validator and should be able to be loaded onto Google Books.

Asciidoctor automatically creates an anchor "_git_p4"for the "Git-p4"
section in client-p4.asc which is the same as the anchor explicitly
defined in import-p4.asc. This is the same case for "_task_lists" in
2-contributing.asc and "_audit_log" in 4-managing-organization.
http://asciidoctor.org/docs/user-manual/#automatic-anchors
@yunhailuo yunhailuo mentioned this pull request Dec 10, 2017
@ben
Copy link
Member

ben commented Dec 11, 2017

Wow, this was clearly a lot of work. Thanks!

@ben ben merged commit 668cc83 into progit:master Dec 11, 2017
@yunhailuo
Copy link
Contributor Author

You are welcome! Glad to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants