OSDN Git Service

t2t docs: Move the NVDA_VERSION, NVDA_URL and NVDA_COPYRIGHT_YEARS macros out of...
authorJames Teh <jamie@jantrid.net>
Tue, 14 Jun 2011 03:31:14 +0000 (13:31 +1000)
committerJames Teh <jamie@jantrid.net>
Tue, 14 Jun 2011 03:31:14 +0000 (13:31 +1000)
This means that we no longer need to manually update global.t2tConf when one of these changes.
No change is required anywhere else, as global.t2tConf includes the build include (build.t2tConf).
Fixes #1450.

sconstruct
user_docs/global.t2tconf

index fa82e96..97f89d4 100755 (executable)
@@ -126,12 +126,21 @@ for lang in os.listdir(userDocsDir.path):
        for ug in glob(os.path.join(userDocsDir.path,lang,'userGuide.t2t')):\r
                env.keyCommandsDoc(File(ug).File('keyCommands.t2t'),ug)\r
 \r
+t2tBuildConf = env.Textfile(userDocsDir.File("build.t2tConf"), [\r
+       # We need to do this one as PostProc so it gets converted for the title.\r
+       r"%!PostProc: NVDA_VERSION {}".format(versionInfo.version),\r
+       r"%!PreProc: NVDA_URL {}".format(versionInfo.url),\r
+       r"%!PreProc: NVDA_COPYRIGHT_YEARS {}".format(versionInfo.copyrightYears),\r
+])\r
+\r
 #Allow all t2t files to be converted to html in user_docs\r
 #As we use scons Glob this will also include the keyCommands.t2t files\r
 for t2tFile in env.Glob(os.path.join(userDocsDir.path,'*','*.t2t')):\r
-       #txt2tags can not be run in parallel so make sure scons knows this\r
        htmlFile=env.txt2tags(t2tFile)\r
+       #txt2tags can not be run in parallel so make sure scons knows this\r
        env.SideEffect('_txt2tags',htmlFile)\r
+       # All of our t2t files require build.t2tConf.\r
+       env.Depends(htmlFile,t2tBuildConf)\r
 #And also build the developer guide -- which must be moved at some point\r
 htmlFile=env.txt2tags('developerGuide.t2t')\r
 env.SideEffect('_txt2tags',htmlFile)\r
index f47695b..64a5dfe 100644 (file)
@@ -18,8 +18,5 @@
 % Therefore, strip the BOM from the title.\r
 %!PostProc(html): \<(TITLE|H1)\>\xef\xbb\xbf <\1>\r
 \r
-% Language neutral defines\r
-% We need to do this one as PostProc so it gets converted for the title.\r
-%!PostProc: NVDA_VERSION 2011.1\r
-%!PreProc: NVDA_URL http://www.nvda-project.org/\r
-%!PreProc: NVDA_COPYRIGHT_YEARS 2006-2011\r
+% This provides the macros NVDA_VERSION, NVDA_URL and NVDA_COPYRIGHT_YEARS.\r
+%!includeconf: build.t2tconf\r