コード例 #1
0
	def lookupref(self, ref, target):
		if ref in self.references.keys():
			return self.references[ref]
			
		if self.refpar is not None:
			self.refpar.addprevious(docx.paragraph(target, style='EUReference'))
		self.references[ref] = len(self.references) + 1
		return self.references[ref]
コード例 #2
0
	def ulistitem(self, line):
		# print line
		
		result = rx_line["ulist"].match(line)
		if result is not None:
			indent = len(result.group(1))
			level = indent / 2
			lineparts = self.processwikitext(result.group(2))
			return docx.paragraph(lineparts, style='EUListBullet1')
		else:
			return None
コード例 #3
0
    def ulistitem(self, line):
        # print line

        result = rx_line["ulist"].match(line)
        if result is not None:
            indent = len(result.group(1))
            level = indent / 2
            lineparts = self.processwikitext(result.group(2))
            return docx.paragraph(lineparts, style='EUListBullet1')
        else:
            return None
コード例 #4
0
	def pre(self, lines):
		return docx.paragraph(lines, style='EUCode')
コード例 #5
0
	def paragraph(self, lines):
		parparts = []
		for l in lines:
			parparts += self.processwikitext(l)
		return docx.paragraph(parparts, style='EUNormal')
コード例 #6
0
 def docx_add_figure(self,imagefilename,description):
     self.docx['relationships'], picpara = docx.picture(self.docx['relationships'], imagefilename,
                                      description)
     self.docx['body'].append(docx.pagebreak(type='page', orient='portrait'))
     self.docx['body'].append(picpara)
     self.docx['body'].append(docx.paragraph(description))
コード例 #7
0
 def docx_add_paragraph(self,paragraphtext):
     self.docx['body'].append(docx.paragraph(paragraphtext))
コード例 #8
0
 def pre(self, lines):
     return docx.paragraph(lines, style='EUCode')
コード例 #9
0
 def paragraph(self, lines):
     parparts = []
     for l in lines:
         parparts += self.processwikitext(l)
     return docx.paragraph(parparts, style='EUNormal')