1#!/usr/bin/env python3 2""" Reduce the top and bottom margins for <h2> to not waste so much vertical space in the manual pages """ 3 4import os 5import re 6import fileinput 7 8def fix_pydata_margins(root): 9 filename = os.path.join(root, '_static','styles','pydata-sphinx-theme.css') 10 with open(filename, 'r') as source: 11 str = source.read() 12 str = str.replace('var(--pst-font-size-h2)}','var(--pst-font-size-h2);margin-bottom:4px;margin-top:-5px}') 13 with open(filename,'w') as target: 14 target.write(str) 15