csharp

package
v1.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Key      string   `json:"key"`
	Type     string   `json:"type"`
	Lines    []string `json:"lines"`
	SkipDecl bool     `json:"skipDecl,omitempty"`
	Lints    []string `json:"lints,omitempty"`
}

func NewBlock

func NewBlock(k string, t string) *Block

func (*Block) ContainsText

func (b *Block) ContainsText(s string) bool

func (*Block) LineComplexity

func (b *Block) LineComplexity() int

func (*Block) LineCount

func (b *Block) LineCount() int

func (*Block) LineMaxLength

func (b *Block) LineMaxLength() int

func (*Block) Render

func (b *Block) Render(linebreak string) (string, error)

func (*Block) W

func (b *Block) W(l string, args ...any)

func (*Block) WB

func (b *Block) WB()

func (*Block) WE

func (b *Block) WE(indent int, prefix ...string)

type Blocks

type Blocks []*Block

type File

type File struct {
	Namespace string   `json:"namespace,omitempty"`
	Path      []string `json:"path,omitempty"`
	Name      string   `json:"name"`
	Imports   Imports  `json:"imports"`
	Blocks    Blocks   `json:"blocks"`
}

func NewFile

func NewFile(ns string, path []string, fn string) *File

func (*File) AddBlocks

func (f *File) AddBlocks(b ...*Block)

func (*File) AddImport

func (f *File) AddImport(i ...string)

func (*File) Render

func (f *File) Render() (*file.File, error)

type Imports

type Imports []string

func (Imports) Render

func (i Imports) Render(linebreak string) string

func (Imports) RenderHTML

func (i Imports) RenderHTML(linebreak string) string

type Template

type Template struct {
	Path    []string `json:"path,omitempty"`
	Name    string   `json:"name"`
	Imports Imports  `json:"imports"`
	Blocks  Blocks   `json:"blocks"`
}

func NewTemplate

func NewTemplate(path []string, fn string) *Template

func (*Template) AddBlocks

func (f *Template) AddBlocks(b ...*Block)

func (*Template) AddImport

func (f *Template) AddImport(i ...string)

func (*Template) Render

func (f *Template) Render() (*file.File, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL