File: header-level-1.py

package info (click to toggle)
panflute 2.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,048 kB
  • sloc: python: 3,918; makefile: 13
file content (15 lines) | stat: -rw-r--r-- 239 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""
Set all headers to level 1
"""

from panflute import *

def action(elem, doc):
    if isinstance(elem, Header):
        elem.level = 1

def main(doc=None):
    return run_filter(action, doc=doc) 

if __name__ == '__main__':
    main()