# Path: panflute/elements.py
# class Header(Block):
#     """Header
# 
#     :param args: contents of the header
#     :type args: :class:`Inline`
#     :param level: level of the header (1 is the largest and 6 the smallest)
#     :type level: ``int``
#     :param identifier: element identifier (usually unique)
#     :type identifier: :class:`str`
#     :param classes: class names of the element
#     :type classes: :class:`list` of :class:`str`
#     :param attributes: additional attributes
#     :type attributes: :class:`dict`
#     :Base: :class:`Block`
# 
#     :Example:
# 
#         >>> title = [Str('Monty'), Space, Str('Python')]
#         >>> header = Header(*title, level=2, identifier='toc')
#         >>> header.level += 1
#      """
#     __slots__ = ['level', '_content', 'identifier', 'classes', 'attributes']
#     _children = ['content']
# 
#     def __init__(self, *args, level=1,
#                  identifier='', classes=[], attributes={}):
#         self.level = check_type(level, int)
#         if not 0 < self.level <= 10:
#             raise TypeError('Header level not between 1 and 10')
#         self._set_ica(identifier, classes, attributes)
#         self._set_content(args, Inline)
# 
#     def _slots_to_json(self):
#         return [self.level, self._ica_to_json(), self.content.to_json()]
# 
# Path: panflute/io.py
# def run_filter(action, *args, **kwargs):
#     """
#     Wrapper for :func:`.run_filters`
# 
#     Receive a Pandoc document from stdin, apply the *action* function to each element, and write it back to stdout.
# 
#     See :func:`.run_filters`
#     """
#     return run_filters([action], *args, **kwargs)


from panflute import run_filter, Header


def increase_header_level(elem, doc):
    if type(elem)==Header:
        if elem.level < 6:
            elem.level += 1
        else:
            return []


def main(doc=None):

# Path: panflute/elements.py
# class Header(Block):
#     """Header
# 
#     :param args: contents of the header
#     :type args: :class:`Inline`
#     :param level: level of the header (1 is the largest and 6 the smallest)
#     :type level: ``int``
#     :param identifier: element identifier (usually unique)
#     :type identifier: :class:`str`
#     :param classes: class names of the element
#     :type classes: :class:`list` of :class:`str`
#     :param attributes: additional attributes
#     :type attributes: :class:`dict`
#     :Base: :class:`Block`
# 
#     :Example:
# 
#         >>> title = [Str('Monty'), Space, Str('Python')]
#         >>> header = Header(*title, level=2, identifier='toc')
#         >>> header.level += 1
#      """
#     __slots__ = ['level', '_content', 'identifier', 'classes', 'attributes']
#     _children = ['content']
# 
#     def __init__(self, *args, level=1,
#                  identifier='', classes=[], attributes={}):
#         self.level = check_type(level, int)
#         if not 0 < self.level <= 10:
#             raise TypeError('Header level not between 1 and 10')
#         self._set_ica(identifier, classes, attributes)
#         self._set_content(args, Inline)
# 
#     def _slots_to_json(self):
#         return [self.level, self._ica_to_json(), self.content.to_json()]
# 
# Path: panflute/io.py
# def run_filter(action, *args, **kwargs):
#     """
#     Wrapper for :func:`.run_filters`
# 
#     Receive a Pandoc document from stdin, apply the *action* function to each element, and write it back to stdout.
# 
#     See :func:`.run_filters`
#     """
#     return run_filters([action], *args, **kwargs)


# Path: examples/panflute/headers.py
from panflute import run_filter, Header



def increase_header_level(elem, doc):
    if type(elem)==Header:
        if elem.level < 6:
            elem.level += 1
        else:
            return []


def main(doc=None):

    return run_filter(increase_header_level, doc=doc)