def process_link(self, env, refnode, has_explicit_title, title, target):
    if has_explicit_title:
      raise ReSTError("Setting explicit title is not allowed for man pages")

    # Check format and extract name and section
    m = _MAN_RE.match(title)
    if not m:
      raise ReSTError("Man page reference '%s' does not match regular"
                      " expression '%s'" % (title, _MAN_RE.pattern))

    name = m.group("name")
    section = int(m.group("section"))

    wanted_section = _constants.MAN_PAGES.get(name, None)

    if not (wanted_section is None or wanted_section == section):
      raise ReSTError("Referenced man page '%s' has section number %s, but the"
                      " reference uses section %s" %
                      (name, wanted_section, section))

    self.converted = bool(wanted_section is not None and
                          env.app.config.enable_manpages)

    if self.converted:
      # Create link to known man page
      return (title, "man-%s" % name)
    else:
      # No changes
      return (title, target)
Return a LDM instruction.
dataset/ETHPy150Open ganeti/ganeti/lib/build/sphinx_ext.py/_ManPageXRefRole.process_link--crossover with--dataset/ETHPy150Open programa-stic/barf-project/barf/barf/core/reil/reil.py/ReilInstructionBuilder.gen_ldm