Skip to content

Navigation Menu

Sign in
Sign up

How to change title of presentation? #550

Unanswered
luciochavez asked this question in Q&A
Discussion options

The html has following text:
`<!doctype html>

<title>Untitled</title>` How can i change the "Untitled" title from Sozi?
You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

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).

You must be logged in to vote
2 replies
Comment options

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.

Comment options

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /