def create_dialect(dialect_base, **kw_args):
    """Factory function for dialect objects (for parameter defaults,
    see :func:`~creoleparser.dialects.creole10_base` and/or
    :func:`~creoleparser.dialects.creole11_base`)

    :parameters:
      add_heading_ids
        If `True`, user friendly, lowercase, unique, id attributes will be
        automatically added to headings. To prevent clashes with other page
        ids, all will be prefixed with a "!". This prefix may be changed by
        passing a string rather than a boolean. *``environ`` needs to be a
        dicionary-like object for this to function*
        (see :meth:`creoleparser.core.Parser.parse`) and a key named `ids`
        will be added.
      argument_parser
        Parser used for automatic parsing of macro arg strings. Must take a
        single string argument and return a two-tuple with the first element
        a list (for positional arguments) and the second a dictionary (for
        keyword arguments). A default is supplied. Individual macros may
        override this parser by providing their own as a function attribute
        named `arg_parser`.
      blog_style_endings
        If `True`, each newline character in a paragraph will be converted to
        a <br />. Note that the escaping mechanism (tilde) does not work
        for newlines.
      bodied_macros
        Dictionary of macros (functions). If a bodied macro is found that is not
        in this dictionary, ``macro_func`` (below) will be called instead. Each
        function must accept the following positional arguments:

        1. macro object. This dictionary-like object has attributes
           ``macro_name``, ``body``,
           ``isblock``, and ``arg_string`` (see ``macro_func`` (below) for more
           information). Additionally, the macro object has a ``parsed_body()``
           method, that will return the parsed ``macro.body`` as a
           genshi.Fragment. ``parsed_body()`` takes an optional ``context``
           argument, that defaults to `auto`, see :meth:`creoleparser.core.Parser.parse`
           for other possible values.
        2. the `environ` object (see :meth:`creoleparser.core.Parser.parse`)

        If the found macro includes arguments, they will be included in
        the function call. Creoleparser will handle exceptions by returning an
        error message in place of the macro (possibly including a traceback).
        Python's syntax for accepting arbitrary arguments is often used for
        macros (e.g.,def mymacro(macro, env, \\*pos, \\**kw)).   

        For information on return values, see macro_func (below).
      non_bodied_macros
        Same as ``bodied_macros`` but used for non-bodied macros.        
      custom_markup
        List of tuples that can each define arbitrary custom wiki markup such
        as WikiWords and emoticons. Each tuple must have two elements,
        as follows:

        1. Compiled regular expression or string (*not* an re pattern) to match.
        2. Function that takes two postional arguments, as follows:

           1. the match object
           2. the `environ` object (see :meth:`creoleparser.core.Parser.parse`)

           The function must return a Genshi object (Stream, Markup,
           builder.Fragment, or builder.Element). Returning a string will
           raise an error.

        As a shortcut for simple cases, the second tuple element may be
        a string rather than a function. The string will be wrapped in a Markup
        object (to allow pass-through of HTML) and a Fragment object (to prevent
        Creoleparser from creating a new paragraph). 
      dialect_base
        The class factory to use for creating the dialect object.
        ``creoleparser.dialects.creole10_base`` and  
        ``creoleparser.dialects.creole11_base`` are possible values.
      disable_external_content
        If True, an error message will be inserted when an externally
        hosted image is found.
      external_links_class
        Class attribute to add to external links (i.e., not wiki or interwiki
        links).
      indent_class
        Class attribute to add to indented regions.
      indent_style
        Style attribute to add to indented regions.
      interwiki_links_base_urls
        Dictionary of urls for interwiki links. Works like
        ``wiki_links_base_url``.
      interwiki_links_class_funcs
        Dictionary of functions that will be called for interwiki link
        names and return class attributes. Works like
        ``wiki_links_class_func``.
      interwiki_links_path_funcs
        Dictionary of functions that will be called for interwiki link
        names and return url paths. Works like ``wiki_links_path_func``.
      interwiki_links_space_chars
        Dictionary of characters that that will be used to replace spaces
        that occur in interwiki_links. Works like ``wiki_links_space_char``.
        If no key is present for an interwiki name, the
        ``wiki_links_space_char`` will be used. 
      macro_func
        If supplied, this fuction will be called when macro markup is found,
        unless the macro is in one of macro dictionaries above. The
        function must accept the following postional arguments:
        
        1. macro name (string)
        2. the argument, including any delimter (string)
        3. the macro body (string or None for a macro without a body)
        4. macro type (boolean, True for block macros, False for normal macros)
        5. the `environ` object (see :meth:`creoleparser.core.Parser.parse`)
        
        The function may return a string (which will be subject to further wiki
        processing) or a Genshi object (Stream, Markup, builder.Fragment, or
        builder.Element). If None is
        returned, the markup will be rendered unchanged.
      no_wiki_monospace
        If `False`, inline no_wiki will be rendered as <span> not <code>
      simple_markup
        List of tuples that each define markup such as `strong` and `em`
        that can nest. Each tuple must have two elements, as follows:

        1. String to match start and end of text to be enclosed. 
        2. HTML tag

      wiki_links_base_url
        The page name found in wiki links will be smartly appended to this to
        form the href. To use a different base url for images, supply a two
        element list; the second element will be used.
      wiki_links_class_func
        If supplied, this fuction will be called when a wiki link is found and
        the return value (should be a string) will be added as a class attribute
        of the corresponding link. The function must accept the page name (any
        spaces will have been replaced) as it's only argument.
        If no class attribute is to be added, return `None`.
      wiki_links_path_func
        If supplied, this fuction will be called when a wiki link is found and
        the return value (should be a string) will be joined to the base_url
        to form the url for href. The function must accept the page name (any
        spaces will have been replaced) as it's only argument. Special characters
        should be url encoded. To use a different function for images, supply a
        two element list; the second element will be used.
      wiki_links_space_char
        When wiki_links have spaces, this character replaces those spaces in
        the url. To use a different character for images, supply a two element
        list; the second element will be used.
 
    """

    if 'interwiki_links_funcs' in kw_args:
        warnings.warn("""
The "interwiki_links_funcs" parameter has been renamed
to "interwiki_links_path_funcs"
""")
        kw_args.setdefault('interwiki_links_path_funcs',kw_args.pop('interwiki_links_funcs'))
    return dialect_base(**kw_args)
dataset/ETHPy150Open timonwong/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/python2/creoleparser/dialects.py/create_dialect/original