Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix endnotes issue #561

Merged
merged 6 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions client/src/main/java/org/daisy/validator/EPUBFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -608,4 +608,12 @@ public Guideline getGuideline() {
public File getSchemaDir() {
return schemaDir;
}

public File getEpubDir() {
return epubDir;
}

public String getPackageFile() {
return this.packageOBF;
}
}
65 changes: 65 additions & 0 deletions client/src/test/java/TestValid.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,71 @@ public void testOPF() throws Exception {
assertEquals(0, issues.size());
}

@Test
public void testOPFAndHTML() throws Exception {
File tmpFile = File.createTempFile("TestOPFAndHTML", ".xml");
FileOutputStream fos = new FileOutputStream(tmpFile);
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fos, "UTF-8"));
bw.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
bw.newLine();
bw.write("<wrapper xmlns:html=\"http://www.w3.org/1999/xhtml\" xmlns:opf=\"http://www.idpf.org/2007/opf\">");
bw.newLine();
Util.appendXML(bw,
new FileInputStream(new File("src/test/resources/valid2020", "EPUB/package.opf"))
);
bw.newLine();

List<String> list = List.of(
"C00000-01-cover.xhtml",
"C00000-02-toc.xhtml",
"C00000-03-frontmatter.xhtml",
"C00000-04-chapter.xhtml",
"C00000-05-chapter.xhtml",
"C00000-06-chapter.xhtml",
"C00000-07-rearnotes.xhtml",
"C00000-08-chapter.xhtml",
"C00000-09-part.xhtml",
"C00000-10-chapter.xhtml",
"C00000-11-conclusion.xhtml",
"C00000-12-toc.xhtml",
"C00000-13-part.xhtml",
"C00000-14-chapter.xhtml",
"C00000-15-chapter.xhtml",
"C00000-16-part.xhtml",
"C00000-17-chapter.xhtml"
);

for (String contentFile : list) {
Util.appendXML(bw,
new FileInputStream(new File("src/test/resources/valid2020/EPUB", contentFile))
);
bw.newLine();
bw.flush();
}
bw.write("</wrapper>");
bw.flush();
bw.close();

Guideline guideline = new Guideline2020();

TransformFile tf = new TransformFile(
tmpFile.getParentFile(),
tmpFile.getName(),
new File("src/main/resources/2020-1", guideline.getSchema(Guideline.OPF_AND_HTML).getFilename()),
Guideline.OPF_AND_HTML,
false
);
Set<Issue> issues = new HashSet<>();
issues.addAll(tf.call());

for(Issue i : issues) {
System.out.println(i.getDescription());
}

assertEquals(0, issues.size());

}

