// Render (String) writes data with custom ContentType.
424791
func (r String) Render(w http.ResponseWriter) error {
	return WriteString(w, r.Format, r.Data)
}
617283
func (c *Context) Render(name string, data interface{}) error {
	return c.weavebox.templateEngine.Render(c.Response(), name, data)
}
552063
func (c *xContext) Render(name string, data interface{}, codes ...int) (err error) {
	if c.auto {
		format := c.Format()
		if render, ok := c.echo.formatRenderers[format]; ok && render != nil {
			switch v := data.(type) {
			case Data: //Skip
			case error:
				c.dataEngine.SetError(v)
			case nil:
				if c.dataEngine.GetData() == nil {
					c.dataEngine.SetData(c.Stored(), c.dataEngine.GetCode().Int())
				}
			default:
				c.dataEngine.SetData(data, c.dataEngine.GetCode().Int())
			}
			return render(c, data)
		}
	}
	c.dataEngine.SetTmplFuncs()
	if data == nil {
		data = c.dataEngine.GetData()
	}
	b, err := c.Fetch(name, data)
	if err != nil {
		return
	}
	b = bytes.TrimLeftFunc(b, unicode.IsSpace)
	c.response.Header().Set(HeaderContentType, MIMETextHTMLCharsetUTF8)
	err = c.Blob(b, codes...)
	return
}
281025
func (t *Tabulate) Render(format ...interface{}) string {
	var lines []string

	// If headers are set use them, otherwise pop the first row
	if len(t.Headers) < 1 && len(t.Data) > 1 {
		t.Headers, t.Data = t.Data[0].Elements, t.Data[1:]
	}

	// Use the format that was passed as parameter, otherwise
	// use the format defined in the struct
	if len(format) > 0 {
		t.TableFormat = TableFormats[format[0].(string)]
	}

	// If Wrap Strings is set to True,then break up the string to multiple cells
	if t.WrapStrings {
		t.Data = t.wrapCellData()
	}

	// Check if Data is present
	if len(t.Data) < 1 {
		return ""
	}

	if len(t.Headers) < len(t.Data[0].Elements) {
		diff := len(t.Data[0].Elements) - len(t.Headers)
		padded_header := make([]string, diff)
		for _, e := range t.Headers {
			padded_header = append(padded_header, e)
		}
		t.Headers = padded_header
	}

	// Get Column widths for all columns
	cols := t.getWidths(t.Headers, t.Data)

	padded_widths := make([]int, len(cols))
	for i, _ := range padded_widths {
		padded_widths[i] = cols[i] + MIN_PADDING*t.TableFormat.Padding
	}

	// Calculate total width of the table
	totalWidth := len(t.TableFormat.DataRow.sep) * (len(cols) - 1) // Include all but the final separator
	for _, w := range padded_widths {
		totalWidth += w
	}

	// Start appending lines
	if len(t.Title) > 0 {
		if !inSlice("aboveTitle", t.HideLines) {
			lines = append(lines, t.buildLine(padded_widths, cols, t.TableFormat.LineTop))
		}
		savedAlign := t.Align
		if len(t.TitleAlign) > 0 {
			t.SetAlign(t.TitleAlign) // Temporary replace alignment with the title alignment
		}
		lines = append(lines, t.buildRow([]string{t.Title}, []int{totalWidth}, nil, t.TableFormat.TitleRow))
		t.SetAlign(savedAlign)
	}

	// Append top line if not hidden
	if !inSlice("top", t.HideLines) {
		lines = append(lines, t.buildLine(padded_widths, cols, t.TableFormat.LineTop))
	}

	// Add Header
	lines = append(lines, t.buildRow(t.padRow(t.Headers, t.TableFormat.Padding), padded_widths, cols, t.TableFormat.HeaderRow))

	// Add Line Below Header if not hidden
	if !inSlice("belowheader", t.HideLines) {
		lines = append(lines, t.buildLine(padded_widths, cols, t.TableFormat.LineBelowHeader))
	}

	// Add Data Rows
	for index, element := range t.Data {
		lines = append(lines, t.buildRow(t.padRow(element.Elements, t.TableFormat.Padding), padded_widths, cols, t.TableFormat.DataRow))
		if index < len(t.Data)-1 {
			if element.Continuos != true && !inSlice("betweenLine", t.HideLines) {
				lines = append(lines, t.buildLine(padded_widths, cols, t.TableFormat.LineBetweenRows))
			}
		}
	}

	if !inSlice("bottomLine", t.HideLines) {
		lines = append(lines, t.buildLine(padded_widths, cols, t.TableFormat.LineBottom))
	}

	// Join lines
	var buffer bytes.Buffer
	for _, line := range lines {
		buffer.WriteString(line + "\n")
	}

	return buffer.String()
}
1370395
func (v *ShowView) Render(m trees.Markup) {
	//if we are allowed to query for styles then check and change display
	if ds, err := trees.GetStyle(m, "display"); err == nil {
		if strings.Contains(ds.Value, "none") {
			ds.Value = "block"
		}
	}
}
954414
func (c *Cell) Render(style *renderStyle) (buffer string) {
	// if no alignment is set, import the table's default
	if c.alignment == nil {
		c.alignment = &style.Alignment
	}

	// left padding
	buffer += strings.Repeat(" ", style.PaddingLeft)

	// append the main value and handle alignment
	buffer += c.alignCell(style)

	// right padding
	buffer += strings.Repeat(" ", style.PaddingRight)

	// this handles escaping for, eg, Markdown, where we don't care about the
	// alignment quite as much
	if style.replaceContent != nil {
		buffer = style.replaceContent(buffer)
	}

	return buffer
}
737449
func (s *SequenceRenderer) Render(m ...string) trees.Markup {
	root := trees.NewElement(s.Tag, false)

	attrs.Class(strings.Join(s.Class, " ")).Apply(root)
	attrs.ID(s.ID).Apply(root)

	for _, st := range s.stack {
		st.Render(m...).Apply(root)
	}

	return root
}
798725
func (g *Group) Render(writer io.Writer) error {
	return g.RenderWithFile(writer, NewFile(""))
}
267100
func (ctx *Context) Render(file string, data ...map[string]interface{}) {
	if ctx.templateLoader == "" {
		panic(fmt.Errorf("Template loader has not been set"))
	}
	var renderData map[string]interface{}
	if len(data) == 0 {
		renderData = make(map[string]interface{})
	} else {
		renderData = data[0]
	}
	renderData["xsrf_token"] = ctx.xsrfToken()
	content, err := ctx.App.View.Render(ctx.templateLoader, file, renderData)
	if err != nil {
		panic(err)
	}
	ctx.Send(content)
}
137555
func (r IndentedJSON) Render(w http.ResponseWriter) error {
	r.WriteContentType(w)
	jsonBytes, err := json.MarshalIndent(r.Data, "", "    ")
	if err != nil {
		return err
	}
	_, err = w.Write(jsonBytes)
	return err
}
413645
func (r XML) Render(w http.ResponseWriter) error {
	r.WriteContentType(w)
	return xml.NewEncoder(w).Encode(r.Data)
}
1041190
func (r *Render) Data(w io.Writer, status int, v []byte) error {
	head := Head{
		ContentType: r.opt.BinaryContentType,
		Status:      status,
	}

	d := Data{
		Head: head,
	}

	return r.Render(w, d, v)
}
1132391
func (gotmpl GoTemplate) Render(wr io.Writer, arg interface{}) error {
	return gotmpl.Execute(wr, arg)
}
981597
func (this *Response) Render(view string, i ...interface{}) {
	i = append(i, this.Locals)
	s, err := this.app.Render(view, i...)
	if err != nil {
		// Need to do something about errors and next()
		fmt.Println(err)
		this.next()
		return
	}
	this.Send(s)
}
138285
func Render(colorCode int, fontSize int, content string) string {
	return "\033[" + strconv.Itoa(fontSize) + ";" + strconv.Itoa(colorCode) + "m" + content + reset
}
191508
func (p *WebPage) Render(filename, format string, quality int) error {
	req := map[string]interface{}{"ref": p.ref.id, "filename": filename, "format": format, "quality": quality}
	return p.ref.process.doJSON("POST", "/webpage/Render", req, nil)
}
433016
func (c *Context) Data(code int, contentType string, data []byte) {
	c.Render(code, render.Data{
		ContentType: contentType,
		Data:        data,
	})
}