sbsdev / pipeline-mod-sbs

SBS specific modules for the DAISY Pipeline 2
0 stars 0 forks source link

Test pageref class #60

Closed bertfrees closed 6 years ago

bertfrees commented 7 years ago

@mixa72 Have you tested this already? When I try to convert one of your example books (nonfiction_natur.xml) I get a "target-counter(page) referencing inline elements not supported" error.

The example looks like this:

<dtbook xml:lang="de" xmlns="http://www.daisy.org/z3986/2005/dtbook/">
  <book>
    <frontmatter>
      ...
      <p>Zeichnungen ab Seite <a class="pageref" href="#p-81">81</a></p>
      ...
    </frontmatter>
    <bodymatter>
      ...
      <pagenum id="page-81" page="normal">81</pagenum>
      <a id="p-81"/>
      <h2>Die Heilmittel</h2>
      ...
    </bodymatter>
  </book>
</dtbook>

Is this the typical usage of the class?

bertfrees commented 7 years ago

The following CSS snippet seems to fix it:

a:empty {
   display: none;
}
mixa72 commented 7 years ago

I've only tested fiction_engel.xml, fiction_haus.xml and nonfiction_vegeta.xml. The same markup is also used in nonfiction_vegeta.xml and you will probably get the same error there. As for the class: yes, this is a typical usage of "pageref" together with a reference to a print page number. In the large print the content of the element <a class="pageref" href="#p-...">...</a> is ignored and replaced with the page number (large print) of the corresponding anchor. In ebooks the class has no special effect (in other words <a class="pageref" href="#p-...">...</a> behaves like a normal hyperlink). Great that you already found a css fix!

mixa72 commented 7 years ago

When I try to upload nonfiction_vegeta.xml I get "An error occured when trying to post job". What do I have to change in the file?

bertfrees commented 7 years ago

I tried it too and worked fine for me.

mixa72 commented 7 years ago

And you used exactly the file I sent you or did you remove some mark-up, perhaps?

bertfrees commented 7 years ago

Yes the exact same file.

bertfrees commented 7 years ago

@mixa72 The example DTBook "nonfiction_vegeta.xml" has the following page reference:

(siehe Foto Seite <a class="pageref" href="#p-7"><brl:emph class="ss">7</brl:emph></a>)

The p-7 anchor is in the frontmatter. How should this be handled? We don't number pages in the frontmatter.

mixa72 commented 7 years ago

That's a good question. Note that this is an absolute corner case. Taking a look at the print version of the book revealed that page 7 does not "officially" exist (the reference points to a region without page numbers right after the toc and before the beginning of the first chapter). In our current system the above solution works for both large print and braille: in large print the page reference is replaced with the page number of the newly generated large print "siehe Foto Seite vii", in braille it only shows the original page number "S0HE FOTO S3( _#G". As the new system supports the replacement of page references in braille as well, we either need a "passepartout" text in the reference or simply a warning message to notify the transcriber that there is a page reference pointing to the frontmatter so that he/she can textually adjust the corresponding reference. I guess I would prefer a warning.

bertfrees commented 7 years ago

I have implemented the warning, moving back to Done.

mixa72 commented 6 years ago

The corresponding message in the log file seems to be: Ignoring 'target-counter(url("#p-7"), page)': referencing element in named flow.

That's good so far. When introducing the new pipeline we should probably reduce the huge number of appearing messages and/or prioritize them. A lot of them are not relevant to the user.