csharp

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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