From f7f4c93a41aa6dec0f2ebf06b6240c30d24fe5ee Mon Sep 17 00:00:00 2001 From: James Teh Date: Tue, 14 Jun 2011 13:31:14 +1000 Subject: [PATCH] t2t docs: Move the NVDA_VERSION, NVDA_URL and NVDA_COPYRIGHT_YEARS macros out of global.t2tConf and instead have scons generate a file containing them using the versionInfo module. 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 | 11 ++++++++++- user_docs/global.t2tconf | 7 ++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/sconstruct b/sconstruct index fa82e9612..97f89d465 100755 --- a/sconstruct +++ b/sconstruct @@ -126,12 +126,21 @@ for lang in os.listdir(userDocsDir.path): for ug in glob(os.path.join(userDocsDir.path,lang,'userGuide.t2t')): env.keyCommandsDoc(File(ug).File('keyCommands.t2t'),ug) +t2tBuildConf = env.Textfile(userDocsDir.File("build.t2tConf"), [ + # We need to do this one as PostProc so it gets converted for the title. + r"%!PostProc: NVDA_VERSION {}".format(versionInfo.version), + r"%!PreProc: NVDA_URL {}".format(versionInfo.url), + r"%!PreProc: NVDA_COPYRIGHT_YEARS {}".format(versionInfo.copyrightYears), +]) + #Allow all t2t files to be converted to html in user_docs #As we use scons Glob this will also include the keyCommands.t2t files for t2tFile in env.Glob(os.path.join(userDocsDir.path,'*','*.t2t')): - #txt2tags can not be run in parallel so make sure scons knows this htmlFile=env.txt2tags(t2tFile) + #txt2tags can not be run in parallel so make sure scons knows this env.SideEffect('_txt2tags',htmlFile) + # All of our t2t files require build.t2tConf. + env.Depends(htmlFile,t2tBuildConf) #And also build the developer guide -- which must be moved at some point htmlFile=env.txt2tags('developerGuide.t2t') env.SideEffect('_txt2tags',htmlFile) diff --git a/user_docs/global.t2tconf b/user_docs/global.t2tconf index f47695b30..64a5dfe9d 100644 --- a/user_docs/global.t2tconf +++ b/user_docs/global.t2tconf @@ -18,8 +18,5 @@ % Therefore, strip the BOM from the title. %!PostProc(html): \<(TITLE|H1)\>\xef\xbb\xbf <\1> -% Language neutral defines -% We need to do this one as PostProc so it gets converted for the title. -%!PostProc: NVDA_VERSION 2011.1 -%!PreProc: NVDA_URL http://www.nvda-project.org/ -%!PreProc: NVDA_COPYRIGHT_YEARS 2006-2011 +% This provides the macros NVDA_VERSION, NVDA_URL and NVDA_COPYRIGHT_YEARS. +%!includeconf: build.t2tconf -- 2.11.0