@Test
public void testCoverPNG_OPF() throws Exception {
Guideline guideline = new Guideline2020();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:nordic="http://www.mtm.se/epub/" xml:lang="en" lang="en" epub:prefix="z3998: http://www.daisy.org/z3998/2012/vocab/structure/#">
<head>
<meta charset="UTF-8"/>
<title>Valentin Haüy - the father of the education for the blind</title>
<title>Valentin Haüy</title>
<meta content="C00000" name="dc:identifier"/>
<meta name="viewport" content="width=device-width"/>
<link rel="stylesheet" type="text/css" href="css/accessibility.css"/>
Expand Down
4 changes: 2 additions & 2 deletions client/src/test/resources/valid2020/EPUB/C00000-02-toc.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:nordic="http://www.mtm.se/epub/" xml:lang="en" lang="en" epub:prefix="z3998: http://www.daisy.org/z3998/2012/vocab/structure/#">
<head>
<meta charset="UTF-8"/>
<title>Valentin Haüy - the father of the education for the blind</title>
<title>Valentin Haüy</title>
<meta content="C00000" name="dc:identifier"/>
<meta name="viewport" content="width=device-width"/>
<link rel="stylesheet" type="text/css" href="css/accessibility.css"/>
</head>
<body>
<section epub:type="frontmatter toc" id="toc_body" role="doc-toc">
<div role="doc-pagebreak" id="page_3" class="page-front" epub:type="pagebreak" title="iii"></div>
<div role="doc-pagebreak" id="page_front_3" class="page-front" epub:type="pagebreak" aria-label="iii"></div>
<h1>Table of contents</h1>
<ol>
<li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:nordic="http://www.mtm.se/epub/">
<head>
<meta charset="UTF-8" />
<title>Valentin Haüy - the father of the education for the blind</title>
<title>Valentin Haüy</title>
<meta content="C00000" name="dc:identifier" />
<meta name="viewport" content="width=device-width" />
<style type="text/css" xml:space="preserve">
Expand Down Expand Up @@ -473,10 +473,10 @@
</tr>
</tbody>
</table>
<div id="page_4" class="page-front" epub:type="pagebreak" title="iv"></div>
<div epub:type="pagebreak" role="doc-pagebreak" class="page-front" id="page-vii" aria-label="vii"></div>
<div id="page_front_4" class="page-front" epub:type="pagebreak" aria-label="iv"></div>
<div epub:type="pagebreak" role="doc-pagebreak" class="page-front" id="page_front_7" aria-label="vii"></div>
<p>
<span epub:type="pagebreak" role="doc-pagebreak" class="page-front" id="page-viii" aria-label="viii"></span>
<span epub:type="pagebreak" role="doc-pagebreak" class="page-front" id="page_front_8" aria-label="viii"></span>
</p>
</section>
<section id="d910e617">
Expand Down Expand Up @@ -513,7 +513,7 @@
<p>
<span id="dtb125">Beatrice Christensen-Sköld</span>
</p>
<div id="page_front_5" class="page-front" epub:type="pagebreak" title="v"></div>
<div id="page_front_5" class="page-front" epub:type="pagebreak" aria-label="v"></div>
</section>
</section>
</body>
Expand Down
11 changes: 4 additions & 7 deletions client/src/test/resources/valid2020/EPUB/C00000-04-chapter.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:nordic="http://www.mtm.se/epub/">
<head>
<meta charset="UTF-8" />
<title>Valentin Haüy - the father of the education for the blind</title>
<title>Valentin Haüy</title>
<meta content="C00000" name="dc:identifier" />
<meta name="viewport" content="width=device-width" />
<meta name="a11y:certifiedBy" content="Certifying Organization"/>
Expand Down Expand Up @@ -111,9 +111,6 @@
</head>
<body>
<section id="d910e694" epub:type="bodymatter chapter">
<div id="page_5" class="page-normal" epub:type="pagebreak" aria-label="5"></div>
<div id="page_6" class="page-normal" epub:type="pagebreak" aria-label="6"></div>
<div id="page_7" class="page-normal" epub:type="pagebreak" aria-label="7"></div>
<h1 id="d910e696">1. Research questions</h1>
<pre><code>
public static void main(String[] args) {
Expand All @@ -135,13 +132,13 @@
</p>
<p><em>En fullständig lista över titlar utgivna i FOKK-serien finns på: <a href="http://www.kkrva.se/?page_id=715">http://www.kkrva.se/?page_id=715</a></em></p>

<aside id="dtb6" class="text-box">
<aside id="dtbt6" class="text-box">
<p epub:type="bridgehead">Header information</p>
<p>
<span id="dtb8">Modifications have been done primarily to the footnotes, which in the original version used inline parentheses, and in this version use a noteref-endnote system.</span>
<span id="dtbt7">Modifications have been done primarily to the footnotes, which in the original version used inline parentheses, and in this version use a noteref-endnote system.</span>
</p>
<p>
<span id="dtb8">Modifications have been done primarily to the footnotes, which in the original version used inline parentheses, and in this version use a noteref-endnote system.</span>
<span id="dtbt8">Modifications have been done primarily to the footnotes, which in the original version used inline parentheses, and in this version use a noteref-endnote system.</span>
</p>
</aside>

Expand Down
14 changes: 7 additions & 7 deletions client/src/test/resources/valid2020/EPUB/C00000-05-chapter.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:nordic="http://www.mtm.se/epub/">
<head>
<meta charset="UTF-8" />
<title>Valentin Haüy - the father of the education for the blind</title>
<title>Valentin Haüy</title>
<meta content="C00000" name="dc:identifier" />
<meta name="viewport" content="width=device-width" />
<style type="text/css" xml:space="preserve">
Expand Down Expand Up @@ -125,7 +125,7 @@
<span id="dtb148">The researcher pieces together, in a manner of speaking, a mosaic from the fragments he manages to find. </span>
<span id="d910e810">
<span id="dtb149">These remains and traces may be many and varied; in the case of Haüy, they are mainly written sources </span>
<a id="dtb150" epub:type="noteref" class="noteref" href="C00000-12-footnotes.xhtml#fn_1">1</a>
<a id="dtb150" epub:type="noteref" class="noteref" href="C00000-07-rearnotes.xhtml#fn_1">1</a>
<span id="dtb151">.</span>
</span>
</p>
Expand All @@ -135,21 +135,21 @@
<span id="d910e831">
<span id="dtb154">When writing a biography, one should make use of material which directly or indirectly, in part or completely provides information about the life of one or several
people </span>
<a id="dtb155" epub:type="noteref" class="noteref" href="C00000-12-footnotes.xhtml#fn_2">2</a>
<a id="dtb155" epub:type="noteref" class="noteref" href="C00000-07-rearnotes.xhtml#fn_2">2</a>
<span id="dtb156">. </span>
</span>
<span id="dtb157">This may or may not be written material. </span>
<span id="dtb158">Written material produced by the investigated person himself or herself is, according to Engström, "first-person documentation," while material about the person
investigated is "third-person documentation". </span>
<span id="d910e850">
<span id="dtb159">The lack of first-hand sources naturally means that the validity of this type of documentation is questionable </span>
<a id="dtb160" epub:type="noteref" class="noteref" href="C00000-12-footnotes.xhtml#fn_3">3</a>
<a id="dtb160" epub:type="noteref" class="noteref" href="C00000-07-rearnotes.xhtml#fn_3">3</a>
<span id="dtb161">. </span>
</span>
<span id="dtb162">However, some of the documentation I have used does in fact quote from first-hand sources or "first-person documents". </span>
<span id="dtb163">To judge from the literature available on the subject, I am one of the very few (if not the only) researchers who have used Skrébitsky as a source.</span>
</p>
<div id="page_6" class="page-normal" epub:type="pagebreak" title="6"></div>
<div id="page_6" class="page-normal" epub:type="pagebreak" aria-label="6"></div>
<p>
<span id="dtb164">I did have access to a single first-hand source - the information I use to describe Haüy's pedagogical methods was, in part, gleaned from his own Essai sur l'Education
des Aveugles.</span>
Expand Down Expand Up @@ -185,7 +185,7 @@
<span id="dtb180">There was, for example, a box full of documents dating from the period 1807-1809, but only a few documents from the latter part of Haüy's stay in Russia. </span>
<span id="d910e939">
<span id="dtb181">Skrébitsky managed to smuggle the box out of Russia and donated it to the Valentin Haüy Museum in Paris where it is still kept </span>
<a id="dtb182" epub:type="noteref" class="noteref" href="C00000-12-footnotes.xhtml#fn_4">4</a>
<a id="dtb182" epub:type="noteref" class="noteref" href="C00000-07-rearnotes.xhtml#fn_4">4</a>
<span id="dtb183">. </span>
</span>
<span id="dtb184">I have been able to ascertain that this information is correct, but have not had the opportunity to consult these documents personally. </span>
Expand All @@ -202,7 +202,7 @@
<span id="dtb191">She is the only researcher to have made use of the minutes kept by the various revolutionary committees in Paris during the 1790s. </span>
<span id="dtb192">She does not, however, write about Haüy's years in Russia.</span>
</p>
<div id="page_7" class="page-normal" epub:type="pagebreak" title="7"></div>
<div id="page_7" class="page-normal" epub:type="pagebreak" aria-label="7"></div>
<p>
<span id="dtb193">To illustrate Haüy's influence on the development of education for the blind in other countries, I have chosen D.G. </span>
<span id="dtb194">Pritchard's Education and the Handicapped 1760-1960 (1963) as my main source since it is considered a standard work. </span>
Expand Down
Loading