function createExamplePage(pageRoot, pagePath, demoConfig, isLocal) {
  const initialContents = fs
    .readFileSync(path.join(pageRoot, pagePath))
    .toString();

  let contents = injectHeader(initialContents, demoConfig.title, isLocal);
  contents = injectExampleNavBar(contents, demoConfig, pageRoot, isLocal);
  contents = injectFooter(contents);

  const outputPath = path.join('gh-pages', pageRoot, pagePath);
  fs.mkdirSync(path.dirname(outputPath), {recursive: true});
  fs.writeFileSync(outputPath, contents, 'utf-8');
}
Inject appropriate headers and footers into the input HTML page so
that it will display nicely on gh-pages. This includes a
devsite-style header and footer, links to the source files, and links
to other files within the same demo package.
@param {string} pageRoot The directory of the example that is currently
    being prepared (e.g. examples/interpreter-demo).
@param {string} pagePath The path of the page to create within the example's
    directory (e.g. index.html).
@param {!Object} demoConfig The contents of the blocklyDemoConfig object
    in the example's package.json.
@param {boolean} isLocal True if building for a local test. False if
    building for gh-pages.