w2x: epub 3 semantic inflection

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@253 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2015-06-14 20:13:45 +00:00
parent 442a22f6c0
commit a01aea739c
3 changed files with 16 additions and 18 deletions

View file

@ -30,9 +30,9 @@ import org.w3c.dom.Node;
import writer2latex.office.OfficeReader;
public class EndnoteConverter extends NoteConverter {
class EndnoteConverter extends NoteConverter {
public EndnoteConverter(OfficeReader ofr, XhtmlConfig config, Converter converter) {
EndnoteConverter(OfficeReader ofr, XhtmlConfig config, Converter converter) {
super(ofr,config,converter,ofr.getEndnotesConfiguration());
}
@ -40,7 +40,7 @@ public class EndnoteConverter extends NoteConverter {
*
* @param hnode a block HTML element to contain the endnotes
*/
public void insertEndnotes(Node hnode) {
void insertEndnotes(Node hnode) {
if (hasNotes()) {
if (config.getXhtmlSplitLevel()>0) { hnode = converter.nextOutFile(); }
Element section = createNoteSection(hnode, "rearnotes");

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.6 (2015-06-12)
* Version 1.6 (2015-06-14)
*
*/
package writer2latex.xhtml;
@ -32,12 +32,12 @@ import writer2latex.office.OfficeReader;
import writer2latex.office.PropertySet;
import writer2latex.office.XMLString;
public class FootnoteConverter extends NoteConverter {
class FootnoteConverter extends NoteConverter {
// Footnote position (can be page or document)
private boolean bFootnotesAtPage = true;
public FootnoteConverter(OfficeReader ofr, XhtmlConfig config, Converter converter) {
FootnoteConverter(OfficeReader ofr, XhtmlConfig config, Converter converter) {
super(ofr,config,converter,ofr.getFootnotesConfiguration());
PropertySet configuration=ofr.getFootnotesConfiguration();
if (configuration!=null) {
@ -51,7 +51,7 @@ public class FootnoteConverter extends NoteConverter {
* @param hnode a block HTML element to contain the footnotes
* @param bFinal true if this is the final call
*/
public void insertFootnotes(Node hnode, boolean bFinal) {
void insertFootnotes(Node hnode, boolean bFinal) {
if (hasNotes()) {
if (bFootnotesAtPage) {
Element section = createNoteSection(hnode, "footnotes");
@ -76,5 +76,3 @@ public class FootnoteConverter extends NoteConverter {
}
}

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.6 (2015-06-12)
* Version 1.6 (2015-06-14)
*
*/
package writer2latex.xhtml;
@ -38,7 +38,7 @@ import writer2latex.util.Misc;
/** This is a base class handles the conversion of footnotes and endnotes
*/
public class NoteConverter extends ConverterHelper {
class NoteConverter extends ConverterHelper {
// The notes configuration
private PropertySet noteConfig;
@ -53,7 +53,7 @@ public class NoteConverter extends ConverterHelper {
* @param converter the converter
* @param noteConfig the configuration of the notes
*/
public NoteConverter(OfficeReader ofr, XhtmlConfig config, Converter converter, PropertySet noteConfig) {
NoteConverter(OfficeReader ofr, XhtmlConfig config, Converter converter, PropertySet noteConfig) {
super(ofr,config,converter);
this.noteConfig = noteConfig;
}
@ -63,7 +63,7 @@ public class NoteConverter extends ConverterHelper {
* @param onode a text:note element
* @param hnode the inline HTML element to contain the citation
*/
public void handleNote(Node onode, Node hnode) {
void handleNote(Node onode, Node hnode) {
// Create a style span for the citation
String sCitBodyStyle = noteConfig.getProperty(XMLString.TEXT_CITATION_BODY_STYLE_NAME);
Element span = getTextCv().createInline((Element) hnode,sCitBodyStyle);
@ -89,18 +89,18 @@ public class NoteConverter extends ConverterHelper {
notes.add(onode);
}
protected boolean hasNotes() {
boolean hasNotes() {
return notes.size()>0;
}
protected Element createNoteSection(Node hnode, String sEpubType) {
Element createNoteSection(Node hnode, String sEpubType) {
Element section = converter.createElement(converter.isHTML5() ? "section" : "div");
hnode.appendChild(section);
converter.addEpubType(section, sEpubType);
return section;
}
protected void insertNoteHeading(Node hnode, String sHeading, String sTarget) {
void insertNoteHeading(Node hnode, String sHeading, String sTarget) {
if (sHeading.length()>0) {
// Create heading
Element heading = converter.createElement("h1");
@ -119,7 +119,7 @@ public class NoteConverter extends ConverterHelper {
}
}
protected void flushNotes(Node hnode, String sEpubType) {
void flushNotes(Node hnode, String sEpubType) {
int nSize = notes.size();
for (int i=0; i<nSize; i++) {
Node note = notes.get(i);
@ -145,6 +145,7 @@ public class NoteConverter extends ConverterHelper {
}
// Export the note
String sId = Misc.getAttribute(note,XMLString.TEXT_ID);
converter.addTarget(aside,sId);
createAnchor(sId,citation);
getTextCv().traverseBlockText(body,aside);
}
@ -154,7 +155,6 @@ public class NoteConverter extends ConverterHelper {
private void createAnchor(String sId, Node citation) {
// Create target and link
Element link = converter.createLink("body"+sId);
converter.addTarget(link,sId);
// Style it
String sCitStyle = noteConfig.getProperty(XMLString.TEXT_CITATION_STYLE_NAME);