[sword-svn] r3359 - trunk/utilities/diatheke

refdoc at crosswire.org refdoc at crosswire.org
Sun Mar 22 16:31:44 MST 2015


Author: refdoc
Date: 2015-03-22 16:31:43 -0700 (Sun, 22 Mar 2015)
New Revision: 3359

Modified:
   trunk/utilities/diatheke/corediatheke.cpp
   trunk/utilities/diatheke/corediatheke.h
   trunk/utilities/diatheke/diatheke.cpp
Log:
more work on Diatheke - preparation for inclusion of Intros, better HTML headers


Modified: trunk/utilities/diatheke/corediatheke.cpp
===================================================================
--- trunk/utilities/diatheke/corediatheke.cpp	2015-03-22 18:09:07 UTC (rev 3358)
+++ trunk/utilities/diatheke/corediatheke.cpp	2015-03-22 23:31:43 UTC (rev 3359)
@@ -254,6 +254,7 @@
 	manager.setGlobalOption("Transliterated Forms", (optionfilters & OP_XLIT) ? "On": "Off");
 	manager.setGlobalOption("Enumerations", (optionfilters & OP_ENUM) ? "On": "Off");
 	manager.setGlobalOption("Morpheme Segmentation", (optionfilters & OP_MORPHSEG) ? "On": "Off");
+	manager.setGlobalOption("Introductions", (optionfilters & OP_INTROS) ? "On": "Off");
 
 	manager.setGlobalOption("Transliteration", (optionfilters & OP_TRANSLITERATOR && script) ? script : "Off");
 	
@@ -352,8 +353,10 @@
 			*output << ";}}";
 		}
 		else if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML) {
-			*output << "<meta http-equiv=\"content-type\" content=\"text/html\" charset=\"UTF-8\""
-				   " lang=\"" << locale << "\" xml:lang=\"" << locale << "\"/>";
+			*output << "<html><head><meta http-equiv=\"content-type\" content=\"text/html\" charset=\"UTF-8\""
+				   " lang=\"" << locale << "\" xml:lang=\"" << locale << "\"/>"
+				   "<link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\"></head><body>";
+				   
 		}
 		else if (outputformat == FMT_LATEX) {
 			*output << "\\documentclass{bibletext}\n"
@@ -500,12 +503,16 @@
 
 
 		else if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML) {
-			*output << "<meta http-equiv=\"content-type\" content=\"text/html\" charset=\"UTF-8\""
-				   " lang=\"" <<  locale << "\" xml:lang=\"" <<   locale << "\"/>\n";
+			*output << "<html><head><meta http-equiv=\"content-type\" content=\"text/html\" charset=\"UTF-8\""
+				   " lang=\"" <<  locale << "\" xml:lang=\"" <<   locale << "\"/>\n"
+				   "<link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\"></head><body>";
+				   
 		}
 
 		for (i = 0; i < listkey.getCount() && maxverses; i++) {
 			VerseKey *element = SWDYNAMIC_CAST(VerseKey, listkey.getElement(i));
+			element->setIntros(true);			
+			
 			if (element && element->isBoundSet()) {
 			  target->setKey(element->getLowerBound());
 				*parser = element->getUpperBound();
@@ -513,6 +520,8 @@
 
 					if (outputformat == FMT_LATEX) {
 						VerseKey *outkey = new VerseKey(target->getKey());
+						
+						
 						if (outkey->getVerse() == 1) {
 							*output << "\n\\swordchapter{" 
 								<< outkey->getOSISRef() << "}{"
@@ -523,6 +532,7 @@
 							<< outkey->getOSISRef() << "}{"
 							<< outkey->getText() << "}{" 
 							<< outkey->getVerse() << "} ";
+						delete outkey;
 						
 						}
 					else { 						
@@ -655,8 +665,11 @@
 			*output << "}";
 		}
 		else if (outputformat == FMT_LATEX) {
-			*output << "\\end{document}\n";
+			*output << "\\end{document}\n";			
 		}
+		else if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
+			*output << "</body></html>\n";
+		}
 	}
 	delete parser;
 }

Modified: trunk/utilities/diatheke/corediatheke.h
===================================================================
--- trunk/utilities/diatheke/corediatheke.h	2015-03-22 18:09:07 UTC (rev 3358)
+++ trunk/utilities/diatheke/corediatheke.h	2015-03-22 23:31:43 UTC (rev 3359)
@@ -59,6 +59,7 @@
 #define OP_XLIT (1<<16)
 #define OP_ENUM (1<<17)
 #define OP_MORPHSEG (1<<18)
+#define OP_INTROS (1<<19)
 
 #define ST_NONE 0
 #define ST_REGEX 1     //  0

Modified: trunk/utilities/diatheke/diatheke.cpp
===================================================================
--- trunk/utilities/diatheke/diatheke.cpp	2015-03-22 18:09:07 UTC (rev 3358)
+++ trunk/utilities/diatheke/diatheke.cpp	2015-03-22 23:31:43 UTC (rev 3359)
@@ -56,7 +56,7 @@
 	fprintf (stderr, "  c (Cantillation), v (Hebrew Vowels), a (Greek Accents), p (Arabic Vowels)\n");
 	fprintf (stderr, "  l (Lemmas), s (Scripture Crossrefs), r (Arabic Shaping),\n");
 	fprintf (stderr, "  b (Bi-Directional Reordering), w (Red Words of Christ),\n");
-	fprintf (stderr, "  g (Glosses/Ruby), e (Word Enumerations),\n");
+	fprintf (stderr, "  g (Glosses/Ruby), e (Word Enumerations), i (Intros)\n");
 	fprintf (stderr, "  x (Encoded Transliterations), t (Algorithmic Transliterations via ICU),\n");
 	fprintf (stderr, "  M (morpheme segmentation)\n");
 
@@ -179,6 +179,8 @@
 					optionfilters |= OP_XLIT;
 				if (strchr(argv[i], 'e'))
 					optionfilters |= OP_ENUM;
+				if (strchr(argv[i], 'i'))
+					optionfilters |= OP_INTROS;
 				if (strchr(argv[i], 't'))
 					optionfilters |= OP_TRANSLITERATOR;
 				if (strchr(argv[i], 'M'))




More information about the sword-cvs mailing list