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
|
||||
|
|
|
@ -39,6 +39,9 @@ var (
|
|||
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",
|
||||
|
@ -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() {
|
||||
|
|
|
@ -25,6 +25,8 @@ type RevealParams struct {
|
|||
NavigationMode string
|
||||
HorizontalSeparator string
|
||||
VerticalSeparator string
|
||||
SlideNumberVisibility string
|
||||
SlideNumberFormat string
|
||||
StyleSheets []string
|
||||
}
|
||||
|
||||
|
@ -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