newpage()   A
last analyzed

Complexity

Conditions 3

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
c 1
b 0
f 0
dl 0
loc 4
rs 10
1
#!/usr/bin/env python
2
3
"""
4
Pandoc filter for converting horizontal rule to new page in LaTeX
5
"""
6
7
from panflute import *
8
9
def newpage(elem, doc):
10
    # Is it in the right format and is it an HorizontalRule?
11
    if doc.format == 'latex' and isinstance(elem, HorizontalRule):
12
        return RawBlock('\\cleardoublepage', 'tex')
13
14
def main(doc = None):
15
    return run_filter(newpage, doc = doc)
16
17
if __name__ == '__main__':
18
    main()
19
20