//Render form start
546674
func (form FormImpl) Render(ws *websocket.Conn, app *App, params []string) error {
	log.Println("FormImpl Render")
	return nil
}
1012267
func (this *Server) Render(view string, i ...interface{}) (string, error) {

	ext := filepath.Ext(view)

	if _, ok := this.engines[ext]; ok == false {
		return "", errors.New("Engine not found.")
	}

	file := filepath.Join(this.Get("views"), view)

	if _, err := os.Stat(file); err != nil || os.IsNotExist(err) {
		return "", errors.New("Failed to lookup view '" + file + "'")
	}

	i = append(i, this.Locals)

	t, err := this.engines[ext].Render(file, i...)

	if err != nil {
		return "", errors.New("Problem rendering view.")
	}

	return t, nil
}
786966
func (t *TemplateEngine) Render(w io.Writer, name string, data interface{}) error {
	if templ, exist := t.cache[name]; exist {
		return templ.ExecuteTemplate(w, "_", data)
	}
	return fmt.Errorf("template %s could not be found", name)
}
689712
func (s *Server) Start() (err error) {
	if s.Status {
		e := echo.New()
		e.Use(middleware.GzipWithConfig(middleware.GzipConfig{
			Level: 2,
		}))
		e.Use(middleware.Recover())

		// web panel
		e.GET("/", func(c echo.Context) error {
			return s.render(c, "assets/index.html", 1)
		})
		e.GET("/assets/js/all.min.js", func(c echo.Context) error {
			return s.render(c, "assets/assets/js/all.min.js", 2)
		})
		e.GET("/assets/css/app.css", func(c echo.Context) error {
			return s.render(c, "assets/assets/css/app.css", 3)
		})
		e.GET("/app/components/settings/index.html", func(c echo.Context) error {
			return s.render(c, "assets/app/components/settings/index.html", 1)
		})
		e.GET("/app/components/project/index.html", func(c echo.Context) error {
			return s.render(c, "assets/app/components/project/index.html", 1)
		})
		e.GET("/app/components/index.html", func(c echo.Context) error {
			return s.render(c, "assets/app/components/index.html", 1)
		})
		e.GET("/assets/img/logo.png", func(c echo.Context) error {
			return s.render(c, "assets/assets/img/logo.png", 5)
		})
		e.GET("/assets/img/svg/github-logo.svg", func(c echo.Context) error {
			return s.render(c, "assets/assets/img/svg/github-logo.svg", 4)
		})
		e.GET("/assets/img/svg/ic_arrow_back_black_48px.svg", func(c echo.Context) error {
			return s.render(c, "assets/assets/img/svg/ic_arrow_back_black_48px.svg", 4)
		})
		e.GET("/assets/img/svg/ic_clear_white_48px.svg", func(c echo.Context) error {
			return s.render(c, "assets/assets/img/svg/ic_clear_white_48px.svg", 4)
		})
		e.GET("/assets/img/svg/ic_menu_white_48px.svg", func(c echo.Context) error {
			return s.render(c, "assets/assets/img/svg/ic_menu_white_48px.svg", 4)
		})
		e.GET("/assets/img/svg/ic_settings_black_48px.svg", func(c echo.Context) error {
			return s.render(c, "assets/assets/img/svg/ic_settings_black_48px.svg", 4)
		})

		//websocket
		e.GET("/ws", s.projects)
		e.HideBanner = true
		e.Debug = false
		go func() {
			log.Println(s.Parent.Prefix("Started on " + string(s.Host) + ":" + strconv.Itoa(s.Port)))
			e.Start(string(s.Host) + ":" + strconv.Itoa(s.Port))
		}()
	}
	return nil
}
30526
func (j JSONP) Render(w io.Writer, v interface{}) error {
	var result []byte
	var err error

	if j.Indent {
		result, err = json.MarshalIndent(v, "", "  ")
	} else {
		result, err = json.Marshal(v)
	}
	if err != nil {
		return err
	}

	// JSON marshaled fine, write out the result.
	if hw, ok := w.(http.ResponseWriter); ok {
		j.Head.Write(hw)
	}
	w.Write([]byte(j.Callback + "("))
	w.Write(result)
	w.Write([]byte(");"))

	// If indenting, append a new line.
	if j.Indent {
		w.Write([]byte("\n"))
	}
	return nil
}
669968
func (renderer *Renderer) Render(response *plugins.Response, files []string) (err error) {
	for _, filename := range files {
		file := &plugins.File{Name: filename}
		switch filename {
		case "client.go":
			file.Data, err = renderer.RenderClient()
		case "types.go":
			file.Data, err = renderer.RenderTypes()
		case "provider.go":
			file.Data, err = renderer.RenderProvider()
		case "server.go":
			file.Data, err = renderer.RenderServer()
		case "constants.go":
			file.Data, err = renderer.RenderConstants()
		default:
			file.Data = nil
		}
		if err != nil {
			response.Errors = append(response.Errors, fmt.Sprintf("ERROR %v", err))
		}
		// run generated Go files through imports pkg
		if filepath.Ext(file.Name) == ".go" {
			file.Data, err = imports.Process(file.Name, file.Data, nil)
		}
		response.Files = append(response.Files, file)
	}
	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()
}
862502
func Render(c context.Context, name string, args Args) ([]byte, error) {
	if b, _ := c.Value(&contextKey).(*boundBundle); b != nil {
		return b.Render(c, b.Extra, name, args)
	}
	return nil, errNoBundle
}
765175
func (r PureJSON) Render(w http.ResponseWriter) error {
	r.WriteContentType(w)
	encoder := json.NewEncoder(w)
	encoder.SetEscapeHTML(false)
	return encoder.Encode(r.Data)
}
612241
func (t *Template) Render(w io.Writer, context ...interface{}) error {
	return t.render(newWriter(w), context...)
}
1363651
func (bar *StatusBar) Render(writer io.Writer) error {
	bar.Lock()
	defer bar.Unlock()

	buffer := &bytes.Buffer{}

	if bar.status == nil {
		return nil
	}

	err := bar.format.Execute(buffer, bar.status)
	if err != nil {
		return fmt.Errorf(
			`error during rendering status bar: %s`,
			err,
		)
	}

	fmt.Fprintf(buffer, "\r")

	bar.last = escapeSequenceRegexp.ReplaceAllLiteralString(
		buffer.String(),
		``,
	)

	_, err = io.Copy(writer, buffer)
	if err != nil {
		return fmt.Errorf(
			`can't write status bar: %s`,
			err,
		)
	}

	return nil
}
757695
func (c *RenderController) Render(ctx *app.RenderRenderContext) error {
	content := ctx.Payload.Data.Attributes.Content
	markup := ctx.Payload.Data.Attributes.Markup
	if !rendering.IsMarkupSupported(markup) {
		return jsonapi.JSONErrorResponse(ctx, errors.NewBadParameterError("Unsupported markup type", markup))
	}
	htmlResult := rendering.RenderMarkupToHTML(content, markup)
	res := &app.MarkupRenderingSingle{Data: &app.MarkupRenderingData{
		ID:   uuid.NewV4().String(),
		Type: RenderingType,
		Attributes: &app.MarkupRenderingDataAttributes{
			RenderedContent: htmlResult,
		}}}
	return ctx.OK(res)
}
657301
func render(temp string, args string) string {
	context := Context{args}
	tmpl, err := template.New("replacer").Parse(temp)
	if err != nil {
		fmt.Println("A problem occured parsing one of the processors:")
		fmt.Println(err)
		fmt.Print(temp)
		os.Exit(2)
	}
	buff := bytes.NewBufferString("")
	err = tmpl.Execute(buff, context)
	if err != nil {
		fmt.Println("A problem occured executing one of the processors:")
		fmt.Println(err)
		fmt.Print(temp)
		os.Exit(2)
	}
	return buff.String()
}
1124133
func (r *Render) Render(buffer *Buffer, completion *CompletionManager) {
	// In situations where a pseudo tty is allocated (e.g. within a docker container),
	// window size via TIOCGWINSZ is not immediately available and will result in 0,0 dimensions.
	if r.col == 0 {
		return
	}
	defer func() { debug.AssertNoError(r.out.Flush()) }()
	r.move(r.previousCursor, 0)

	line := buffer.Text()
	prefix := r.getCurrentPrefix()
	cursor := runewidth.StringWidth(prefix) + runewidth.StringWidth(line)

	// prepare area
	_, y := r.toPos(cursor)

	h := y + 1 + int(completion.max)
	if h > int(r.row) || completionMargin > int(r.col) {
		r.renderWindowTooSmall()
		return
	}

	// Rendering
	r.out.HideCursor()
	defer r.out.ShowCursor()

	r.renderPrefix()
	r.out.SetColor(r.inputTextColor, r.inputBGColor, false)
	r.out.WriteStr(line)
	r.out.SetColor(DefaultColor, DefaultColor, false)
	r.lineWrap(cursor)

	r.out.EraseDown()

	cursor = r.backward(cursor, runewidth.StringWidth(line)-buffer.DisplayCursorPosition())

	r.renderCompletion(buffer, completion)
	if suggest, ok := completion.GetSelectedSuggestion(); ok {
		cursor = r.backward(cursor, runewidth.StringWidth(buffer.Document().GetWordBeforeCursorUntilSeparator(completion.wordSeparator)))

		r.out.SetColor(r.previewSuggestionTextColor, r.previewSuggestionBGColor, false)
		r.out.WriteStr(suggest.Text)
		r.out.SetColor(DefaultColor, DefaultColor, false)
		cursor += runewidth.StringWidth(suggest.Text)

		rest := buffer.Document().TextAfterCursor()
		r.out.WriteStr(rest)
		cursor += runewidth.StringWidth(rest)
		r.lineWrap(cursor)

		cursor = r.backward(cursor, runewidth.StringWidth(rest))
	}
	r.previousCursor = cursor
}
92853
func (i *I) Render(ictx *Context) (string, error) {
	tpl, err := i.template(ictx)
	if err != nil {
		return "", err
	}

	var result bytes.Buffer
	var data interface{}
	if ictx != nil {
		data = ictx.Data
	}
	if err := tpl.Execute(&result, data); err != nil {
		return "", err
	}

	return result.String(), nil
}
947277
func (OracleRenderer) Render(cfg cloudinit.CloudConfig, os jujuos.OSType) ([]byte, error) {
	switch os {
	case jujuos.Ubuntu:
		return renderers.RenderYAML(cfg)
	default:
		return nil, errors.Errorf("Cannot encode userdata for OS: %s", os.String())
	}
}
424791
func (r String) Render(w http.ResponseWriter) error {
	return WriteString(w, r.Format, r.Data)
}