コード例 #1
0
ファイル: Docx2Html.py プロジェクト: madevelopers/pydocx
 def make_element(self, tag, contents='', attrs=None):
     if attrs:
         attrs = convert_dictionary_to_html_attributes(attrs)
         template = '<%(tag)s %(attrs)s>%(contents)s</%(tag)s>'
     else:
         template = '<%(tag)s>%(contents)s</%(tag)s>'
     return template % {
         'tag': tag,
         'attrs': attrs,
         'contents': contents,
     }
コード例 #2
0
ファイル: html.py プロジェクト: OmniaSolutions/pydocx
 def make_element(self, tag, contents='', attrs=None):
     if attrs:
         attrs = convert_dictionary_to_html_attributes(attrs)
         template = '<{tag} {attrs}>{contents}</{tag}>'
     else:
         template = '<{tag}>{contents}</{tag}>'
     return template.format(
         tag=tag,
         attrs=attrs,
         contents=contents,
     )
コード例 #3
0
 def make_element(self, tag, contents='', attrs=None):
     if attrs:
         attrs = convert_dictionary_to_html_attributes(attrs)
         template = '<{tag} {attrs}>{contents}</{tag}>'
     else:
         template = '<{tag}>{contents}</{tag}>'
     return template.format(
         tag=tag,
         attrs=attrs,
         contents=contents,
     )
コード例 #4
0
 def get_html_attrs(self):
     return convert_dictionary_to_html_attributes(self.attrs)
コード例 #5
0
ファイル: html.py プロジェクト: AndrewSallans/pydocx
 def get_html_attrs(self):
     return convert_dictionary_to_html_attributes(self.attrs)