Generate HTML demo page

@param {Function} done
9605
function generateDemoHtml(done) {
			if (!o.htmlDemo) {
				done();
				return;
			}

			var context = prepareHtmlTemplateContext();

			// Generate HTML
			var demoTemplate = readTemplate(o.htmlDemoTemplate, 'demo', '.html');
			var demo = renderTemplate(demoTemplate, context);

			mkdirp(getDemoPath(), function(err) {
				if (err) {
					logger.log(err);
					return;
				}
				// Save file
				fs.writeFileSync(getDemoFilePath(), demo);
				done();
			});

		}
1159371
def show
      respond_to do |format|
        format.html { render @page.template if @page.template.present? }
        format.json { render json: @page }
      end
    end
1178235
function (sLink) {
			if (sLink[0] === "#") {
				sLink = document.location.href.substring(0,document.location.href.search("demoapps\.html")) + sLink;
			}
			return sLink;
		}
259089
function render () {
  todosContainer.innerHTML = '<ul>' +
    todos.map(function (todo, index) {
      return '<li class="item">' +
        todo +
        ' <button class="remove-todo" data-index="' + index + '">X</button>' +
      '</li>'
    }).join('') +
  '</ul>'

  document.dispatchEvent(new Event('render-event'))
}
928940
def generate_html(store):
    
    spline = {
        'version': VERSION,
        'url': 'https://github.com/Nachtfeuer/pipeline',
        'generated': datetime.now().strftime("%A, %d. %B %Y - %I:%M:%S %p")
    }

    html_template_file = os.path.join(os.path.dirname(__file__), 'templates/report.html.j2')
    with open(html_template_file) as handle:
        html_template = handle.read()
        return render(html_template, spline=spline, store=store)
1010510
function(opts, done) {
    if (typeof opts !== 'object') {
      done = opts;
      opts = null;
    }
    validateCallback(done);
    this.parse(opts);
    this.renderCSS(done);
    return this;
  }
639079
function(file, file_done) {
    var item = {};
    item.file_path = path.join(nell_site[type_path_key], file);
    item.file_output = generateOutputDetails(nell_site, file, type);
    item.link = item.file_output.link_path;

    var processContent = concat(function(err, file_content_raw) {
      if (err) {
        return file_done(err);
      }
      item.file_content_raw = file_content_raw;
      item.file_metadata = mde.metadata(item.file_content_raw);
      item.file_content = mde.content(item.file_content_raw);

      async.series([
        function(callback) {
          processMarkdown(nell_site, item, callback);
        },
        function(callback) {
          nell_site[type_plural].push(item);
          callback();
        }
      ], file_done);
    });

    var fh = fs.createReadStream(item.file_path, {encoding: 'utf8'});
    fh.on('error', file_done);
    fh.pipe(processContent);
  }
960161
function(done) {
    var isSync = (typeof done !== 'function');
    var sass = require('node-sass');
    var opts = this.sassTemplateOptions();
    var self = this;

    if (isSync) {
      try {
        var result = sass.renderSync(opts);
        return this.fieldIdentifiersToInterpolations(result.css.toString());
      } catch (err) {
        throw formatSassError(err, opts.data);
      }
    }

    sass.render(opts, function(err, result) {
      if (err) return done(formatSassError(err, opts.data));
      done(null, self.fieldIdentifiersToInterpolations(result.css.toString()));
    });
  }
125888
function tag (msg, done) {
    var clean_data = {
      source: 'demo-plugin',
      payload: msg.payload
    }

    done(null, clean_data)
  }
592878
function done() {
      res.removeListener('finish', onfinish);
      res.removeListener('close', onclose);
      /* eslint no-underscore-dangle: 0 no-param-reassign: 0 */
      ctx.response._startAt = process.hrtime();
      try {
        const line = formatLine(morgan, ctx);
        /* eslint no-console:0 */
        console.info(line);
      } catch (err) {
        /* eslint no-console:0 */
        /* istanbul ignore next */
        console.error(err);
      }
    }
