Exemple #1
0
 def make_docs(self, log):
     self._in_docs_dir.cmd(["mkdir", "-p", "html"])
     site_map = release.site_map()
     def pandoc(filename, source_filename):
         last_modified = release.last_modified(source_filename,
                                               self._in_docs_dir)
         if filename == "download.txt":
             last_modified = time.gmtime()
         variables = [
             ("last_modified_iso",
              time.strftime("%Y-%m-%d", last_modified)),
             ("last_modified_month_year",
              time.strftime("%B %Y", last_modified))]
         page_name = os.path.splitext(os.path.basename(filename))[0]
         variables.append(("nav", release.nav_html(site_map, page_name)))
         variables.append(("subnav", release.subnav_html(site_map,
                                                         page_name)))
         release.pandoc(self._in_docs_dir, filename, variables=variables)
     release.empy(self._in_docs_dir, "forms.txt.in")
     release.empy(self._in_docs_dir, "download.txt.in",
                  defines=["version=%r" % str(self._release_version)])
     for page in site_map.iter_pages():
         if page.name in ["Root", "Changelog"]:
             continue
         source_filename = filename = page.name + ".txt"
         if page.name in ["forms", "download"]:
             source_filename += ".in"
         pandoc(filename, source_filename)
     self._in_repo.cmd(["cp", "-r", "ChangeLog", "docs/html/ChangeLog.txt"])
     if self._build_tools_path is not None:
         styles = release.ensure_trailing_slash(
             os.path.join(self._website_source_path, "styles"))
         self._env.cmd(["rsync", "-a", styles,
                        os.path.join(self._docs_dir, "styles")])
Exemple #2
0
 def make_docs(self, log):
     self._in_docs_dir.cmd(["mkdir", "-p", "html"])
     site_map = release.site_map()
     def pandoc(filename, source_filename):
         last_modified = release.last_modified(source_filename,
                                               self._in_docs_dir)
         if filename == "download.txt":
             last_modified = time.gmtime()
         variables = [
             ("last_modified_iso",
              time.strftime("%Y-%m-%d", last_modified)),
             ("last_modified_month_year",
              time.strftime("%B %Y", last_modified))]
         page_name = os.path.splitext(os.path.basename(filename))[0]
         variables.append(("nav", release.nav_html(site_map, page_name)))
         variables.append(("subnav", release.subnav_html(site_map,
                                                         page_name)))
         release.pandoc(self._in_docs_dir, filename, variables=variables)
     release.empy(self._in_docs_dir, "forms.txt.in")
     release.empy(self._in_docs_dir, "download.txt.in",
                  defines=["version=%r" % str(self._release_version)])
     for page in site_map.iter_pages():
         if page.name in ["Root", "Changelog"]:
             continue
         source_filename = filename = page.name + ".txt"
         if page.name in ["forms", "download"]:
             source_filename += ".in"
         pandoc(filename, source_filename)
     self._in_repo.cmd(["cp", "-r", "ChangeLog", "docs/html/ChangeLog.txt"])
     if self._build_tools_path is not None:
         styles = ensure_trailing_slash(
             os.path.join(self._website_source_path, "styles"))
         self._env.cmd(["rsync", "-a", styles,
                        os.path.join(self._docs_dir, "styles")])