示例#1
0
    def __init__(self, builder, *args, **kwds):
        BaseTranslator.__init__(self, builder, *args, **kwds)
        self.builder = builder

        self.in_productionlist = 0

        # first title is the manpage title
        self.section_level = -1

        # docinfo set by man_pages config value
        self._docinfo['title'] = self.document.settings.title
        self._docinfo['subtitle'] = self.document.settings.subtitle
        if self.document.settings.authors:
            # don't set it if no author given
            self._docinfo['author'] = self.document.settings.authors
        self._docinfo['manual_section'] = self.document.settings.section

        # docinfo set by other config values
        self._docinfo['title_upper'] = self._docinfo['title'].upper()
        if builder.config.today:
            self._docinfo['date'] = builder.config.today
        else:
            self._docinfo['date'] = ustrftime(builder.config.today_fmt
                                              or _('%B %d, %Y'))
        self._docinfo['copyright'] = builder.config.copyright
        self._docinfo['version'] = builder.config.version
        self._docinfo['manual_group'] = builder.config.project

        # since self.append_header() is never called, need to do this here
        self.body.append(MACRO_DEF)

        # overwritten -- don't wrap literal_block with font calls
        self.defs['literal_block'] = ('.sp\n.nf\n', '\n.fi\n')
示例#2
0
    def __init__(self, builder, *args, **kwds):
        BaseTranslator.__init__(self, builder, *args, **kwds)
        self.builder = builder

        self.in_productionlist = 0

        # first title is the manpage title
        self.section_level = -1

        # docinfo set by man_pages config value
        self._docinfo['title'] = self.document.settings.title
        self._docinfo['subtitle'] = self.document.settings.subtitle
        if self.document.settings.authors:
            # don't set it if no author given
            self._docinfo['author'] = self.document.settings.authors
        self._docinfo['manual_section'] = self.document.settings.section

        # docinfo set by other config values
        self._docinfo['title_upper'] = self._docinfo['title'].upper()
        if builder.config.today:
            self._docinfo['date'] = builder.config.today
        else:
            self._docinfo['date'] = strftime(builder.config.today_fmt
                                             or _('%B %d, %Y'))
        self._docinfo['copyright'] = builder.config.copyright
        self._docinfo['version'] = builder.config.version
        self._docinfo['manual_group'] = builder.config.project

        # overwritten -- don't wrap literal_block with font calls
        self.defs['literal_block'] = ('.sp\n.nf\n', '\n.fi\n')
 def visit_reference(self, node):
     if node.children and isinstance(node[0], nodes.literal):
         if 'std-option' in node[0].get('classes', ''):
             # prevent ignoring nested option node
             raise nodes.SkipDeparture
     ManualPageTranslator.visit_reference(self, node)
 def __init__(self, builder, *args, **kwds):
     ManualPageTranslator.__init__(self, builder, *args, **kwds)
     self.option_context = []
 def visit_reference(self, node):
     if node.children and isinstance(node[0], nodes.literal):
         if "std-option" in node[0].get("classes", ""):
             # prevent ignoring nested option node
             raise nodes.SkipDeparture
     ManualPageTranslator.visit_reference(self, node)
 def __init__(self, builder, *args, **kwds):
     ManualPageTranslator.__init__(self, builder, *args, **kwds)
     self.option_context = []