Create HTML and CSS output, if requested
351946
function GetHTML(result) {
  if (data.css) result.css = CHTMLSTYLES;
  if (!data.html && !data.htmlNode) return;
  var jax = MathJax.Hub.getAllJax()[0]; if (!jax) return;
  var script = jax.SourceElement(), html = script.previousSibling;

  // add speech text if there isn't one
  if (data.speakText){
    var labelTarget = html.querySelector('.mjx-math');
    for (child of labelTarget.childNodes) child.setAttribute("aria-hidden",true);
    if (!labelTarget.getAttribute("aria-label")){
    labelTarget.setAttribute("aria-label",result.speakText);
    }
  }
  // remove automatically generated IDs
  var ids = html.querySelectorAll('[id^="MJXc-Node-"]');
  for (var i = 0; i < ids.length; i++){
    ids[i].removeAttribute("id");
  }
  // remove extreneous frame element
  var frame = html.querySelector('[id^="MathJax-Element-"]');
  if (frame){
    // in display-mode, the frame is inside the display-style wrapper
    html.insertBefore(frame.firstChild, frame);
    html.removeChild(frame);
  }
  else{
    // otherwise (inline-mode) the frame is the root element
    html.removeAttribute("id");
  }
  if (data.html) result.html = html.outerHTML;
  if (data.htmlNode) result.htmlNode = html;
}
656859
function () {
    // render stylesheets
    var precss = fs.readFileSync(__dirname + '/themes/default/styl/default.styl', 'utf8');
    stylus.render(precss, { filename: 'default.css' }, function(err, css){
      if (err) {
        throw err;
      }

      this.styles = css;
    }.bind(this));

    // collect client js (to be inined later)
    this.js = fs.readFileSync(__dirname + '/themes/default/js/default.js', 'utf8');

    // register handlebars helpers
    Handlebars.registerHelper('roundNumber', function (number) {
      return Math.round(number * Math.pow(10, 2)) / Math.pow(10, 2);
    });

    // collect & compile templates
    this.templates = {};
    this.templates.test = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/test.hbs', 'utf8'));
    this.templates.wrapper = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/wrapper.hbs', 'utf8'));
    this.templates.testresult = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/tests.hbs', 'utf8'));
    this.templates.banner = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/banner.hbs', 'utf8'));
    this.templates.detail = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/detail.hbs', 'utf8'));

    return this;
  }
170777
def html(content, **kwargs):
    """"""
    if hasattr(content, 'read'):
        return content
    elif hasattr(content, 'render'):
        return content.render().encode('utf8')

    return str(content).encode('utf8')
786382
public function start_html() {
        global $OUTPUT;
        $this->id = 'core_progress_display_if_slow' . self::$nextid;
        self::$nextid++;

        // Containing div includes a CSS class so that it can be themed if required,
        // and an id so it can be automatically hidden at end.
        echo \html_writer::start_div('core_progress_display_if_slow',
                array('id' => $this->id));

        // Display optional heading.
        if ($this->heading !== '') {
            echo $OUTPUT->heading($this->heading, 3);
        }

        // Use base class to display progress bar.
        parent::start_html();
    }
385955
def _generate_html(data, out):
    '''
    
    '''
    print('<html>', file=out)
    print('<body>', file=out)
    _generate_html_table(data, out, 0)
    print('</body>', file=out)
    print('</html>', file=out)
327807
def render_css(self, fn=None, text=None, margin='', indent='\t'):
        """"""
        fn = fn or os.path.splitext(self.fn)[0]+'.css'
        if not os.path.exists(os.path.dirname(fn)):
            os.makedirs(os.path.dirname(fn))
        curdir = os.path.abspath(os.curdir)
        os.chdir(os.path.dirname(fn))               # needed in order for scss to relative @import
        text = text or self.render_styles()
        if text != '': text = sass.compile(string=text)
        os.chdir(curdir)
        return CSS(fn=fn, text=text)
1093237
function writeSummary(output) {
    var options = output.getOptions();
    var prefix = options.get('prefix');

    var filePath = SUMMARY_FILE;
    var engine = WebsiteGenerator.createTemplateEngine(output, filePath);
    var context = JSONUtils.encodeOutput(output);

    // Render the theme
    return Templating.renderFile(engine, prefix + '/summary.html', context)

    // Write it to the disk
    .then(function(tplOut) {
        return writeFile(output, filePath, tplOut.getContent());
    });
}
798045
function outputOutput(output, cb) {
    cb = u.maybe(cb);

    if (!output) return cb(new Error('no output specified'));

    debug('output %s', output.name);
    var files = output.files = [];

    var omit = output.omitRoutes;
    if (omit && !u.isArray(omit)) { omit = [omit]; }

    // TODO: re-use similar filter in server/serve-statics and server/serve-scripts
    var filterRe = new RegExp( '^(/admin/|/server/' +
                (opts.editor ? '' : '|/pub/') +
                       (omit ? '|' + u.map(omit, u.escapeRegExp).join('|') : '') +
                               ')');

    // pass1: collect files to generate (not /server or /admin or /pub)
    u.each(generator.pages, function(page) {
      if (filterRe.test(page._href)) return;
      if (output.match && !output.match(page)) return;
      var file = { page: page, path: page._href };
      if (page['http-header']) { file['http-header'] = page['http-header']; }
      files.push(file);
    });

    // pass2:
    fixOutputPaths(output, files);

    // pass3: generate using (possibly modified) file paths for relPaths
    // E.g. /adobe may live in the file /adobe/index.html so the relPath is '..'
    u.each(files, function(file) {
      var renderOpts =
        output.relPaths   ? { relPath:u.relPath(file.path) } :
        output.staticRoot ? { relPath:output.staticRoot } :
        opts.relPaths     ? { relPath:u.relPath(file.path) } :
        opts.staticRoot   ? { relPath:opts.staticRoot } :
        {};
      if (output.fqImages) { renderOpts.fqImages = output.fqImages; }
      file.text = generator.renderDoc(file.page, renderOpts);
      delete file.page;
    });

    output.src.put(files, cb);
  }
