-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add docbook 5 support Renamed to docbook 5 export removed old layout files * rename old docbook to docbook 4 use lastName only in docbook5 use new docbook template favor composition over inheritance add docbook version enum * fix wrong method name in masterthesis for docbook4 * add test for docbook5 * split format in separate files * remove submodule accidentaly commited * fix variable ordr * fix tests * fix checkstyle * Update docbook5 layout fiels * fix tests * Use FullName instead of NoInitials User lower case formatter for \entrytype * lastname instead of fullname * update to latest version of docbook layout files provided convert tab character to spaces * fix test
- Loading branch information
1 parent
742cfce
commit 9213e3c
Showing
25 changed files
with
524 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/org/jabref/logic/layout/format/CreateDocBook4Authors.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.jabref.logic.layout.format; | ||
|
||
import org.jabref.logic.layout.LayoutFormatter; | ||
import org.jabref.model.entry.AuthorList; | ||
import org.jabref.model.entry.FieldName; | ||
|
||
/** | ||
* Create DocBook authors formatter. | ||
*/ | ||
public class CreateDocBook4Authors implements LayoutFormatter { | ||
|
||
@Override | ||
public String format(String fieldText) { | ||
StringBuilder sb = new StringBuilder(100); | ||
AuthorList al = AuthorList.parse(fieldText); | ||
DocBookAuthorFormatter formatter = new DocBookAuthorFormatter(); | ||
formatter.addBody(sb, al, FieldName.AUTHOR, DocBookVersion.DOCBOOK_4); | ||
return sb.toString(); | ||
|
||
} | ||
|
||
} |
8 changes: 5 additions & 3 deletions
8
...c/layout/format/CreateDocBookEditors.java → .../layout/format/CreateDocBook4Editors.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/org/jabref/logic/layout/format/CreateDocBook5Authors.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.jabref.logic.layout.format; | ||
|
||
import org.jabref.logic.layout.LayoutFormatter; | ||
import org.jabref.model.entry.AuthorList; | ||
import org.jabref.model.entry.FieldName; | ||
|
||
/** | ||
* Create DocBook5 authors formatter | ||
*/ | ||
public class CreateDocBook5Authors implements LayoutFormatter { | ||
|
||
@Override | ||
public String format(String fieldText) { | ||
|
||
StringBuilder sb = new StringBuilder(100); | ||
AuthorList al = AuthorList.parse(fieldText); | ||
|
||
DocBookAuthorFormatter authorFormatter = new DocBookAuthorFormatter(); | ||
authorFormatter.addBody(sb, al, FieldName.AUTHOR, DocBookVersion.DOCBOOK_5); | ||
return sb.toString(); | ||
|
||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/org/jabref/logic/layout/format/CreateDocBook5Editors.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.jabref.logic.layout.format; | ||
|
||
import org.jabref.logic.layout.LayoutFormatter; | ||
import org.jabref.model.entry.AuthorList; | ||
import org.jabref.model.entry.FieldName; | ||
|
||
/** | ||
* Create DocBook editors formatter. | ||
*/ | ||
public class CreateDocBook5Editors implements LayoutFormatter { | ||
|
||
@Override | ||
public String format(String fieldText) { | ||
// <editor><personname><firstname>L.</firstname><surname>Xue</surname></personname></editor> | ||
StringBuilder sb = new StringBuilder(100); | ||
AuthorList al = AuthorList.parse(fieldText); | ||
DocBookAuthorFormatter formatter = new DocBookAuthorFormatter(); | ||
formatter.addBody(sb, al, FieldName.EDITOR, DocBookVersion.DOCBOOK_5); | ||
return sb.toString(); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/java/org/jabref/logic/layout/format/DocBookVersion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.jabref.logic.layout.format; | ||
|
||
public enum DocBookVersion { | ||
DOCBOOK_4, | ||
DOCBOOK_5 | ||
} |
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
.../resources/resource/layout/docbook.layout → ...resources/resource/layout/docbook4.layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ource/layout/docbook.mastersthesis.layout → ...urce/layout/docbook4.mastersthesis.layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/resources/resource/layout/docbook5.article.layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<biblioentry xreflabel="\format[Authors(3,LastName,EtAl= et al.)]{\author} (\year)" xml:id="\bibtexkey"> | ||
<authorgroup> | ||
<!--AUTHORS--> | ||
\begin{author} \format[CreateDocBook5Authors]{\author} \end{author} | ||
<!--EDITORS--> | ||
\begin{editor} \format[CreateDocBook5Editors]{\editor} \end{editor} | ||
</authorgroup> | ||
<!--TITLE--> | ||
\begin{title} <citetitle pubwork="article">\format[XMLChars,RemoveLatexCommands]{\title}</citetitle> \end{title} | ||
|
||
<!--JOURNAL, Vol, Pages, Year--> | ||
\begin{journal} | ||
<biblioset relation="journal">\n | ||
\begin{volume} <volumenum>\volume</volumenum> \end{volume} | ||
\begin{pages} <artpagenums>\format[FormatPagesForXML]{\pages}</artpagenums> \end{pages} | ||
\begin{year} <pubdate>\year</pubdate> \end{year} | ||
\end{journal} | ||
|
||
<!-- IDENTIFIERS--> | ||
\begin{url} | ||
<bibliomisc><link xlink:href="\format[XMLChars]{\url}">\format[XMLChars]{\url}</link></bibliomisc> | ||
\end{url} | ||
\begin{doi} | ||
<biblioid class="doi">\format[XMLChars]{\doi}</biblioid> | ||
\end{doi} | ||
\begin{isbn} | ||
<biblioid class="isbn">\format[XMLChars]{\isbn}</biblioid> | ||
\end{isbn} | ||
|
||
<!--ABSTRACT--> | ||
\begin{abstract} | ||
<abstract> | ||
<para>\format[XMLChars,RemoveLatexCommands]{\abstract}</para> | ||
</abstract> | ||
\end{abstract} | ||
</biblioentry> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<?xml-model href="http://docbook.org/xml/5.1/rng/docbook.rng" schematypens="http://relaxng.org/ns/structure/1.0"?> | ||
<?xml-model href="http://docbook.org/xml/5.1/sch/docbook.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?> | ||
<bibliography version="5.1" xml:lang="en" | ||
xmlns="http://docbook.org/ns/docbook" | ||
xmlns:xlink="http://www.w3.org/1999/xlink" | ||
xmlns:ns="http://docbook.org/ns/docbook"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<biblioentry xreflabel="\format[Authors(3,LastName,EtAl= et al.)]{\author} (\year)" xml:id="\bibtexkey"> | ||
<authorgroup> | ||
<!--AUTHORS--> | ||
\begin{author} \format[CreateDocBook5Authors]{\author} \end{author} | ||
<!--EDITORS--> | ||
\begin{editor} \format[CreateDocBook5Editors]{\editor} \end{editor} | ||
</authorgroup> | ||
<!--TITLE--> | ||
\begin{title} <citetitle pubwork="book">\format[XMLChars,RemoveLatexCommands]{\title}</citetitle> \end{title} | ||
|
||
<!--BOOK booktitle, edition, (pages), publisher--> | ||
<biblioset relation="book">\n | ||
\begin{booktitle}<booktitle>\format[XMLChars,RemoveLatexCommands]{\booktitle}</booktitle>\end{booktitle} | ||
\begin{edition}<edition>\format[XMLChars,RemoveLatexCommands]{\edition}</edition>\end{edition} | ||
\begin{year}<pubdate>\year</pubdate>\end{year} | ||
\begin{pages}<artpagenums>\format[FormatPagesForXML]{\pages}</artpagenums> \end{pages} | ||
\begin{publisher}<publisher>\end{publisher} | ||
<publishername>\publisher</publishername> | ||
<address>\address</address> | ||
\begin{publisher}</publisher>\end{publisher} | ||
</biblioset> | ||
|
||
|
||
<!-- IDENTIFIERS--> | ||
\begin{url} | ||
<bibliomisc><link xlink:href="\format[XMLChars]{\url}">\format[XMLChars]{\url}</link></bibliomisc> | ||
\end{url} | ||
\begin{doi} | ||
<biblioid class="doi">\format[XMLChars]{\doi}</biblioid> | ||
\end{doi} | ||
\begin{isbn} | ||
<biblioid class="isbn">\format[XMLChars]{\isbn}</biblioid> | ||
\end{isbn} | ||
<!--ABSTRACT--> | ||
\begin{abstract} | ||
<abstract> | ||
<para>\format[XMLChars,RemoveLatexCommands]{\abstract}</para> | ||
</abstract> | ||
\end{abstract} | ||
</biblioentry> |
26 changes: 26 additions & 0 deletions
26
src/main/resources/resource/layout/docbook5.booklet.layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<biblioentry xreflabel="\format[Authors(3,LastName,EtAl= et al.)]{\author} (\year)" xml:id="\bibtexkey"> | ||
<authorgroup> | ||
<!--AUTHORS--> | ||
\begin{author}\format[CreateDocBook5Authors]{\author}\end{author} | ||
<!--EDITORS--> | ||
\begin{editor}\format[CreateDocBook5Editors]{\editor}\end{editor} | ||
</authorgroup> | ||
<!--TITLE--> | ||
\begin{title}<citetitle pubwork="book">\format[XMLChars,RemoveLatexCommands]{\title}</citetitle> \end{title} | ||
<!--Booklet booktitle, year, howpublished, publisher --> | ||
<biblioset relation="book">\n | ||
\begin{booktitle}<title>\format[XMLChars,RemoveLatexCommands]{\booktitle}</title>\end{booktitle} | ||
\begin{year}<pubdate>\year</pubdate>\end{year} | ||
\begin{howpublished}<bibliomisc role="howpublished">\howpublished</bibliomisc>\end{howpublished} | ||
\begin{publisher}<publisher>\end{publisher} | ||
\begin{publisher}<publishername>\format[XMLChars]{\publisher}</publishername> \end{publisher} | ||
\begin{location}\begin{address}<address>\location</address>\end{address}\end{location} | ||
\begin{publisher}</publisher>\end{publisher} | ||
</biblioset> | ||
<!-- IDENTIFIERS--> | ||
\begin{url}<bibliomisc><link xlink:href="\format[XMLChars]{\url}">\format[XMLChars]{\url}</link></bibliomisc>\end{url} | ||
\begin{doi}<biblioid class="doi">\format[XMLChars]{\doi}</biblioid>\end{doi} | ||
\begin{isbn}<biblioid class="isbn">\format[XMLChars]{\isbn}</biblioid>\end{isbn} | ||
<!--ABSTRACT--> | ||
\begin{abstract}<abstract><para>\format[XMLChars,RemoveLatexCommands]{\abstract}</para></abstract>\end{abstract} | ||
</biblioentry> |
30 changes: 30 additions & 0 deletions
30
src/main/resources/resource/layout/docbook5.collection.layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<biblioentry xreflabel="\format[Authors(3,LastName,EtAl= et al.)]{\editor} (\year)" xml:id="\bibtexkey"> | ||
<authorgroup> | ||
<!--EDITORS--> | ||
\begin{editor}\format[CreateDocBook5Editors]{\editor}\end{editor} | ||
</authorgroup> | ||
<!--TITLE--> | ||
\begin{title}<citetitle pubwork="book">\format[XMLChars,RemoveLatexCommands]{\title}</citetitle> \end{title} | ||
<!--Collection booktitle, edition, series, (pages), publisher--> | ||
<biblioset relation="book">\n | ||
\begin{booktitle}<title>\format[XMLChars,RemoveLatexCommands]{\booktitle}</title>\end{booktitle} | ||
\begin{edition}<edition>\format[XMLChars,RemoveLatexCommands]{\edition}</edition>\end{edition} | ||
\begin{year}<pubdate>\year</pubdate>\end{year} | ||
\begin{volume}<volumenum>\volume</volumenum> \end{volume} | ||
\begin{chapter}<bibliomisc role="secnum">\chapter</bibliomisc> \end{chapter} | ||
\begin{pages}<artpagenums>\format[FormatPagesForXML]{\pages}</artpagenums> \end{pages} | ||
\begin{publisher}<publisher>\end{publisher} | ||
\begin{publisher}<publishername>\format[XMLChars]{\publisher}</publishername> \end{publisher} | ||
\begin{location}\begin{address}<address>\location</address>\end{address}\end{location} | ||
\begin{publisher}</publisher>\end{publisher} | ||
</biblioset> | ||
\begin{series}<bibliomisc role="seriestitle">\format[XMLChars,RemoveLatexCommands]{\series}</bibliomisc>\end{series} | ||
\begin{series}\begin{editora}<bibliomisc role="serieseditor">\format[XMLChars,RemoveLatexCommands]{\editora}</bibliomisc>\end{editora}\end{series} | ||
|
||
<!-- IDENTIFIERS--> | ||
\begin{url}<bibliomisc><link xlink:href="\format[XMLChars]{\url}">\format[XMLChars]{\url}</link></bibliomisc>\end{url} | ||
\begin{doi}<biblioid class="doi">\format[XMLChars]{\doi}</biblioid>\end{doi} | ||
\begin{isbn}<biblioid class="isbn">\format[XMLChars]{\isbn}</biblioid>\end{isbn} | ||
<!--ABSTRACT--> | ||
\begin{abstract}<abstract><para>\format[XMLChars,RemoveLatexCommands]{\abstract}</para></abstract>\end{abstract} | ||
</biblioentry> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
</bibliography> |
Oops, something went wrong.