feat: added switches to configure slide numbers
This commit is contained in:
parent
667bc0e2cb
commit
bbbbb0b141
3 changed files with 26 additions and 16 deletions
|
@ -37,6 +37,8 @@
|
|||
hash: true,
|
||||
transition: '{{ .Reveal.Transition }}', // none/fade/slide/convex/concave/zoom
|
||||
navigationMode: '{{ .Reveal.NavigationMode }}',
|
||||
showSlideNumber: '{{ .Reveal.SlideNumberVisibility }}',
|
||||
slideNumber: '{{ .Reveal.SlideNumberFormat }}',
|
||||
markdown: {
|
||||
smartypants: true,
|
||||
smartLists: true
|
||||
|
|
|
@ -32,14 +32,17 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
cfgFile string
|
||||
theme string
|
||||
codeTheme string
|
||||
transition string
|
||||
navigationMode string
|
||||
horizontalSeparator string
|
||||
verticalSeparator string
|
||||
rootCmd = &cobra.Command{
|
||||
cfgFile string
|
||||
theme string
|
||||
codeTheme string
|
||||
transition string
|
||||
navigationMode string
|
||||
horizontalSeparator string
|
||||
verticalSeparator string
|
||||
showSlideNumbers bool
|
||||
slideNumberVisibility string
|
||||
slideNumberFormat string
|
||||
rootCmd = &cobra.Command{
|
||||
Use: "goveal",
|
||||
Short: "goveal is a small reveal.js server",
|
||||
Long: `goveal is a single static binary to host your reveal.js based markdown presentation.
|
||||
|
@ -69,7 +72,8 @@ func init() {
|
|||
rootCmd.PersistentFlags().StringVar(&horizontalSeparator, "horizontal-separator", "===", "horizontal separator in slides")
|
||||
rootCmd.PersistentFlags().StringVar(&verticalSeparator, "vertical-separator", "---", "vertical separator in slides")
|
||||
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.go-reveal-slides.yaml)")
|
||||
|
||||
rootCmd.PersistentFlags().StringVar(&slideNumberVisibility, "slide-number-visibility", "all", "where should slide numbers be visible ['all', 'speaker', 'print']")
|
||||
rootCmd.PersistentFlags().StringVar(&slideNumberFormat, "slide-number-format", "h.v", "Format of the slide number ['h.v', 'h/v', 'c', 'c/t']")
|
||||
}
|
||||
|
||||
func initLogging() {
|
||||
|
|
|
@ -19,13 +19,15 @@ import (
|
|||
)
|
||||
|
||||
type RevealParams struct {
|
||||
Theme string
|
||||
CodeTheme string
|
||||
Transition string
|
||||
NavigationMode string
|
||||
HorizontalSeparator string
|
||||
VerticalSeparator string
|
||||
StyleSheets []string
|
||||
Theme string
|
||||
CodeTheme string
|
||||
Transition string
|
||||
NavigationMode string
|
||||
HorizontalSeparator string
|
||||
VerticalSeparator string
|
||||
SlideNumberVisibility string
|
||||
SlideNumberFormat string
|
||||
StyleSheets []string
|
||||
}
|
||||
|
||||
func (params *RevealParams) Load() {
|
||||
|
@ -36,4 +38,6 @@ func (params *RevealParams) Load() {
|
|||
params.HorizontalSeparator = viper.GetString("horizontal-separator")
|
||||
params.VerticalSeparator = viper.GetString("vertical-separator")
|
||||
params.StyleSheets = viper.GetStringSlice("stylesheets")
|
||||
params.SlideNumberVisibility = viper.GetString("slide-number-visibility")
|
||||
params.SlideNumberFormat = viper.GetString("slide-number-format")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue