Skip to content

Commit

Permalink
Support of titleabbrev in Bibliography.
Browse files Browse the repository at this point in the history
New and changed tests.
  • Loading branch information
fsteimke committed Oct 12, 2024
1 parent 5c800a9 commit 5353306
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/main/scss/media-all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,10 @@ cite.title {
font-family: inherit;
}

.bibliography .titleabbrev {font-style:italic}
.bibliography .titleabbrev:before {content: ' ('}
.bibliography .titleabbrev:after {content: ')'}

.set > .list-of-titles > .lot > .title,
.book > .list-of-titles > .lot > .title,
.part > .list-of-titles > .lot > .title {
Expand Down
3 changes: 2 additions & 1 deletion src/main/xslt/modules/templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@
<tmp:apply-templates select="db:abbrev">[<tmp:content/>] </tmp:apply-templates>
<tmp:insert ref="biblioset-article"/>
<tmp:insert ref="biblioset-journal"/>
<tmp:apply-templates select="db:title"><tmp:content/>. </tmp:apply-templates>
<tmp:apply-templates select="db:title"><tmp:content/><tmp:apply-templates select="../db:titleabbrev"><tmp:content/></tmp:apply-templates>. </tmp:apply-templates>
<tmp:apply-templates select="db:subtitle"><tmp:content/>. </tmp:apply-templates>
<tmp:apply-templates select="db:address"><tmp:content/>. </tmp:apply-templates>
<tmp:apply-templates select="db:artpagenums"><tmp:content/>. </tmp:apply-templates>
Expand Down Expand Up @@ -642,6 +642,7 @@
<tmp:apply-templates select="db:releaseinfo"><tmp:content/>. </tmp:apply-templates>
<tmp:apply-templates select="db:seriesvolnums"><tmp:content/>. </tmp:apply-templates>
<tmp:apply-templates select="db:volumenum"><tmp:content/>. </tmp:apply-templates>
<tmp:apply-templates select="db:bibliosource"><tmp:content/>. </tmp:apply-templates>
</db:biblioentry>

<db:toc>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/expected/bibliography.001.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"/><script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script><title>Unit Test: bibliography.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" media="screen"/></head><body class="home"><nav class="top"></nav><main><article class="bibliography component"><header><h1>Unit Test: bibliography.001</h1></header><p class="biblioentry">[<span class="abbrev">Abbrev</span>] <cite class="title">A Really Full BiblioEntry</cite>. <span class="subtitle">Subtitle</span>. <span class="address verbatim">Any Street / Anywhere, XX 99999 / USA</span>. <span class="artpagenums">ArtPageNums</span>. <span class="author"><span class="first-last personname"><span class="firstname">AuthorFirstname</span> <span class="surname">AuthorSurname</span></span></span>. <span class="author"><span class="orgname">CorpAuthor</span></span>. <span class="authorinitials">AuthorInitials</span>. <span class="collab"><span class="first-last personname">The names of some collaborators</span></span>. <span class="confgroup"><span class="confdates">confdates</span>. <span class="conftitle">conftitle</span>. <span class="confnum">confnum</span>. <span class="address verbatim">Any Street / Anywhere, XX 99999 / USA</span><span class="confsponsor">confsponsor</span>. </span>. <span class="contractnum">ContractNum</span>. <span class="contractsponsor">ContractSponsor</span>. <span class="copyright">Copyright © <span class="copyright-years"><span class="year">1998</span></span> <span class="holder">Copyright holder</span></span>. <span class="date">Date</span>. <span class="edition">Edition</span>. <span class="editor"><span class="first-last personname"><span class="firstname">EditorFirstName</span> <span class="surname">EditorSurname</span></span></span>. <span class="biblioid">ISBN</span>. <span class="biblioid">ISSN</span>. <span class="orgname">OrgName</span>. <span class="othercredit"><span class="first-last personname"><span class="firstname">OCFirstName</span> <span class="surname">OCSurname</span></span></span>. <span class="pagenums">PageNums</span>. <span class="productname">ProductName</span>. <span class="productnumber">ProductNumber</span>. <time class="pubdate">PubDate</time>. <span class="publishername">PubPublisherName</span>. <span class="address verbatim"> / <span class="street">Any Street</span> / <span class="city">Anywhere</span>, <span class="state">XX</span> / <span class="postcode">99999</span> / <span class="country">USA</span> / </span>. <span class="publishername">PublisherName</span>. <span class="biblioid">PubsNumber</span>. <span class="releaseinfo">ReleaseInfo</span>. <span class="seriesvolnums">SeriesVolNums</span>. <span class="volumenum">VolumeNum</span>. </p></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"/><script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script><title>Unit Test: bibliography.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" media="screen"/></head><body class="home"><nav class="top"></nav><main><article class="bibliography component"><header><h1>Unit Test: bibliography.001</h1></header><p class="biblioentry">[<span class="abbrev">Abbrev</span>] <cite class="title">A Really Full BiblioEntry</cite><span class="titleabbrev">TitleAbbrev</span>. <span class="subtitle">Subtitle</span>. <span class="address verbatim">Any Street / Anywhere, XX 99999 / USA</span>. <span class="artpagenums">ArtPageNums</span>. <span class="author"><span class="first-last personname"><span class="firstname">AuthorFirstname</span> <span class="surname">AuthorSurname</span></span></span>. <span class="author"><span class="orgname">CorpAuthor</span></span>. <span class="authorinitials">AuthorInitials</span>. <span class="collab"><span class="first-last personname">The names of some collaborators</span></span>. <span class="confgroup"><span class="confdates">confdates</span>. <span class="conftitle">conftitle</span>. <span class="confnum">confnum</span>. <span class="address verbatim">Any Street / Anywhere, XX 99999 / USA</span><span class="confsponsor">confsponsor</span>. </span>. <span class="contractnum">ContractNum</span>. <span class="contractsponsor">ContractSponsor</span>. <span class="copyright">Copyright © <span class="copyright-years"><span class="year">1998</span></span> <span class="holder">Copyright holder</span></span>. <span class="date">Date</span>. <span class="edition">Edition</span>. <span class="editor"><span class="first-last personname"><span class="firstname">EditorFirstName</span> <span class="surname">EditorSurname</span></span></span>. <span class="biblioid">ISBN</span>. <span class="biblioid">ISSN</span>. <span class="orgname">OrgName</span>. <span class="othercredit"><span class="first-last personname"><span class="firstname">OCFirstName</span> <span class="surname">OCSurname</span></span></span>. <span class="pagenums">PageNums</span>. <span class="productname">ProductName</span>. <span class="productnumber">ProductNumber</span>. <time class="pubdate">PubDate</time>. <span class="publishername">PubPublisherName</span>. <span class="address verbatim"> / <span class="street">Any Street</span> / <span class="city">Anywhere</span>, <span class="state">XX</span> / <span class="postcode">99999</span> / <span class="country">USA</span> / </span>. <span class="publishername">PublisherName</span>. <span class="biblioid">PubsNumber</span>. <span class="releaseinfo">ReleaseInfo</span>. <span class="seriesvolnums">SeriesVolNums</span>. <span class="volumenum">VolumeNum</span>. </p></article></main><nav class="bottom"></nav></body></html>
2 changes: 1 addition & 1 deletion src/test/resources/expected/bibliography.002.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"/><script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script><title>Unit Test: bibliography.002</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" media="screen"/></head><body class="home"><nav class="top"></nav><main><article class="bibliography component"><header><h1>Unit Test: bibliography.002</h1></header><div id="R_bd1" class="bibliodiv"><header><h2>Entries using biblioentry</h2></header><p class="biblioentry">[<span class="abbrev">AhoSethiUllman96</span>] <cite class="title">Compilers, Principles, Techniques, and Tools</cite>. <span class="authorgroup"><span class="author"><span class="first-last personname"><span class="firstname">Alfred V.</span> <span class="surname">Aho</span></span></span>, <span class="author"><span class="first-last personname"><span class="firstname">Ravi</span> <span class="surname">Sethi</span></span></span>, and <span class="author"><span class="first-last personname"><span class="firstname">Jeffrey D.</span> <span class="surname">Ullman</span></span></span></span>. <span class="copyright">Copyright © <span class="copyright-years"><span class="year">1996</span></span> <span class="holder">Bell Telephone Laboratories, Inc.</span></span>. <span class="editor"><span class="first-last personname"><span class="firstname">James T.</span> <span class="surname">DeWolf</span></span></span>. <span class="biblioid">0-201-10088-6</span>. <span class="publishername">Addison-Wesley Publishing Company</span>. </p><p id="Walsh97-2" class="biblioentry">[<span class="abbrev">Walsh97</span>] <span class="biblioset article"><q class="title">A Guide to XML</q>. <span class="author"><span class="first-last personname"><span class="firstname">Norman</span> <span class="surname">Walsh</span></span></span>. <time class="pubdate" datetime="1997">1997</time>. <span class="copyright">Copyright © <span class="copyright-years"><span class="year">1997</span></span> <span class="holder">ArborText, Inc.</span></span>. <span class="pagenums">97-108</span>. </span><span class="biblioset journal"><cite class="title">XML: Principles, Tools, and Techniques</cite>. </span></p><p class="biblioentry">[<span class="abbrev">Abbrev</span>] <cite class="title">A Really Full BiblioEntry</cite>. <span class="subtitle">Subtitle</span>. <span class="address verbatim">Any Street / Anywhere, XX 99999 / USA</span>. <span class="artpagenums">ArtPageNums</span>. <span class="author"><span class="first-last personname"><span class="firstname">AuthorFirstname</span> <span class="surname">AuthorSurname</span></span></span>. <span class="authorinitials">AuthorInitials</span>. <span class="collab"><span class="first-last personname">The names of some collaborators</span></span>. <span class="confgroup"><span class="confdates">confdates</span>. <span class="conftitle">conftitle</span>. <span class="confnum">confnum</span>. <span class="address verbatim">Any Street / Anywhere, XX 99999 / USA</span><span class="confsponsor">confsponsor</span>. </span>. <span class="contractnum">ContractNum</span>. <span class="contractsponsor">ContractSponsor</span>. <span class="copyright">Copyright © <span class="copyright-years"><span class="year">1998</span></span> <span class="holder">Copyright holder</span></span>. <span class="date">Date</span>. <span class="edition">Edition</span>. <span class="editor"><span class="first-last personname"><span class="firstname">EditorFirstName</span> <span class="surname">EditorSurname</span></span></span>. <span class="biblioid">ISBN</span>. <span class="biblioid">ISSN</span>. <span class="orgname">CorpName</span>. <span class="orgname">OrgName</span>. <span class="othercredit"><span class="first-last personname"><span class="firstname">OCFirstName</span> <span class="surname">OCSurname</span></span></span>. <span class="pagenums">PageNums</span>. <span class="productname">ProductName</span>. <span class="productnumber">ProductNumber</span>. <time class="pubdate">PubDate</time>. <span class="publishername">PubPublisherName</span>. <span class="address verbatim"> / <span class="street">Any Street</span> / <span class="city">Anywhere</span>, <span class="state">XX</span> / <span class="postcode">99999</span> / <span class="country">USA</span> / </span>. <span class="publishername">PublisherName</span>. <span class="biblioid">PubsNumber</span>. <span class="releaseinfo">ReleaseInfo</span>. <span class="seriesvolnums">SeriesVolNums</span>. <span class="volumenum">VolumeNum</span>. </p></div><div id="R_bd2" class="bibliodiv"><header><h2>Entries using bibliomixed</h2></header><p id="Walsh96-2" class="bibliomixed">[Walsh96-2]
<!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"/><script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script><title>Unit Test: bibliography.002</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" media="screen"/></head><body class="home"><nav class="top"></nav><main><article class="bibliography component"><header><h1>Unit Test: bibliography.002</h1></header><div id="R_bd1" class="bibliodiv"><header><h2>Entries using biblioentry</h2></header><p class="biblioentry">[<span class="abbrev">AhoSethiUllman96</span>] <cite class="title">Compilers, Principles, Techniques, and Tools</cite>. <span class="authorgroup"><span class="author"><span class="first-last personname"><span class="firstname">Alfred V.</span> <span class="surname">Aho</span></span></span>, <span class="author"><span class="first-last personname"><span class="firstname">Ravi</span> <span class="surname">Sethi</span></span></span>, and <span class="author"><span class="first-last personname"><span class="firstname">Jeffrey D.</span> <span class="surname">Ullman</span></span></span></span>. <span class="copyright">Copyright © <span class="copyright-years"><span class="year">1996</span></span> <span class="holder">Bell Telephone Laboratories, Inc.</span></span>. <span class="editor"><span class="first-last personname"><span class="firstname">James T.</span> <span class="surname">DeWolf</span></span></span>. <span class="biblioid">0-201-10088-6</span>. <span class="publishername">Addison-Wesley Publishing Company</span>. </p><p id="Walsh97-2" class="biblioentry">[<span class="abbrev">Walsh97</span>] <span class="biblioset article"><q class="title">A Guide to XML</q>. <span class="author"><span class="first-last personname"><span class="firstname">Norman</span> <span class="surname">Walsh</span></span></span>. <time class="pubdate" datetime="1997">1997</time>. <span class="copyright">Copyright © <span class="copyright-years"><span class="year">1997</span></span> <span class="holder">ArborText, Inc.</span></span>. <span class="pagenums">97-108</span>. </span><span class="biblioset journal"><cite class="title">XML: Principles, Tools, and Techniques</cite>. </span></p><p class="biblioentry">[<span class="abbrev">Abbrev</span>] <cite class="title">A Really Full BiblioEntry</cite><span class="titleabbrev">TitleAbbrev</span>. <span class="subtitle">Subtitle</span>. <span class="address verbatim">Any Street / Anywhere, XX 99999 / USA</span>. <span class="artpagenums">ArtPageNums</span>. <span class="author"><span class="first-last personname"><span class="firstname">AuthorFirstname</span> <span class="surname">AuthorSurname</span></span></span>. <span class="authorinitials">AuthorInitials</span>. <span class="collab"><span class="first-last personname">The names of some collaborators</span></span>. <span class="confgroup"><span class="confdates">confdates</span>. <span class="conftitle">conftitle</span>. <span class="confnum">confnum</span>. <span class="address verbatim">Any Street / Anywhere, XX 99999 / USA</span><span class="confsponsor">confsponsor</span>. </span>. <span class="contractnum">ContractNum</span>. <span class="contractsponsor">ContractSponsor</span>. <span class="copyright">Copyright © <span class="copyright-years"><span class="year">1998</span></span> <span class="holder">Copyright holder</span></span>. <span class="date">Date</span>. <span class="edition">Edition</span>. <span class="editor"><span class="first-last personname"><span class="firstname">EditorFirstName</span> <span class="surname">EditorSurname</span></span></span>. <span class="biblioid">ISBN</span>. <span class="biblioid">ISSN</span>. <span class="orgname">CorpName</span>. <span class="orgname">OrgName</span>. <span class="othercredit"><span class="first-last personname"><span class="firstname">OCFirstName</span> <span class="surname">OCSurname</span></span></span>. <span class="pagenums">PageNums</span>. <span class="productname">ProductName</span>. <span class="productnumber">ProductNumber</span>. <time class="pubdate">PubDate</time>. <span class="publishername">PubPublisherName</span>. <span class="address verbatim"> / <span class="street">Any Street</span> / <span class="city">Anywhere</span>, <span class="state">XX</span> / <span class="postcode">99999</span> / <span class="country">USA</span> / </span>. <span class="publishername">PublisherName</span>. <span class="biblioid">PubsNumber</span>. <span class="releaseinfo">ReleaseInfo</span>. <span class="seriesvolnums">SeriesVolNums</span>. <span class="volumenum">VolumeNum</span>. </p></div><div id="R_bd2" class="bibliodiv"><header><h2>Entries using bibliomixed</h2></header><p id="Walsh96-2" class="bibliomixed">[Walsh96-2]
<span class="bibliomset">
<span class="first-last personname"><span class="surname">Walsh</span></span>, <span class="first-last personname"><span class="firstname">Norman</span></span>.
<q class="article title">Introduction to Cascading Style Sheets</q>.
Expand Down
Loading

0 comments on commit 5353306

Please sign in to comment.