-
Notifications
You must be signed in to change notification settings - Fork 178
How to change title of presentation? #550
Unanswered
luciochavez
asked this question in
Q&A
The html has following text:
`<!doctype html>
All reactions
Replies: 1 comment 2 replies
The title of the presentation is taken from the SVG document.
If you are using Inkscape, you can edit the title in the document's metadata (File / Document properties / Metadata).
All reactions
2 replies
The issue is that draw.io doesn't support title in an SVG file.
As a workaround, one can add <title>My Title</title> just after the root <svg ....> node in the SVG file (at the risk of breaking one's XML file). It doesn't break the SVG for draw.io but it gets lost after each edit.
All reactions
It's a crude approach with regexp but I wrote a small script to "patch" SVG files created by drawio:
#!/usr/bin/python3 # add a title to an SVG document and a _blank target to all external hyperlinks # because drawio doesn't do it itself (and sozi appreciates it). # 0ドル <svg-file> "<title>" import re import sys re_svg = re.compile(r"(<svg [^>]*>)(<title>[^<]*</title>)?") re_target = re.compile(r' target="_[a-z]+"') re_a = re.compile(r'(<a [^>]*href="[^#][^>]*)( target="_blank")?>') with open(sys.argv[1], "r") as f: svg = f.read() svg = re_svg.sub(r"1円<title>" + sys.argv[2] + r"</title>", svg, count=1) svg = re_target.sub("", svg) # remove targets svg = re_a.sub(r'1円 target="_blank">', svg) with open(sys.argv[1], "w") as f: f.write(svg)
All reactions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment