Methods docstring, as HTML
480280
def html_doc(self):
        """"""
        if not self.raw_docstring:
            result = ''

        elif settings.MODERNRPC_DOC_FORMAT.lower() in ('rst', 'restructred', 'restructuredtext'):
            from docutils.core import publish_parts
            result = publish_parts(self.raw_docstring, writer_name='html')['body']

        elif settings.MODERNRPC_DOC_FORMAT.lower() in ('md', 'markdown'):
            import markdown
            result = markdown.markdown(self.raw_docstring)

        else:
            result = "<p>{}</p>".format(self.raw_docstring.replace('\n\n', '</p><p>').replace('\n', ' '))

        return result
561070
def to_html(self):
        """"""
        id, classes, kvs = self.id, self.classes, self.kvs
        id_str = 'id="{}"'.format(id) if id else ''
        class_str = 'class="{}"'.format(' '.join(classes)) if classes else ''
        key_str = ' '.join('{}={}'.format(k, v) for k, v in kvs.items())
        return ' '.join((id_str, class_str, key_str)).strip()
446814
def inherit_docstrings(cls):
    
    @functools.wraps(cls)
    def _inherit_docstrings(cls):
        if not isinstance(cls, (type, colorise.compat.ClassType)):
            raise RuntimeError("Type is not a class")

        for name, value in colorise.compat.iteritems(vars(cls)):
            if isinstance(getattr(cls, name), types.MethodType):
                if not getattr(value, '__doc__', None):
                    for base in cls.__bases__:
                        basemethod = getattr(base, name, None)

                        if basemethod and getattr(base, '__doc__', None):
                            value.__doc__ = basemethod.__doc__

        return cls

    return _inherit_docstrings(cls)
294184
function mdToHtml(input) {
    let rule = myna.allRules['markdown.document'];
    let ast = myna.parse(rule, input);
    return mdAstToHtml(ast, []).join("");
}
780696
def to_html(self, codebase):
        
        html = ''
        def build_line(key, include_pred, format_fn):
            val = getattr(self, key)
            if include_pred(val):
                return '<dt>%s</dt><dd>%s</dd>\n' % (printable(key), format_fn(val))
            else:
                return ''
        def build_dependency(val):
            return ', '.join('<a href = "%s.html">%s</a>' % (trim_js_ext(name), name)
                             for name in val)
        for key in ('author', 'organization', 'version', 'license'):
            html += build_line(key, lambda val: val, lambda val: val)
        html += build_line('dependencies', lambda val: val, build_dependency)
        html += build_line('all_dependencies', lambda val: len(val) > 1, 
                                                build_dependency)
        html += codebase.build_see_html(self.see, 'h3')
        
        if html:
            return '<dl class = "module">\n%s\n</dl>\n' % html
        else:
            return ''
457664
def _onDocstring( self, docstr, line ):
        "  "
        if self.objectsStack:
            self.objectsStack[ -1 ].docstring = \
                                 Docstring( trim_docstring( docstr ), line )
            return

        self.docstring = Docstring( trim_docstring( docstr ), line )
        return
177689
function outputHTMLString(messages) {
  var rootIndex = 0;
  for (var i = 1; i < messages.length; i++) {
    rootIndex = messages[i].frameIndex === '0' ? i : rootIndex;
  }
  fillRemainingHolesAndMinimizeStyles(messages, rootIndex);
  return messages[rootIndex].html.join('');
}
207595
def p_docstring_string(self, p):
        ''
        # Remove trailing whitespace on every line.
        p[0] = '\n'.join([line.rstrip() for line in p[1].split('\n')])
285032
def _print_formatted_docstring(self, docstring, f):
    """"""
    lines = self._remove_docstring_indent(docstring)

    # Output the lines, identifying "Args" and other section blocks.
    i = 0

    def _at_start_of_section():
      """Returns the header if lines[i] is at start of a docstring section."""
      l = lines[i]
      match = _section_re.match(l)
      if match and i + 1 < len(
          lines) and lines[i + 1].startswith(" "):
        return match.group(1)
      else:
        return None

    while i < len(lines):
      l = lines[i]

      section_header = _at_start_of_section()
      if section_header:
        if i == 0 or lines[i-1]:
          print("", file=f)
        # Use at least H4 to keep these out of the TOC.
        print("##### " + section_header + ":", file=f)
        print("", file=f)
        i += 1
        outputting_list = False
        while i < len(lines):
          l = lines[i]
          # A new section header terminates the section.
          if _at_start_of_section():
            break
          match = _arg_re.match(l)
          if match:
            if not outputting_list:
              # We need to start a list. In Markdown, a blank line needs to
              # precede a list.
              print("", file=f)
              outputting_list = True
            suffix = l[len(match.group()):].lstrip()
            print("*  <b>`" + match.group(1) + "`</b>: " + suffix, file=f)
          else:
            # For lines that don't start with _arg_re, continue the list if it
            # has enough indentation.
            outputting_list &= l.startswith("   ")
            print(l, file=f)
          i += 1
      else:
        print(l, file=f)
        i += 1
