sbsdev / dtbook2sbsform

Convert DTBook to SBSForm, an intermediate format to produce formatted braille
GNU Lesser General Public License v3.0
1 stars 0 forks source link

Page numbers are missing #18

Closed egli closed 1 year ago

egli commented 1 year ago

Given the following DTBook:

<level1>
  <p>bla</p>
  <pagenum id="page-76" page="normal">76</pagenum>
  <p>bla</p>
  <brl:volume brl:grade="2"/>
  <level2>
    <pagenum id="page-77" page="normal">77</pagenum>
    <p>bla</p>
  </level2>
</level1>

we get the following correct output:

y LEVEL1b
.xNOPAGENUM

y P
 BLA
j 76

y P
 BLA
y EndVol
p

j 77
y BrlVol

y LEVEL2b

y P
 BLA
y LEVEL2e

y LEVEL1e       

But given the following input:

<level1>
  <p>bla</p>
  <pagenum id="page-76" page="normal">76</pagenum>
  <p>bla</p>
  <brl:volume brl:grade="2"/>
  <level2>
    <p>bla</p>                                      <-- Text vor pagenum
    <pagenum id="page-77" page="normal">77</pagenum>
    <p>bla</p>
  </level2>
</level1>

we get the following actual wrong output:

y LEVEL1b
.xNOPAGENUM

y P
 BLA
j 76

y P
 BLA
y EndVol
y BrlVol

y LEVEL2b
.xNOPAGENUM

y P
 BLA
y P
 BLA
y LEVEL2e

y LEVEL1e   

we expect the following:

y LEVEL1b
.xNOPAGENUM

y P
 BLA
j 76

y P
 BLA
y EndVol
y BrlVol

y LEVEL2b
.xNOPAGENUM

y P
 BLA
j 77          <-- Seitenzahl muss hier stehen
y P
 BLA
y LEVEL2e

y LEVEL1e   

We'll probably have to change https://github.com/sbsdev/dtbook2sbsform/blob/master/xsl/dtbook2sbsform.xsl#L943 http://redmine.sbszh.ch/issues/3006 Moving the page numbers before the volume as in the following example

y EndVol
p

j 77
y BrlVol

is only wanted if pagenum is the first element in new level of the new volume. If there is any text before then handle the page number then handle it just as above and do not omit it.

See also http://redmine.sbszh.ch/issues/3006