當前位置: 首頁>>代碼示例>>Python>>正文


Python html4css1.HTMLTranslator方法代碼示例

本文整理匯總了Python中docutils.writers.html4css1.HTMLTranslator方法的典型用法代碼示例。如果您正苦於以下問題:Python html4css1.HTMLTranslator方法的具體用法?Python html4css1.HTMLTranslator怎麽用?Python html4css1.HTMLTranslator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在docutils.writers.html4css1的用法示例。


在下文中一共展示了html4css1.HTMLTranslator方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from docutils.writers import html4css1 [as 別名]
# 或者: from docutils.writers.html4css1 import HTMLTranslator [as 別名]
def __init__(self, *args):
        html4css1.HTMLTranslator.__init__(self, *args)
        #insert S5-specific stylesheet and script stuff:
        self.theme_file_path = None
        self.setup_theme()
        view_mode = self.document.settings.view_mode
        control_visibility = ('visible', 'hidden')[self.document.settings
                                                   .hidden_controls]
        self.stylesheet.append(self.s5_stylesheet_template
                               % {'path': self.theme_file_path,
                                  'view_mode': view_mode,
                                  'control_visibility': control_visibility})
        if not self.document.settings.current_slide:
            self.stylesheet.append(self.disable_current_slide)
        self.add_meta('<meta name="version" content="S5 1.1" />\n')
        self.s5_footer = []
        self.s5_header = []
        self.section_count = 0
        self.theme_files_copied = None 
開發者ID:skarlekar,項目名稱:faces,代碼行數:21,代碼來源:__init__.py

示例2: visit_subtitle

# 需要導入模塊: from docutils.writers import html4css1 [as 別名]
# 或者: from docutils.writers.html4css1 import HTMLTranslator [as 別名]
def visit_subtitle(self, node):
        if isinstance(node.parent, nodes.section):
            level = self.section_level + self.initial_header_level - 1
            if level == 1:
                level = 2
            tag = 'h%s' % level
            self.body.append(self.starttag(node, tag, ''))
            self.context.append('</%s>\n' % tag)
        else:
            html4css1.HTMLTranslator.visit_subtitle(self, node) 
開發者ID:skarlekar,項目名稱:faces,代碼行數:12,代碼來源:__init__.py

示例3: visit_title

# 需要導入模塊: from docutils.writers import html4css1 [as 別名]
# 或者: from docutils.writers.html4css1 import HTMLTranslator [as 別名]
def visit_title(self, node):
        html4css1.HTMLTranslator.visit_title(self, node) 
開發者ID:skarlekar,項目名稱:faces,代碼行數:4,代碼來源:__init__.py

示例4: depart_field_list

# 需要導入模塊: from docutils.writers import html4css1 [as 別名]
# 或者: from docutils.writers.html4css1 import HTMLTranslator [as 別名]
def depart_field_list(self, node):
        html4css1.HTMLTranslator.depart_field_list(self, node)
        if 'rfc2822' in node['classes']:
             self.body.append('<hr />\n') 
開發者ID:skarlekar,項目名稱:faces,代碼行數:6,代碼來源:__init__.py

示例5: starttag

# 需要導入模塊: from docutils.writers import html4css1 [as 別名]
# 或者: from docutils.writers.html4css1 import HTMLTranslator [as 別名]
def starttag(self, node, tagname, suffix='\n', empty=False, **attributes):
            """ Ensures all links to outside this instance of INGInious have target='_blank' """
            if tagname == 'a' and "href" in attributes and not attributes["href"].startswith('#'):
                attributes["target"] = "_blank"
            if 'path' in web.ctx and '/lti/' in web.ctx.path:
                if tagname == 'a' and 'href' in attributes:
                    attributes['href'] = self.rewrite_lti_url(attributes['href'])
                elif tagname == 'img' and 'src' in attributes:
                    attributes['src'] = self.rewrite_lti_url(attributes['src'])
            return html4css1.HTMLTranslator.starttag(self, node, tagname, suffix, empty, **attributes) 
開發者ID:UCL-INGI,項目名稱:INGInious,代碼行數:12,代碼來源:parsable_text.py


注:本文中的docutils.writers.html4css1.HTMLTranslator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。