235896
function prepareHTML(html, info) {
  const cssPath = `../doc_styles.css`;
  const nav = info.map(p => {
    return `<li><a href="/static/docs/${p.name.replace('@vx/', 'vx-')}.html">${p.name}</a></li>`;
  });
  return `
  <html>
    <head>
      <link rel="stylesheet" type="text/css" href="${cssPath}">
    </head>
    <div class="nav-container">
      <div class="nav">
        <div class="nav-inner">
          <div class="logo"></div>
          <ul>
          <li class="Item">
            <a href="/">Home</a>
          </li>
          <li class="Item">
            <a href="/docs">Docs</a>
          </li>
          <li class="Item">
            <a href="https://medium.com/vx-code">Guides</a>
          </li>
          <li class="Item">
            <a href="/gallery">Gallery</a>
          </li>
          </ul>
          <a class="github-button" href="https://github.com/hshoff/vx" data-show-count="true" aria-label="Star hshoff/vx on GitHub">Star</a>
          </div>
        </div>
    </div>
    <div class="doc-container">
      <div class="doc-nav">
        <ul>
        <li>Packages</li>
        ${nav.join('')}
        </ul>
      </div>
      <div class="content">
      ${html}
      </div>
    </div>
    <script async defer src="https://buttons.github.io/buttons.js"></script>
  </html>`;
}
784189
public void printMethodsDetails(ClassDoc classDoc) {
        MethodDoc[] methodDocs = TestAPIDoclet.getTestAPIComponentMethods(classDoc);
        if (methodDocs.length > 0) {
            mOut.println("&nbsp;<P>");
            mOut.println("<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" CELLSPACING=\"0\" SUMMARY=\"\">");
            mOut.println("<TR BGCOLOR=\"#CCCCFF\"><TH ALIGN=\"left\" COLSPAN=\"2\"><FONT SIZE=\"+2\"><B>Methods "
                  + "Detail</B></FONT></TH></TR>");
            mOut.println("</TABLE>");
            for (int m = 0; m < methodDocs.length; m++) {
                MethodDoc methodDoc = methodDocs[m];
                String methodName = methodDoc.name();

                // get return type
                String returnTypeString = getTypeString(methodDoc.returnType());
                int returnTypeLength = returnTypeString.replaceAll("<.*?>", "").replace("&lt;", "<").replace("&gt;", ">")
                      .length(); // length without HTML tags and &gt;/&lt; entities

                Parameter[] parameters = methodDoc.parameters();
                String[] parameterSignatures = new String[parameters.length];
                for (int i = 0; i < parameterSignatures.length; i++) {
                    Parameter parameter = parameters[i];
                    parameterSignatures[i] = getTypeString(parameter.type()) + " " + parameter.name();
                }
                String parameterSeparator = ",\n";
                for (int i = 0; i < returnTypeLength + methodName.length() + 2; i++) {
                    parameterSeparator += " ";
                }

                // begin output
                mOut.println("<A NAME=\"" + methodName + "\"><A NAME=\"" + methodName + methodDoc.flatSignature() + "\"> <H3>"
                      + methodName + "</H3></A></A>");
                mOut.print("<PRE>" + returnTypeString + " <B>" + methodName + "</B>(" + Strings
                      .join(parameterSignatures, parameterSeparator) + ")");

                Type[] exceptions = methodDoc.thrownExceptionTypes();
                if (exceptions.length > 0) {
                    String[] exceptionNames = new String[exceptions.length];
                    for (int i = 0; i < exceptions.length; i++) {
                        exceptionNames[i] = getTypeString(exceptions[i]);
                    }
                    mOut.print(parameterSeparator.substring(1, parameterSeparator.length() - 7) + "throws " + Strings
                          .join(exceptionNames, parameterSeparator));
                }
                mOut.println("</PRE>");
                mOut.print("<DL><DD>");
                printInlineTags(methodDoc.inlineTags(), classDoc);

                mOut.println("<P><DD><DL>");

                // param tags
                ParamTag[] paramTags = methodDoc.paramTags();
                if (parameters.length > 0) {
                    mOut.println("<DT><B>Parameters:</B></DT>");
                    for (Parameter parameter : parameters) {
                        ParamTag paramTag = null;
                        for (ParamTag tag : paramTags) {
                            if (tag.parameterName().equals(parameter.name())) {
                                paramTag = tag;
                            }
                        }
                        mOut.println("<DD><CODE>" + parameter.name() + "</CODE> - ");
                        if (paramTag != null) {
                            if (!paramTag.parameterComment().isEmpty()) {
                                printInlineTags(paramTag.inlineTags(), classDoc);
                            } else {
                                System.out.println(
                                      "No description in @param tag for " + parameter.name() + " in " + classDoc.name() + "."
                                            + methodDoc.name());
                            }
                        } else {
                            System.out.println(
                                  "No @param tag for " + parameter.name() + " in " + classDoc.name() + "." + methodDoc.name());
                        }
                        mOut.println("</DD>");
                    }
                }

                // return tag
                Tag[] returnTags = methodDoc.tags("@return");
                if (returnTags.length > 0) {
                    mOut.println("<DT><B>Returns:</B></DT>");
                    mOut.println("<DD>" + returnTags[0].text() + "</DD>");
                }

                // throws tag
                ThrowsTag[] throwsTags = methodDoc.throwsTags();
                if (throwsTags.length > 0) {
                    mOut.println("<DT><B>Throws:</B></DT>");
                    for (ThrowsTag throwsTag : throwsTags) {
                        String exceptionName = throwsTag.exceptionName();
                        // remove "com.qspin.qtaste.testsuite." prefix if any
                        if (exceptionName.startsWith("com.qspin.qtaste.testsuite.")) {
                            exceptionName = exceptionName.substring("com.qspin.qtaste.testsuite.".length());
                        }
                        mOut.println("<DD><CODE>" + exceptionName + "</CODE> - ");
                        printInlineTags(throwsTag.inlineTags(), classDoc);
                        mOut.println("</DD>");
                    }
                }

                mOut.println("</DL></DD></DL>");

                if (m != methodDocs.length - 1) {
                    mOut.println("<HR>");
                }
            }
        }
    }
