2021-12-22 10:52:02 +00:00
|
|
|
package config
|
|
|
|
|
2022-02-16 13:18:08 +00:00
|
|
|
const (
|
|
|
|
defaultWidth uint = 960
|
|
|
|
defaultHeight uint = 700
|
|
|
|
)
|
|
|
|
|
2021-12-22 19:27:43 +00:00
|
|
|
var defaults = map[string]interface{}{
|
|
|
|
"mermaid.theme": "forest",
|
|
|
|
"theme": "beige",
|
2022-02-16 13:18:08 +00:00
|
|
|
"width": defaultWidth,
|
|
|
|
"height": defaultHeight,
|
2021-12-22 19:27:43 +00:00
|
|
|
"codeTheme": "monokai",
|
2021-12-22 22:05:59 +00:00
|
|
|
"verticalSeparator": `\*\*\*`,
|
|
|
|
"horizontalSeparator": `---`,
|
2021-12-22 19:27:43 +00:00
|
|
|
"transition": TransitionNone,
|
|
|
|
"controlsLayout": ControlsLayoutEdges,
|
|
|
|
"controls": true,
|
|
|
|
"progress": true,
|
|
|
|
"history": true,
|
|
|
|
"center": true,
|
|
|
|
"slideNumber": true,
|
|
|
|
"menu.numbers": true,
|
|
|
|
"menu.useTextContentForMissingTitles": true,
|
2021-12-22 21:31:45 +00:00
|
|
|
"menu.transitions": true,
|
|
|
|
"menu.hideMissingTitles": true,
|
|
|
|
"menu.markers": true,
|
|
|
|
"menu.openButton": true,
|
2021-12-22 19:27:43 +00:00
|
|
|
}
|
2021-12-22 10:52:02 +00:00
|
|
|
|
|
|
|
const (
|
|
|
|
TransitionNone Transition = "none"
|
|
|
|
TransitionFade Transition = "fade"
|
|
|
|
TransitionSlide Transition = "slide"
|
|
|
|
TransitionConvex Transition = "convex"
|
|
|
|
TransitionConcave Transition = "concave"
|
|
|
|
TransitionZoom Transition = "zoom"
|
2021-12-22 19:19:05 +00:00
|
|
|
|
|
|
|
ControlsLayoutBottomRight ControlsLayout = "bottom-right"
|
|
|
|
ControlsLayoutEdges ControlsLayout = "edges"
|
2021-12-22 10:52:02 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
2021-12-22 19:19:05 +00:00
|
|
|
Transition string
|
|
|
|
ControlsLayout string
|
|
|
|
Mermaid struct {
|
2021-12-22 10:52:02 +00:00
|
|
|
Theme string `json:"theme"`
|
|
|
|
}
|
|
|
|
Rendering struct {
|
|
|
|
VerticalSeparator string
|
|
|
|
HorizontalSeparator string
|
|
|
|
Stylesheets []string
|
|
|
|
}
|
|
|
|
Reveal struct {
|
2021-12-22 19:19:05 +00:00
|
|
|
Theme string `json:"theme"`
|
|
|
|
CodeTheme string `json:"codeTheme"`
|
|
|
|
Transition Transition `json:"transition"`
|
|
|
|
Controls bool `json:"controls"`
|
|
|
|
ControlsLayout ControlsLayout `json:"controlsLayout"`
|
|
|
|
Progress bool `json:"progress"`
|
|
|
|
History bool `json:"history"`
|
|
|
|
Center bool `json:"center"`
|
|
|
|
SlideNumber bool `json:"slideNumber"`
|
2022-02-16 13:18:08 +00:00
|
|
|
Width uint `json:"width"`
|
|
|
|
Height uint `json:"height"`
|
2021-12-22 19:19:05 +00:00
|
|
|
Menu struct {
|
2021-12-22 10:52:02 +00:00
|
|
|
Numbers bool `json:"numbers"`
|
|
|
|
UseTextContentForMissingTitles bool `json:"useTextContentForMissingTitles"`
|
2021-12-22 21:31:45 +00:00
|
|
|
Transitions bool `json:"transitions"`
|
|
|
|
HideMissingTitles bool `json:"hideMissingTitles"`
|
|
|
|
Markers bool `json:"markers"`
|
|
|
|
OpenButton bool `json:"openButton"`
|
2021-12-22 10:52:02 +00:00
|
|
|
} `json:"menu"`
|
|
|
|
}
|
|
|
|
Components struct {
|
|
|
|
ConfigFileInUse string `mapstructure:"-"`
|
|
|
|
Reveal Reveal `mapstructure:",squash"`
|
|
|
|
Rendering Rendering `mapstructure:",squash"`
|
|
|
|
Mermaid Mermaid
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
func (t Transition) String() string {
|
2021-12-22 19:27:43 +00:00
|
|
|
return string(t)
|
2021-12-22 10:52:02 +00:00
|
|
|
}
|