610971
def main():
    

    args = get_command_line_arguments()
    args.css_file = args.css_file if foundations.common.path_exists(args.css_file) else CSS_FILE
    return reStructuredText_to_html(args.input,
                                    args.output,
                                    args.css_file)
1095546
def create_html(s1, s2, output='test.html'):
    '''  '''
    html = difflib.HtmlDiff().make_file(s1.split(), s2.split())
    with open(output, 'w') as f:
        f.write(html)
38244
function createHTML (json, grunt) {

  var output = '<!DOCTYPE html>\n<html><head><title>License report for ' + grunt.config.data.pkg.name + ' v' + grunt.config.data.pkg.version + '</title>\n' +
    '<style type="text/css">\n' +
    'html, body {\n' +
    'background-color: #FFFFFF;\n' +
    'color: #333333;\n' +
    'font-family: Arial,sans-serif;\n' +
    'font-size: 14px; \n' +
    'line-height: 1.42857; \n' +
    'padding: 0:\n' +
    'margin: 0;\n' +
    '}\n' +
    'table th, td {\n' +
    'text-align: left;\n' +
    '}' +
    '.error {' +
    'color: #ff0000;' +
    'font-weight:bold;' +
    '}</style>\n</head>\n<body>\n<h1>License report for ' + grunt.config.data.pkg.name + ' v' + grunt.config.data.pkg.version + '</h1>\n<table border="1">\n<tr>\n<th>Project</th><th>License</th><th>Repository</th>\n</tr>';

  /*
   * Get the name of every top node inside the json.
   * In this case, the node name is the name of the package, that we are currently looking at.
   */
  var packageNames = Object.getOwnPropertyNames(json);

  packageNames.forEach(function (packageName) {
    var repoUrl = sanitize.parseUrl(json[packageName].repository);

    output += '\n<tr>\n<td>' + packageName + '</td>';
    output += '\n<td>' + sanitize.parseLicense(json[packageName].licenses, packageName, grunt) + '</td>';

    // Filter undefined urls
    if(repoUrl) {
      output += '\n<td><a href="' + repoUrl + '" target="_blank">' + repoUrl + '</a></td>\n</tr>';
    }
    else {
      output += '\n<td><span class="error">Undefined</span></td>\n</tr>';
    }
  });

  output += '\n</table></body></html>';

  return output;

}
913
def create_css(self, rules):
        
        style = rules[0].legacy_compiler_options.get(
            'style', self.compiler.output_style)
        debug_info = self.compiler.generate_source_map

        if style == 'legacy':
            sc, sp, tb, nst, srnl, nl, rnl, lnl, dbg = True, ' ', '  ', False, '', '\n', '\n', '\n', debug_info
        elif style == 'compressed':
            sc, sp, tb, nst, srnl, nl, rnl, lnl, dbg = False, '', '', False, '', '', '', '', False
        elif style == 'compact':
            sc, sp, tb, nst, srnl, nl, rnl, lnl, dbg = True, ' ', '', False, '\n', ' ', '\n', ' ', debug_info
        elif style == 'expanded':
            sc, sp, tb, nst, srnl, nl, rnl, lnl, dbg = True, ' ', '  ', False, '\n', '\n', '\n', '\n', debug_info
        else:  # if style == 'nested':
            sc, sp, tb, nst, srnl, nl, rnl, lnl, dbg = True, ' ', '  ', True, '\n', '\n', '\n', ' ', debug_info

        return self._create_css(rules, sc, sp, tb, nst, srnl, nl, rnl, lnl, dbg)
94959
def render(self, text, add_header=False):
        

        html = mark_text(text, self.aesthetics, self.rules)
        html = html.replace('\n', '<br/>')
        if add_header:
            html = '\n'.join([HEADER, self.css, MIDDLE, html, FOOTER])
        #print('\n'.join((HEADER, self.css, MIDDLE, html, FOOTER)))
        return html
490404
def html(self, data=None, template=None):
        
        if data is None:
            data = {}
        if template:
            return render(self.request, template, data)
        return HttpResponse(data)
1055921
def inline_css(self, html):
        
        premailer = Premailer(html)
        inlined_html = premailer.transform(pretty_print=True)
        return inlined_html
1067643
def to_html
      html = '<table><tr>'
      @source.each{|color| html.concat("<th>" + color + "</th>")}
      html.concat("</tr><tr>")
      @source.each{|color| html.concat("<td style=\"background-color:" + color + ";\">&nbsp;</td>")}
      html += '</tr></table>'
      return html
    end
1197862
public function outputHtml()
    {
        echo '<div style="display: block; margin: 5px; padding: 5px; background-color: #fff; border: 1px solid black; z-index: 999999999; position:relative;">';
        echo '<h3 style="font-size: 14px; margin: 3px">' . $this->_backtrace[0]['file'] . ':' . $this->_backtrace[1]['function'] . ':' . $this->_backtrace[0]['line'] . '</h3>';
        $backtrace = array_slice($this->_backtrace, 1, $this->_showSteps);
        foreach ($backtrace as $bt) {
            if (!isset($bt['file'])) {
                continue;
            }
            echo '<div style="font-size: 12px; margin: 1px">' . $bt['file'] . ':' . $bt['function'] . ':' . $bt['line'] . '</div>';
        }
        echo '<hr />';
        echo self::dump($this->_var, $this->_depth, true);
        echo '</div>';
    }