diff options
Diffstat (limited to 'check_checkers.py')
-rwxr-xr-x | check_checkers.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/check_checkers.py b/check_checkers.py index f6d2a9b..fd4472e 100755 --- a/check_checkers.py +++ b/check_checkers.py @@ -191,7 +191,14 @@ def run( .unexpected {background: #ffd2d0} th {position: sticky; top: 0; background: #e8e8e8;} table {border-spacing: 0;} - </style>''' + td:target {background: #ffffc3;} + + html { + /* prevent sticky table header from overlapping table cell targeted via #anchor */ + scroll-padding-top: 60px; + } + </style> + ''' ) out.write('<table border=1>') @@ -228,8 +235,8 @@ def run( 'checker_results': checker_results, } - out.write('<tr>') - out.write('<td>') + anchor = html.escape(puzzle.rsplit('/', maxsplit=1)[1]).replace('.py', '').replace('_', '-') + out.write('<tr><td id="{0}"><a href="#{0}">{0}</a>'.format(anchor)) with open(puzzle) as f: code = f.read() out.write(highlight(code, python_lexer, html_formatter)) |