@classmethod
def extract_templates(cls, file_=None, source=None, tag=None, is_re=False,
    ignore_mark=False, export=False):
    """Extract template.

        # @:adhoc_template_check:@ -mark
        A template ...
        # @:adhoc_template_check:@

        # @:adhoc_template_check:@ -other
        Another interleaved
        # @:adhoc_template_check:@

        # @:adhoc_template_check:@ -mark
        continued
        # @:adhoc_template_check:@

        >>> AdHoc.extract_templates(
        ...     tag=AdHoc.section_tag("adhoc_template_check"))
                A template ...
                continued
                Another interleaved

        >>> rt_section = AdHoc.get_templates(
        ...     __file__, None,
        ...     tag=AdHoc.section_tag("adhoc_run_time_section"),
        ...     ignore_mark=True)
        >>> rt_section = ''.join(rt_section.values())

        .. >>> printf(rt_section)
        """
    file_, source, tag, is_re = cls.std_template_param(file_, source, tag,
        is_re)
    templates = cls.get_templates(file_, source, tag, is_re=is_re,
        ignore_mark=ignore_mark)
    sv_extract_warn = cls.extract_warn
    cls.extract_warn = True
    for outf, template in sorted(templates.items()):
        if outf.startswith('-'):
            outf = '-'
        if outf == '-' and export:
            continue
        xfile = cls.check_xfile(outf, cls.extract_dir)
        if xfile is not None:
            cls.write_source(xfile, template)
    cls.extract_warn = sv_extract_warn
