Esempio n. 1
0
    def startDocument(self):
        OsisHandler.startDocument(self)
        self._endDfn = False
        self._glossTitleWritten = False
        self._headerProcessed = False
        self._inArticle = False
        self._inChapterTitle = False
        self._inDfn = False
        self._foundGlossaryDiv = False
        self._inChapter = False
        self._entryTocLevel = 2 
        self._defaultHeaderLevel = 3                    # Avoid header level 2 as this would appear in table of contents
        
        # Select appropriate setting for FB2 for whether individual entries should be in the toc       
        if self._context.outputFmt == 'fb2':
            self._context.config.glossEntriesInToc = self._context.config.glossEntriesInTocFb2;
            
            if self._context.config.glossEntriesInToc:
                self._keywordTag = 'h4'

        # If there are multiple glossaries and Testament headers are used,
        # create an overall title for the glossaries at the Testament level if title is set in config
        if len(self._context.glossaries) > 1 and self._context.topHeaderLevel == 1 and self._context.config.glossTitleSet:
            self._htmlWriter.open('glossary.txt')
            self._htmlWriter.write('<h1>%s</h1>\n' % self._context.config.glossaryTitle)
            self._htmlWriter.close()
            self._context.topHeaderLevel = 2
Esempio n. 2
0
 def startDocument(self):
     OsisHandler.startDocument(self)
     self._bibleHtmlOpen = False
     self._bibleIntroWritten = False
     self._bibleStarting = True
     self._bookHtmlOpen = False
     self._bookTitle = ''
     self._canonicalTitleWritten = False
     self._chapterTitle = ''
     self._chFootnoteMarker = ''
     self._chNumWritten = False
     self._chHeadingWritten = False
     self._firstBook = True
     self._groupEmpty = False
     self._groupHtmlOpen = False
     self._groupIndex = 0
     self._inCanonicalTitle = False
     self._inChapterTitle = False
     self._ignoreChEnd = False
     self._ignoreDivEnd = False
     self._inFootnoteRef = False
     self._inIntro = False
     self._introDivTextFound = False
     self._introStyleStarted = False
     self._introText = ''
     self._introTextFound = False
     self._introTitleWritten = False
     self._inVerse = False 
     self._psDivTitle = False
     self._psDivTitleFound = False
     self._readyForSubtitle = False
     self._verseNumWritten = False
     self._verseText = ''
     self._verseTextFound = False
     self._defaultHeaderLevel = 3