settings

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ToolName = "rbxapiref"
	FileName = "settings.json"
)
View Source
const (
	ArchiveURL = "https://raw.githubusercontent.com/RobloxAPI/archive/master/"
	CDNURL     = "https://setup.rbxcdn.com/"
	DevHubURL  = "developer.roblox.com/api-reference"
)
View Source
const (
	ClassPath           = "class"
	EnumPath            = "enum"
	TypePath            = "type"
	FileExt             = ".html"
	MemberAnchorPrefix  = "member-"
	SectionAnchorPrefix = "section-"
	MainTitle           = "Roblox API Reference"
	TitleSep            = "-"
)

Variables

View Source
var Default = &Settings{
	Input: Input{
		Resources: "resources",
		Templates: "templates",
	},
	Output: Output{
		Root:         ".",
		Sub:          "ref",
		Resources:    "res",
		DocResources: "docres",
		Manifest:     "manifest",
	},
	Build: builds.Settings{
		Configs: map[string]fetch.Config{
			"Archive": {
				Builds:             fetch.NewLocations(ArchiveURL + "builds.json"),
				Latest:             fetch.NewLocations(ArchiveURL + "latest.json"),
				APIDump:            fetch.NewLocations(ArchiveURL + "data/api-dump/json/$HASH.json"),
				ReflectionMetadata: fetch.NewLocations(ArchiveURL + "data/reflection-metadata/xml/$HASH.xml"),
				ExplorerIcons: fetch.NewLocations(
					CDNURL+"$HASH-content-textures2.zip#ClassImages.PNG",
					CDNURL+"$HASH-RobloxStudio.zip#RobloxStudioBeta.exe",
				),
			},
			"Production": {
				Builds:             fetch.NewLocations(CDNURL + "DeployHistory.txt"),
				Latest:             fetch.NewLocations(CDNURL + "versionQTStudio"),
				APIDump:            fetch.NewLocations(CDNURL + "$HASH-API-Dump.json"),
				ReflectionMetadata: fetch.NewLocations(CDNURL + "$HASH-RobloxStudio.zip#ReflectionMetadata.xml"),
				ExplorerIcons: fetch.NewLocations(
					CDNURL+"$HASH-content-textures2.zip#ClassImages.PNG",
					CDNURL+"$HASH-RobloxStudio.zip#RobloxStudioBeta.exe",
				),
				Live: []fetch.Location{
					fetch.Location{
						Format: ".json",
						URL:    mustParseURL("https://versioncompatibility.api.roblox.com/GetCurrentClientVersionUpload/?apiKey=76e5a40c-3ae1-4028-9f10-7c62520bd94f&binaryType=WindowsStudio"),
					},
					fetch.Location{
						Format: ".json",
						URL:    mustParseURL("https://versioncompatibility.api.roblox.com/GetCurrentClientVersionUpload/?apiKey=76e5a40c-3ae1-4028-9f10-7c62520bd94f&binaryType=WindowsStudio64"),
					},
				},
			},
		},
		UseConfigs: []string{
			"Archive",
			"Production",
		},
	},
}
View Source
var StyleRobloxDark = styles.Register(chroma.MustNewStyle("roblox-dark", chroma.StyleEntries{
	chroma.Background:       "bg:#252525",
	chroma.LineHighlight:    "bg:#555555",
	chroma.LineNumbersTable: "#B4B4B4",
	chroma.LineNumbers:      "#B4B4B4",
	chroma.Error:            "#FF0000",
	chroma.Keyword:          "#F86D7C bold",
	chroma.Name:             "#CCCCCC",
	chroma.LiteralString:    "#ADF195",
	chroma.LiteralNumber:    "#FFC600",
	chroma.Operator:         "#CCCCCC",
	chroma.OperatorWord:     "#F86D7C bold",
	chroma.Punctuation:      "#CCCCCC",
	chroma.Comment:          "#666666",
	chroma.CommentPreproc:   "#66FFCC",
}))

