create output that at least vaguely resembles XHTML.

2006-09-22  Sven Neumann  <sven@gimp.org>

	* plug-ins/pygimp/plug-ins/colorxhtml.py: create output that at
	least vaguely resembles XHTML.
This commit is contained in:
Sven Neumann 2006-09-22 11:48:58 +00:00 committed by Sven Neumann
parent 7275f398ed
commit d79ec4556a
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2006-09-22 Sven Neumann <sven@gimp.org>
* plug-ins/pygimp/plug-ins/colorxhtml.py: create output that at
least vaguely resembles XHTML.
2006-09-22 Sven Neumann <sven@gimp.org> 2006-09-22 Sven Neumann <sven@gimp.org>
* plug-ins/pygimp/plug-ins/colorxhtml.py: pass the correct function * plug-ins/pygimp/plug-ins/colorxhtml.py: pass the correct function

View File

@ -44,18 +44,19 @@ style_def = """body {
} }
""" """
preamble = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> preamble = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html> <html>
<head> <head>
<title>css color html by The GIMP</title> <title>CSS Color XHTML written by GIMP</title>
%s %s
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head> </head>
<body> <body>
<pre> <pre>
""" """
postamble = """\n</pre>\n</html>\n""" postamble = """\n</pre>\n</body>\n</html>\n"""
def colorxhtml(img, drawable, filename, raw_filename, def colorxhtml(img, drawable, filename, raw_filename,
source_type, characters, size, separate): source_type, characters, size, separate):
@ -108,7 +109,7 @@ def colorxhtml(img, drawable, filename, raw_filename,
style = style_def % size style = style_def % size
if separate: if separate:
ss = '<link rel="stylesheet" type="text/css" href="%s">' % cssfile ss = '<link rel="stylesheet" type="text/css" href="%s" />' % cssfile
css.write(style) css.write(style)
else: else:
ss = '<style type="text/css">\n%s</style>' % style ss = '<style type="text/css">\n%s</style>' % style