Last active
February 16, 2016 22:35
-
-
Save scoavoux/27e4ca56b4101a88313a to your computer and use it in GitHub Desktop.
Increases markdown headers of one level
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pandocfilters import toJSONFilter, Header | |
# proposed as an answer here http://stackoverflow.com/a/35341506/4132844 | |
def header_increase(key, value, format, meta): | |
if key == 'Header' and value[0] < 7: | |
value[0] = value[0] + 1 | |
return Header(value[0], value[1], value[2]) | |
if __name__ == "__main__": | |
toJSONFilter(header_increase) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment