Skip to content

Commit

Permalink
Merge pull request #104 from ndw/fix-purl
Browse files Browse the repository at this point in the history
Fix purl
  • Loading branch information
ndw authored May 12, 2021
2 parents 6c7caf0 + fc28f12 commit 5801e23
Show file tree
Hide file tree
Showing 530 changed files with 554 additions and 535 deletions.
29 changes: 23 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,9 @@ fileTree(dir: "${projectDir}/src/test/generators").each { xsl ->
}

// Generate tasks to format each resource/xml document
fileTree(dir: "${projectDir}/src/test/resources/xml", include: "*.xml").each { xml ->
fileTree(dir: "${projectDir}/src/test/resources/xml",
include: "*.xml",
exclude: "tran-caution.xml").each { xml ->
// Work out the base filename of the test
def base = xml.toString()
def pos = base.indexOf("/resources/xml/")
Expand Down Expand Up @@ -728,13 +730,28 @@ fileTree(dir: "${projectDir}/src/test/resources/xml", include: "*.xml").each { x
// This won't pass validation...
htmlDependsOn = ['makeXslt']
} else {
t = task "validate_${base}"(type: JavaExec) {
classpath = configurations.validateRuntime
main = "com.thaiopensource.relaxng.util.Driver"
args "-i", "${buildDir}/${schema}", xml.toString()
t = task "validate_${base}"() {
inputs.file xml
inputs.file "${buildDir}/${schema}"
outputs.file "${buildDir}/validated/${base}"

if (base.contains("transclusion")) {
dependsOn setup_transclusion
}

doLast {
javaexec {
classpath = configurations.validateRuntime
main = "com.thaiopensource.relaxng.util.Driver"
args "-i", "${buildDir}/${schema}", xml.toString()
}
}

doLast {
new File("${buildDir}/validated/${base}").withWriter("utf-8") { writer ->
writer.writeLine("validated")
}
}
}
t.dependsOn tasks.findByName("setup_${schemaPath}")
validateAll.dependsOn t
Expand Down Expand Up @@ -791,7 +808,7 @@ fileTree(dir: "${projectDir}/src/test/resources/xml", include: "*.xml").each { x

t = task "${base}.olinkdb"(type: SaxonXsltTask, dependsOn: htmlDependsOn) {
inputs.files fileTree(dir: "${projectDir}/src/main/xslt")
inputs.files fileTree(dir: "${projectDir}/src/test/resources")
inputs.files fileTree(dir: "${projectDir}/src/test/resources", exclude: "expected")
inputs.file file("${buildDir}/xslt/olinkdb.xsl")

pluginConfiguration "docbook"
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// See also properties.gradle

org.gradle.jvmargs=-Xmx4096m
org.gradle.jvmargs=-Xmx16384m
org.gradle.parallel=true
org.gradle.workers.max=3
//org.gradle.daemon=false

verbose=false
Expand Down
2 changes: 1 addition & 1 deletion src/main/xslt/modules/head.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<xsl:variable name="Z" select="xs:dayTimeDuration('PT0H')"/>

<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="schema.dc" href="http://purl.org/dc/elements/1.1/"/>
<link rel="schema.dc" href="https://purl.org/dc/elements/1.1/"/>
<meta name="dc.modified"
content="{format-dateTime(adjust-dateTime-to-timezone(current-dateTime(), $Z),
'[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]Z')}"/>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/expected/JFK_Inaugural.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" class="no-js"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>John F. Kennedy Inaugural Address</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link href="http://purl.org/dc/elements/1.1/" rel="schema.dc"/><meta content="2011-04-22T17:02:00-06:00" name="dc.modified"/><meta content="DocBook xslTNG" name="generator"/><link href="./css/docbook.css" rel="stylesheet"/><link href="./css/docbook-screen.css" rel="stylesheet"/></head><body class="home"><nav class="top"></nav><main><article class="article"><header><h1>John F. Kennedy Inaugural Address</h1></header><div class="dialogue"><header><div class="title">John F. Kennedy Inaugural Address</div></header><div class="linegroup"><div class="speaker"><span class="person"><span class="first-last personname"><span class="honorific">President</span> <span class="firstname">John</span> <span class="othername">F.</span> <span class="surname">Kennedy</span></span></span></div><div class="line">Vice President Johnson, Mr. Speaker, Mr. Chief Justice, President Eisenhower, Vice
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" class="no-js"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>John F. Kennedy Inaugural Address</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link href="https://purl.org/dc/elements/1.1/" rel="schema.dc"/><meta content="2011-04-22T17:02:00-06:00" name="dc.modified"/><meta content="DocBook xslTNG" name="generator"/><link href="./css/docbook.css" rel="stylesheet"/><link href="./css/docbook-screen.css" rel="stylesheet"/></head><body class="home"><nav class="top"></nav><main><article class="article"><header><h1>John F. Kennedy Inaugural Address</h1></header><div class="dialogue"><header><div class="title">John F. Kennedy Inaugural Address</div></header><div class="linegroup"><div class="speaker"><span class="person"><span class="first-last personname"><span class="honorific">President</span> <span class="firstname">John</span> <span class="othername">F.</span> <span class="surname">Kennedy</span></span></span></div><div class="line">Vice President Johnson, Mr. Speaker, Mr. Chief Justice, President Eisenhower, Vice
President Nixon, President Truman, reverend clergy, fellow citizens:</div><div class="line">We observe today not a victory of party, but a celebration of freedom --
symbolizing an end, as well as a beginning -- signifying renewal, as well as change.
For I have sworn before you and Almighty God the same solemn oath our forebears
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/expected/address.001.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" class="no-js"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Article wrapper</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link href="http://purl.org/dc/elements/1.1/" rel="schema.dc"/><meta content="2011-04-22T17:02:00-06:00" name="dc.modified"/><meta content="DocBook xslTNG" name="generator"/><link href="./css/docbook.css" rel="stylesheet"/><link href="./css/docbook-screen.css" rel="stylesheet"/></head><body class="home"><nav class="top"></nav><main><article class="article"><header><h1>Article wrapper</h1></header><p>An address:</p><div class="pre-wrap"><pre class="address verbatim"><span class="first-last personname">Santa Clause</span>
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" class="no-js"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Article wrapper</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link href="https://purl.org/dc/elements/1.1/" rel="schema.dc"/><meta content="2011-04-22T17:02:00-06:00" name="dc.modified"/><meta content="DocBook xslTNG" name="generator"/><link href="./css/docbook.css" rel="stylesheet"/><link href="./css/docbook-screen.css" rel="stylesheet"/></head><body class="home"><nav class="top"></nav><main><article class="article"><header><h1>Article wrapper</h1></header><p>An address:</p><div class="pre-wrap"><pre class="address verbatim"><span class="first-last personname">Santa Clause</span>
<span class="street">1 Main Street</span>
<span class="city">North Pole</span>, <span class="state">AK</span>
<span class="postcode">12345</span>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/expected/admonitions.001.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" class="no-js"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Unit test: admonitions.001</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link href="http://purl.org/dc/elements/1.1/" rel="schema.dc"/><meta content="2011-04-22T17:02:00-06:00" name="dc.modified"/><meta content="DocBook xslTNG" name="generator"/><link href="./css/docbook.css" rel="stylesheet"/><link href="./css/docbook-screen.css" rel="stylesheet"/></head><body class="home"><nav class="top"></nav><main><article class="article"><header><h1>Unit test: admonitions.001</h1></header><p>This test just shows all the admonitions on the same page.</p><div id="note" class="admonition note"><div><div class="icon">🛈︎</div><div class="body"><header><div class="title">Note</div></header><div><p>This note has no title.</p></div></div></div></div><div id="tip" class="admonition tip"><div><div class="icon">☞︎</div><div class="body"><header><div class="title">Tip</div></header><div><p>This tip has no title.</p></div></div></div></div><div id="important" class="admonition important"><div><div class="icon">☝︎</div><div class="body"><header><div class="title">Important</div></header><div><p>This important has no title.</p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit,
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" class="no-js"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Unit test: admonitions.001</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link href="https://purl.org/dc/elements/1.1/" rel="schema.dc"/><meta content="2011-04-22T17:02:00-06:00" name="dc.modified"/><meta content="DocBook xslTNG" name="generator"/><link href="./css/docbook.css" rel="stylesheet"/><link href="./css/docbook-screen.css" rel="stylesheet"/></head><body class="home"><nav class="top"></nav><main><article class="article"><header><h1>Unit test: admonitions.001</h1></header><p>This test just shows all the admonitions on the same page.</p><div id="note" class="admonition note"><div><div class="icon">🛈︎</div><div class="body"><header><div class="title">Note</div></header><div><p>This note has no title.</p></div></div></div></div><div id="tip" class="admonition tip"><div><div class="icon">☞︎</div><div class="body"><header><div class="title">Tip</div></header><div><p>This tip has no title.</p></div></div></div></div><div id="important" class="admonition important"><div><div class="icon">☝︎</div><div class="body"><header><div class="title">Important</div></header><div><p>This important has no title.</p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/expected/admonitions.002.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" class="no-js"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Unit test: admonitions.001</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link href="http://purl.org/dc/elements/1.1/" rel="schema.dc"/><meta content="2011-04-22T17:02:00-06:00" name="dc.modified"/><meta content="DocBook xslTNG" name="generator"/><link href="./css/docbook.css" rel="stylesheet"/><link href="./css/docbook-screen.css" rel="stylesheet"/></head><body class="home"><nav class="top"></nav><main><article class="article"><header><h1>Unit test: admonitions.001</h1></header><p>This test just shows all the admonitions on the same page.</p><div id="note" class="admonition note"><div><div class="icon">🛈︎</div><div class="body"><header><div class="title">Note!</div></header><div><p>This <code class="tag tag-element">note</code> has a title.</p></div></div></div></div><div id="tip" class="admonition tip"><div><div class="icon">☞︎</div><div class="body"><header><div class="title">Tip!</div></header><div><p>This <code class="tag tag-element">tip</code> has a title.</p></div></div></div></div><div id="important" class="admonition important"><div><div class="icon">☝︎</div><div class="body"><header><div class="title">Important!</div></header><div><p>This <code class="tag tag-element">important</code> has a title.</p></div></div></div></div><div id="caution" class="admonition caution"><div><div class="icon">⚠︎</div><div class="body"><header><div class="title">Caution!</div></header><div><p>This <code class="tag tag-element">caution</code> has a title.</p></div></div></div></div><div id="warning" class="admonition warning"><div><div class="icon">⯃︎</div><div class="body"><header><div class="title">Warning!</div></header><div><p>This <code class="tag tag-element">warning</code> has a title.</p></div></div></div></div><div id="danger" class="admonition danger"><div><div class="icon">⚡︎</div><div class="body"><header><div class="title">Danger!</div></header><div><p>This <code class="tag tag-element">danger</code> has a title.</p></div></div></div></div></article></main><nav class="bottom"></nav></body></html>
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" class="no-js"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Unit test: admonitions.001</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link href="https://purl.org/dc/elements/1.1/" rel="schema.dc"/><meta content="2011-04-22T17:02:00-06:00" name="dc.modified"/><meta content="DocBook xslTNG" name="generator"/><link href="./css/docbook.css" rel="stylesheet"/><link href="./css/docbook-screen.css" rel="stylesheet"/></head><body class="home"><nav class="top"></nav><main><article class="article"><header><h1>Unit test: admonitions.001</h1></header><p>This test just shows all the admonitions on the same page.</p><div id="note" class="admonition note"><div><div class="icon">🛈︎</div><div class="body"><header><div class="title">Note!</div></header><div><p>This <code class="tag tag-element">note</code> has a title.</p></div></div></div></div><div id="tip" class="admonition tip"><div><div class="icon">☞︎</div><div class="body"><header><div class="title">Tip!</div></header><div><p>This <code class="tag tag-element">tip</code> has a title.</p></div></div></div></div><div id="important" class="admonition important"><div><div class="icon">☝︎</div><div class="body"><header><div class="title">Important!</div></header><div><p>This <code class="tag tag-element">important</code> has a title.</p></div></div></div></div><div id="caution" class="admonition caution"><div><div class="icon">⚠︎</div><div class="body"><header><div class="title">Caution!</div></header><div><p>This <code class="tag tag-element">caution</code> has a title.</p></div></div></div></div><div id="warning" class="admonition warning"><div><div class="icon">⯃︎</div><div class="body"><header><div class="title">Warning!</div></header><div><p>This <code class="tag tag-element">warning</code> has a title.</p></div></div></div></div><div id="danger" class="admonition danger"><div><div class="icon">⚡︎</div><div class="body"><header><div class="title">Danger!</div></header><div><p>This <code class="tag tag-element">danger</code> has a title.</p></div></div></div></div></article></main><nav class="bottom"></nav></body></html>
2 changes: 1 addition & 1 deletion src/test/resources/expected/alttitlepage.001.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" class="no-js"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Unit Test: alttitlepage.001.xml</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link href="http://purl.org/dc/elements/1.1/" rel="schema.dc"/><meta content="2011-04-22T17:02:00-06:00" name="dc.modified"/><meta content="DocBook xslTNG" name="generator"/><link href="./css/docbook.css" rel="stylesheet"/><link href="./css/docbook-screen.css" rel="stylesheet"/></head><body class="home"><nav class="top"></nav><main><article id="article" class="article"><header><h1>Unit Test: alttitlepage.001.xml</h1><div class="authorgroup"><div class="author"><h3><span class="first-last personname"><span class="firstname">Jane</span> <span class="surname">Doe</span></span></h3><div class="affiliation"><h4><span class="jobtitle">President</span>,
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" class="no-js"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Unit Test: alttitlepage.001.xml</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link href="https://purl.org/dc/elements/1.1/" rel="schema.dc"/><meta content="2011-04-22T17:02:00-06:00" name="dc.modified"/><meta content="DocBook xslTNG" name="generator"/><link href="./css/docbook.css" rel="stylesheet"/><link href="./css/docbook-screen.css" rel="stylesheet"/></head><body class="home"><nav class="top"></nav><main><article id="article" class="article"><header><h1>Unit Test: alttitlepage.001.xml</h1><div class="authorgroup"><div class="author"><h3><span class="first-last personname"><span class="firstname">Jane</span> <span class="surname">Doe</span></span></h3><div class="affiliation"><h4><span class="jobtitle">President</span>,
<span class="orgname">Acme, Inc.</span>
(<span class="orgdiv">Research &amp; Development</span>)</h4></div></div></div><div class="abstract"><p>This is the abstract.</p><p>It has several paras.</p><p>It has several paras.</p></div></header><p>This is an article tests.</p></article></main><nav class="bottom"></nav></body></html>
2 changes: 1 addition & 1 deletion src/test/resources/expected/annotations.001.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" class="no-js"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Article wrapper</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link href="http://purl.org/dc/elements/1.1/" rel="schema.dc"/><meta content="2011-04-22T17:02:00-06:00" name="dc.modified"/><meta content="DocBook xslTNG" name="generator"/><link href="./css/docbook.css" rel="stylesheet"/><link href="./css/docbook-screen.css" rel="stylesheet"/></head><body class="home"><nav class="top"></nav><main><article class="article"><header><h1>Article wrapper</h1></header><p>This article tests <span id="an1" class="phrase">annotations<a class="annomark" href="#R_annotation2"><sup></sup><sup class="num">2</sup></a></span>.
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" class="no-js"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Article wrapper</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link href="https://purl.org/dc/elements/1.1/" rel="schema.dc"/><meta content="2011-04-22T17:02:00-06:00" name="dc.modified"/><meta content="DocBook xslTNG" name="generator"/><link href="./css/docbook.css" rel="stylesheet"/><link href="./css/docbook-screen.css" rel="stylesheet"/></head><body class="home"><nav class="top"></nav><main><article class="article"><header><h1>Article wrapper</h1></header><p>This article tests <span id="an1" class="phrase">annotations<a class="annomark" href="#R_annotation2"><sup></sup><sup class="num">2</sup></a></span>.
<span id="an2" class="phrase">Annotations<a class="annomark" href="#R_annotation2"><sup></sup><sup class="num">2</sup></a></span>
can point in either direction. This paragraph contains
<span id="an3" class="phrase">annotation<a class="annomark" href="#R_annotation2"><sup></sup><sup class="num">2</sup></a></span> targets.</p><p>This paragraph asserts that it is annotated
Expand Down
Loading

0 comments on commit 5801e23

Please sign in to comment.