Documentation
¶
Overview ¶
Package carbonize implements utilities to deal with Carbon configurations and ease interactions with its website.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
BackgroundColor string `json:"backgroundColor" url:"bg"`
Theme string `json:"theme" url:"t"`
WindowTheme string `json:"windowTheme" url:"wt"`
Language string `json:"language" url:"l"`
Width int `json:"width" url:"width"`
DropShadow bool `json:"dropShadow" url:"ds"`
DropShadowOffsetY string `json:"dropShadowOffsetY" url:"dsyoff"`
DropShadowBlurRadius string `json:"dropShadowBlurRadius" url:"dsblur"`
WindowControls bool `json:"windowControls" url:"wc"`
WidthAdjustment bool `json:"widthAdjustment" url:"wa"`
PaddingVertical string `json:"paddingVertical" url:"pv"`
PaddingHorizontal string `json:"paddingHorizontal" url:"ph"`
LineNumbers bool `json:"lineNumbers" url:"ln"`
FirstLineNumber int `json:"firstLineNumber" url:"fl"`
FontFamily string `json:"fontFamily" url:"fm"`
FontSize string `json:"fontSize" url:"fs"`
LineHeight string `json:"lineHeight" url:"lh"`
SquaredImage bool `json:"squaredImage" url:"si"`
ExportSize string `json:"exportSize" url:"es"`
Watermark bool `json:"watermark" url:"wm"`
Highlights Highlights `json:"highlights" url:"highlights"`
}
A Config is a configuration for Carbon.
func ParseConfig ¶
ParseConfig parses a file with a JSON configuration for Carbon.
Ideally, the configuration file should contain a configuration exported directly from the Carbon website.
func (*Config) QueryString ¶
QueryString builds a URL-encoded query string corresponding to the Config held by c.
type Highlights ¶
type Highlights struct {
Background string `json:"background" url:"background"`
Text string `json:"text" url:"text"`
Attribute string `json:"attribute" url:"attribute"`
Keyword string `json:"keyword" url:"keyword"`
Variable string `json:"variable" url:"variable"`
Definition string `json:"definition" url:"definition"`
Property string `json:"property" url:"property"`
String string `json:"string" url:"string"`
Meta string `json:"meta" url:"meta"`
Comment string `json:"comment" url:"comment"`
Number string `json:"number" url:"number"`
Operator string `json:"operator" url:"operator"`
}
A Highlights is encapsulated inside a Config. It contains information about the syntax highlighting that Carbon should use for each different token.
Click to show internal directories.
Click to hide internal directories.