Added underscore on hover css style to generated SVG diagram links

This commit is contained in:
Bartek Kryza
2022-03-31 18:42:04 +02:00
parent 9047511cf9
commit dba17ab622
51 changed files with 1349 additions and 1292 deletions

View File

@@ -20,6 +20,7 @@
import sys
from lxml import etree
import lxml.html
def main(argv):
if len(argv) < 1:
@@ -35,6 +36,12 @@ def main(argv):
# Parse SVG XML
tree = etree.fromstring(bytes(xml, encoding='utf8'))
# Add style color for <a> links
defs = tree.xpath('//svg:defs', namespaces={'svg':'http://www.w3.org/2000/svg'})[0]
style = etree.SubElement(defs, 'style')
style.text = 'a:hover { text-decoration: underline; }'
style.set('type', 'text/css')
# Remove comments from SVG, to minimize diff
# when updating diagrams in Git
comments = tree.xpath('//comment()')