internal

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigFiles = map[string]string{
	"makefile": "Makefile",
	"rakefile": "Rakefile",
	"gemfile":  "Gemfile",

	".gitignore":  ".gitignore",
	".gitmodules": ".gitmodules",
	".gitconfig":  ".gitconfig",

	"dockerfile":         "Dockerfile",
	"docker-compose.yml": "Docker Compose file",

	"package.json":  "package.json",
	"yarn.lock":     "yarn.lock",
	"tsconfig.json": "tsconfig.json",

	"go.mod": "go.mod",
	"go.sum": "go.sum",
}

Config files, map as file name -> file label. These files are commonly used in programming projects.

View Source
var GlobalOpts = &GlobalOptions{}
View Source
var IsDebugEnabled = false

Debug mode

View Source
var SupportedLanguages = map[string]*LanguageDefinition{
	".s":   newLangDef("Assembly", []string{"//"}, [][]string{{"/*", "*/"}}),
	".asm": newLangDef("Assembly", []string{";"}, [][]string{{"", ""}}),
	".S":   newLangDef("Assembly", []string{"//"}, [][]string{{"/*", "*/"}}),
	".c":   newLangDef("C", []string{"//"}, [][]string{{"/*", "*/"}}),
	".h":   newLangDef("C Header", []string{"//"}, [][]string{{"/*", "*/"}}),
	".hh":  newLangDef("C++ Header", []string{"//"}, [][]string{{"/*", "*/"}}),
	".hpp": newLangDef("C++ Header", []string{"//"}, [][]string{{"/*", "*/"}}),
	".cpp": newLangDef("C++", []string{"//"}, [][]string{{"/*", "*/"}}),
	".cs":  newLangDef("C#", []string{"//"}, [][]string{{"/*", "*/"}}),
	".rs":  newLangDef("Rust", []string{"//"}, [][]string{{"/*", "*/"}}),
	".lua": newLangDef("Lua", []string{"--"}, [][]string{{"--[[", "]]"}}),
	".ml":  newLangDef("OCaml", []string{""}, [][]string{{"(*", "*)"}}),

	".js":  newLangDef("JavaScript", []string{"//"}, [][]string{{"/*", "*/"}}),
	".mjs": newLangDef("JavaScript", []string{"//"}, [][]string{{"/*", "*/"}}),
	".cjs": newLangDef("JavaScript", []string{"//"}, [][]string{{"/*", "*/"}}),

	".jsx": newLangDef("ReactJS", []string{"//"}, [][]string{{"/*", "*/"}}),
	".tsx": newLangDef("ReactJS", []string{"//"}, [][]string{{"/*", "*/"}}),
	".vue": newLangDef("Vue", []string{"//"}, [][]string{{"/*", "*/"}, {"<!--", "-->"}}),

	".ts":  newLangDef("TypeScript", []string{"//"}, [][]string{{"/*", "*/"}}),
	".mts": newLangDef("TypeScript", []string{"//"}, [][]string{{"/*", "*/"}}),
	".cts": newLangDef("TypeScript", []string{"//"}, [][]string{{"/*", "*/"}}),

	".java":  newLangDef("Java", []string{"//"}, [][]string{{"/*", "*/"}}),
	".php":   newLangDef("PHP", []string{"//"}, [][]string{{"/*", "*/"}}),
	".py":    newLangDef("Python", []string{"#"}, [][]string{{`"""`, `"""`}}),
	".pl":    newLangDef("Perl", []string{"#"}, [][]string{{":=", ":=cut"}}),
	".rb":    newLangDef("Ruby", []string{"#"}, [][]string{{":=begin", ":=end"}}),
	".swift": newLangDef("Swift", []string{"//"}, [][]string{{"/*", "*/"}}),
	".go":    newLangDef("Go", []string{"//"}, [][]string{{"/*", "*/"}}),
	".kt":    newLangDef("Kotlin", []string{"//"}, [][]string{{"/*", "*/"}}),
	".scala": newLangDef("Scala", []string{"//"}, [][]string{{"/*", "*/"}}),
	".r":     newLangDef("R", []string{"#"}, [][]string{{"/*", "*/"}}),

	".sh":   newLangDef("Shell", []string{"#"}, [][]string{{"", ""}}),
	".zsh":  newLangDef("Shell", []string{"#"}, [][]string{{"", ""}}),
	".bash": newLangDef("Shell", []string{"#"}, [][]string{{"", ""}}),

	".html": newLangDef("HTML", []string{"<!--", "//"}, [][]string{{"<!--", "-->"}}),
	".xml":  newLangDef("XML", []string{"<!--"}, [][]string{{"<!--", "-->"}}),
	".css":  newLangDef("CSS", []string{"//"}, [][]string{{"/*", "*/"}}),
	".sass": newLangDef("SASS", []string{"//"}, [][]string{{"/*", "*/"}}),
	".scss": newLangDef("SASS", []string{"//"}, [][]string{{"/*", "*/"}}),
	".less": newLangDef("LESS", []string{"//"}, [][]string{{"/*", "*/"}}),
	".svg":  newLangDef("SVG", []string{""}, [][]string{{"<!--", "-->"}}),

	".json": newLangDef("JSON", []string{}, [][]string{{"", ""}}),
	".yaml": newLangDef("YAML", []string{"#"}, [][]string{{"", ""}}),
	".toml": newLangDef("TOML", []string{"#"}, [][]string{{"", ""}}),

	".md":  newLangDef("Markdown", []string{}, [][]string{{"", ""}}),
	".txt": newLangDef("Plain Text", []string{}, [][]string{{"", ""}}),
	".sql": newLangDef("SQL", []string{"--"}, [][]string{{"/*", "*/"}}),
}

Supported programming languages, map as file extension -> language name.

Functions

This section is empty.

Types

type GlobalOptions added in v0.1.5

type GlobalOptions struct {
	MatchRegexp      string
	IgnoreRegexp     string
	IsShowMatched    bool
	IsShowIgnored    bool
	IsDebugEnabled   bool
	ViewMode         string
	OutputFormat     string
	IsProfileEnabled bool
	RootDirs         []string
	Cwd              string
}

Global options GlobalOptions represents the global options for the codetalks. can be initialized by CLI flags.

type LanguageDefinition

type LanguageDefinition struct {
	Name          string     `json:"name"`
	LineComments  []string   `json:"line_comment"`
	BlockComments [][]string `json:"block_comment"`
}

LanguageDefinition represents a programming language definition.

Directories

Path Synopsis
Ported from : https://raw.githubusercontent.com/sabhiram/go-gitignore/master/ignore.go
Ported from : https://raw.githubusercontent.com/sabhiram/go-gitignore/master/ignore.go

Jump to

Keyboard shortcuts

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