1040390
function onPage(output, page) {
    var options = output.getOptions();

    // Inline assets
    return Modifiers.modifyHTML(page, [
        Modifiers.inlineAssets(options.get('root'), page.getFile().getPath())
    ])

    // Write page using website generator
    .then(function(resultPage) {
        return WebsiteGenerator.onPage(output, resultPage);
    });
}
289650
function myFunction()
{
    var x="",i;
    for (i=1; i<=6; i++)
    {
        x=x + "<h" + i + ">Heading " + i + "</h" + i + ">";
    }
    document.getElementById("demo").innerHTML=x;
}
716546
function start_html() {
        global $OUTPUT;

        // Render button to allow user to reset table preferences.
        echo $this->render_reset_button();

        // Do we need to print initial bars?
        $this->print_initials_bar();

        // Paging bar
        if ($this->use_pages) {
            $pagingbar = new paging_bar($this->totalrows, $this->currpage, $this->pagesize, $this->baseurl);
            $pagingbar->pagevar = $this->request[TABLE_VAR_PAGE];
            echo $OUTPUT->render($pagingbar);
        }

        if (in_array(TABLE_P_TOP, $this->showdownloadbuttonsat)) {
            echo $this->download_buttons();
        }

        $this->wrap_html_start();
        // Start of main data table

        echo html_writer::start_tag('div', array('class' => 'no-overflow'));
        echo html_writer::start_tag('table', $this->attributes);

    }
1083911
function renderDoc(page, renderOpts) {
    if (generator.renderOpts !== defaultRenderOpts) return log(new Error('Recursive call to renderDoc'));
    var rOpts = generator.renderOpts = function() { return u.assign({}, defaultRenderOpts(page), renderOpts); };
    var out = renderTemplate(page, docTemplate(page), rOpts()); // synchronous
    generator.renderOpts = defaultRenderOpts;
    return out;
  }
649723
function generateCustomOutputs(done) {

			if (!o.customOutputs || o.customOutputs.length < 1) {
				done();
				return;
			}

			_.each(o.customOutputs, generateCustomOutput);
			done();
		}
765922
function createOutputDirs(done) {
			o.stylesheets.forEach(function(stylesheet) {
				mkdirp.sync(option(o.destCssPaths, stylesheet));
			});
			mkdirp.sync(o.dest);
			done();
		}
1166375
function generateHTML(testResults) {
        var stepsHtml = '',
            header = '',
            isPassed = false,
            passedScenarios = 0,
            passedSteps = 0,
            stepsNumber = 0,
            scenariosNumber = 0,
            scenariosNumberInFeature = 0,
            passedScenariosNumberInFeature = 0,
            stepsNumberInFeature = 0,
            passedStepsInFeature = 0,
            scenariosHtml = '',
            element,
            step,
            stepDuration = 0;

        html = '';
        for (var i = 0; i < testResults.length; i++) {

            scenariosNumberInFeature = 0;
            passedScenariosNumberInFeature = 0;
            stepsNumberInFeature = 0;
            passedStepsInFeature = 0;
            scenariosHtml = '';
            if (testResults[i].elements) {
                for (var j = 0; j < testResults[i].elements.length; j++) {
                    element = testResults[i].elements[j];
                    if (element.type === 'scenario') {
                        scenariosNumber++;
                        scenariosNumberInFeature++;
                        stepsHtml = '';
                        isPassed = true;
                        for (var k = 0; k < testResults[i].elements[j].steps.length; k++) {
                            step = testResults[i].elements[j].steps[k];

                            if (isEmptyAfterStep(step) || isEmptyBeforeStep(step)) {
                                continue;
                            }

                            if (isAfterStepWithScreenshot(step)) {
                                stepsHtml += getAfterScreenshotStep(step);
                            } else {
                                stepsHtml += getStep(step);
                                stepDuration += (step.result.duration ? step.result.duration : 0);
                                stepsNumber++;
                                stepsNumberInFeature++;
                                if (step.result.status !== statuses.PASSED) {
                                    isPassed = false;
                                } else if (step.result.status === statuses.PASSED) {
                                    passedSteps++;
                                    passedStepsInFeature++;
                                }
                            }
                        }

                        if (isPassed) {
                            passedScenarios++;
                            passedScenariosNumberInFeature++;
                        }
                        scenariosHtml += getScenarioContainer(getScenario(element, isPassed, stepsHtml));
                    }
                }
            }
            html += getFeatureWithScenarios(getFeature(testResults[i], scenariosNumberInFeature, passedScenariosNumberInFeature, stepsNumberInFeature, passedStepsInFeature) + scenariosHtml);
        }
        header = getHeader(scenariosNumber, passedScenarios, stepsNumber, passedSteps, calculateDuration(stepDuration));
        return header + html;
    }