StyleRobloxDark is a dark theme for code syntax highlighting.

View Source
var StyleRobloxLight = styles.Register(chroma.MustNewStyle("roblox-light", chroma.StyleEntries{
	chroma.Background:       "bg:#FFFFFF",
	chroma.LineHighlight:    "bg:#E2E6D6",
	chroma.LineNumbersTable: "#7F7F7F",
	chroma.LineNumbers:      "#7F7F7F",
	chroma.Error:            "#FF0000",
	chroma.Keyword:          "#00007F bold",
	chroma.Name:             "#000000",
	chroma.LiteralString:    "#7F007F",
	chroma.LiteralNumber:    "#007F7F",
	chroma.Operator:         "#7F7F00",
	chroma.OperatorWord:     "#00007F bold",
	chroma.Punctuation:      "#7F7F00",
	chroma.Comment:          "#007F00",
	chroma.CommentPreproc:   "#7F0000",
}))

StyleRobloxLight is a light theme for code syntax highlighting.

Functions

This section is empty.

Types

type Input

type Input struct {
	// Resources is the directory containing resource files.
	Resources string
	// Templates is the directory containing template files.
	Templates string
	// Documents is the directory containing document files.
	Documents string
	// DocResources is the directory containing document resource files.
	DocResources string
	// UseGit sets whether document parsing is aware of git. If so, only
	// committed content will be used. That is, untracked files are ignored, and
	// only committed modifications to a file are used.
	UseGit bool
}

type Output

type Output struct {
	// Root is the directory to which generated files will be written.
	Root string
	// Sub is a path that follows the output directory and precedes a
	// generated file path.
	Sub string
	// Resources is the path relative to Sub where generated resource files
	// will be written.
	Resources string
	// DocResources is the path relative to Sub where document resource files
	// will be written.
	DocResources string
	// Manifest is the path relative to Sub that points to the manifest file.
	Manifest string
	// Host is the host part of the absolute URL of the site.
	Host string
}

func (*Output) AbsFilePath

func (o *Output) AbsFilePath(typ string, args ...string) string

AbsFilePath generates an absolute path located in the Output. On a web server serving static files, the returned path is meant to point to the same file as the file pointed to by the URL generated by FileLink.

func (*Output) AbsPath

func (o *Output) AbsPath(p string) string

AbsPath transforms a relative path into an absolute path.

func (o *Output) AbsPathFromLink(l string) string

AbsPathFromLink transforms a link into an absolute path, if possible.

func (o *Output) FileLink(linkType string, args ...string) (s string)

FileLink generates a URL, relative to an arbitrary host.

func (*Output) FilePath

func (o *Output) FilePath(typ string, args ...string) string

FilePath generates a file path relative to the output root directory. On a web server serving static files, the returned path is meant to point to the same file as the file pointed to by the URL generated by FileLink.

func (*Output) LinkFromPath

func (o *Output) LinkFromPath(p string) string

LinkFromPath transforms a path into a link, if possible.

func (*Output) ParseDocReference

func (o *Output) ParseDocReference(ref string) (scheme, path, link string)
func (o *Output) PathFromLink(l string) string

PathFromLink transforms a link into a path, if possible.

type Settings

type Settings struct {
	// Input specifies input settings.
	Input Input
	// Output specifies output settings.
	Output Output
	// Build specifies build settings.
	Build builds.Settings
}

func (*Settings) Copy

func (settings *Settings) Copy() *Settings

func (*Settings) ReadFile

func (settings *Settings) ReadFile(filename string) error

func (*Settings) ReadFrom

func (settings *Settings) ReadFrom(r io.Reader) (n int64, err error)

func (*Settings) WriteFile

func (settings *Settings) WriteFile(filename string) error

func (*Settings) WriteTo

func (settings *Settings) WriteTo(w io.Writer) (n int64, err error)

Jump to

Keyboard shortcuts

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