28290
function afeclone(doc, i) {
    return {
      elt: createHTMLElt(doc, afe.list[i].localName, afe.attrs[i]),
      attrs: afe.attrs[i],
    };
  }
586527
def _prepare_docstrings():
    """"""
    if config.USEAUTODOC:
        source = inspect.getsource(Options)
        docstrings = source.split('"""')[3::2]
        attributes = [line.strip().split()[0] for line in source.split('\n')
                      if '_Option(' in line]
        for attribute, docstring in zip(attributes, docstrings):
            Options.__dict__[attribute].__doc__ = docstring
428910
function toHTML()
    {

        // get some attributes of the control
        $attributes = $this->get_attributes(array('name', 'value', 'class', 'format', 'hours', 'minutes', 'seconds'));

        // make sure format is in lower characters
        $attributes['format'] = strtolower($attributes['format']);

        // if invalid format specified, revert to the default "hm"
        if (preg_match('/^[hmsg]+$/i', $attributes['format']) == 0 || strlen(preg_replace('/([a-z]{2,})/i', '$1', $attributes['format'])) != strlen($attributes['format'])) $attributes['format'] = 'hm';

        // see what have we sepcified as default time
        $time = array_diff(explode(':', trim(str_replace(array('am', 'pm'), '', strtolower($attributes['value'])))), array(''));

        // if, according to the time format, we have to show the hours, and the hour is given in the default time
        if (($hour_position = strpos($attributes['format'], 'h')) !== false && isset($time[$hour_position]))

            // the default selected hour
            $selected_hour = $time[$hour_position];

        // if, according to the time format, we have to show the minutes, and the minutes are given in the default time
        if (($minutes_position = strpos($attributes['format'], 'm')) !== false && isset($time[$minutes_position]))

            // the default selected minute
            $selected_minute = $time[$minutes_position];

        // if, according to the time format, we have to show the seconds, and the seconds are given in the default time
        if (($seconds_position = strpos($attributes['format'], 's')) !== false && isset($time[$seconds_position]))

            // the default selected minute
            $selected_second = $time[$seconds_position];

        // if 12-hours format is to be used
        if (strpos($attributes['format'], 'g')) {

            // set a flag
            $ampm = true;

            // if this is also present in the default time
            if (preg_match('/\bam\b|\bpm\b/i', $attributes['value'], $matches))

                // extract the format from the default time
                $ampm = strtolower($matches[0]);

        }


        $output = '';

        // if the hour picker is to be shown
        if ($hour_position !== false) {

            // generate the hour picker
            $output .= '
                <select name="' . $attributes['name'] . '_hours" id="' . $attributes['name'] . '_hours" ' . $this->_render_attributes() . '>
                    <option value="">-</option>';

            foreach ($attributes['hours'] as $hour)

                // show 12 or 24 hours depending on the format
                if (!isset($ampm) || ($hour > 0 && $hour < 13))

                    $output .= '<option value="' . str_pad($hour, 2, '0', STR_PAD_LEFT) . '"' . (isset($selected_hour) && ltrim($selected_hour, '0') == ltrim($hour, '0') ? '  selected="selected"' : '') . '>' . str_pad($hour, 2, '0', STR_PAD_LEFT) . '</option>';

            $output .= '
                </select>
            ';

        }
        
        // if the minute picker is to be shown
        if ($minutes_position !== false) {

            // generate the minute picker
            $output .= '
                <select name="' . $attributes['name'] . '_minutes" id="' . $attributes['name'] . '_minutes" ' . $this->_render_attributes() . '>
                    <option value="">-</option>';

            foreach ($attributes['minutes'] as $minute)

                $output .= '<option value="' . str_pad($minute, 2, '0', STR_PAD_LEFT) . '"' . (isset($selected_minute) && ltrim($selected_minute, '0') == ltrim($minute, '0') ? ' selected="selected"' : '') . '>' . str_pad($minute, 2, '0', STR_PAD_LEFT) . '</option>';

            $output .= '
                </select>
            ';

        }

        // if the seconds picker is to be shown
        if ($seconds_position !== false) {

            // generate the seconds picker
            $output .= '
                <select name="' . $attributes['name'] . '_seconds" id="' . $attributes['name'] . '_seconds" ' . $this->_render_attributes() . '>
                    <option value="">-</option>';

            foreach ($attributes['seconds'] as $second)

                $output .= '<option value="' . str_pad($second, 2, '0', STR_PAD_LEFT) . '"' . (isset($selected_second) && ltrim($selected_second, '0') == ltrim($second, '0') ? ' selected="selected"' : '') . '>' . str_pad($second, 2, '0', STR_PAD_LEFT) . '</option>';

            $output .= '
                </select>
            ';

        }

        // if am/pm picker is to be shown
        if (isset($ampm)) {

            // generate the AM/PM picker
            $output .= '
                <select name="' . $attributes['name'] . '_ampm" id="' . $attributes['name'] . '_ampm" ' . $this->_render_attributes() . '>
                    <option value="">-</option>';

            $output .= '<option value="AM"' . ($ampm === 'am' ? ' selected="selected"' : '') . '>AM</option>';
            $output .= '<option value="PM"' . ($ampm === 'pm' ? ' selected="selected"' : '') . '>PM</option>';

            $output .= '
                </select>
            ';

        }

        $output .= '<div class="clear"></div>';

        return $output;

    }
827444
function(context, descriptor, args) {
		if (context.env.data.isServer)
			return;
		args[0].toHTMLString(context, descriptor);
	}
968627
function(doctype){
    var ast = [];
    if (doctype && (doctype.val || !this.doctype)) {
      this.setDoctype(doctype.val || 'html');
    }

    if (this.doctype) push.apply(ast, this.buffer(this.doctype));
    this.hasCompiledDoctype = true;
    return ast;
  }
1128679
def _prepare_docstrings(self, frame):
        """"""
        if config.USEAUTODOC:
            filename = inspect.getsourcefile(frame)
            with open(filename) as file_:
                sources = file_.read().split('"""')
            for code, doc in zip(sources[::2], sources[1::2]):
                code = code.strip()
                key = code.split('\n')[-1].split()[0]
                value = self.get(key)
                if value:
                    value.__doc__ = doc