1
1
# NVDA add-on template SCONSTRUCT file
2
- #Copyright (C) 2012
, 2014 Rui Batista
<[email protected] >
3
- #This file is covered by the GNU General Public License.
4
- #See the file COPYING.txt for more details.
2
+ # Copyright (C) 2012-2020 Rui Batista, Noelia Martinez, Joseph Lee
3
+ # This file is covered by the GNU General Public License.
4
+ # See the file COPYING.txt for more details.
5
5
6
6
import codecs
7
7
import gettext
@@ -27,13 +27,12 @@ def md2html(source, dest):
27
27
mdText = mdText.replace(k, v, 1)
28
28
htmlText = markdown.markdown(mdText)
29
29
with codecs.open(dest, "w", "utf-8") as f:
30
- f.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
31
- "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n" +
32
- " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n" +
33
- "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"%s\" lang=\"%s\">\n" % (lang, lang) +
30
+ f.write("<!DOCTYPE html>\n" +
31
+ "<html lang=\"%s\">\n" % lang +
34
32
"<head>\n" +
35
- "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\n" +
36
- "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" media=\"screen\"/>\n" +
33
+ "<meta charset=\"UTF-8\">\n" +
34
+ "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n" +
35
+ "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" media=\"screen\">\n" +
37
36
"<title>%s</title>\n" % title +
38
37
"</head>\n<body>\n"
39
38
)
@@ -71,6 +70,9 @@ elif env["version"] is not None:
71
70
if "channel" in env and env["channel"] is not None:
72
71
env["addon_updateChannel"] = env["channel"]
73
72
73
+ buildVars.addon_info["addon_version"] = env["addon_version"]
74
+ buildVars.addon_info["addon_updateChannel"] = env["addon_updateChannel"]
75
+
74
76
addonFile = env.File("${addon_name}-${addon_version}.nvda-addon")
75
77
76
78
def addonGenerator(target, source, env, for_signature):
@@ -120,8 +122,6 @@ def createAddonBundleFromPath(path, dest):
120
122
121
123
def generateManifest(source, dest):
122
124
addon_info = buildVars.addon_info
123
- addon_info["addon_version"] = env["addon_version"]
124
- addon_info["addon_updateChannel"] = env["addon_updateChannel"]
125
125
with codecs.open(source, "r", "utf-8") as f:
126
126
manifest_template = f.read()
127
127
manifest = manifest_template.format(**addon_info)
0 commit comments