commands: Deprecate --omitEmpty on chromastyles command · gohugoio/hugo@61ec7a2 (original) (raw)
`@@ -82,13 +82,13 @@ See https://xyproto.github.io/splash/docs/all.html for a preview of the availabl
`
82
82
`return err
`
83
83
` }
`
84
84
``
85
``
`-
var options []html.Option
`
86
85
`if omitEmpty {
`
87
``
`-
options = append(options, html.WithClasses(true))
`
88
``
`-
} else {
`
89
``
`-
options = append(options, html.WithAllClasses(true))
`
``
86
`+
// See https://github.com/alecthomas/chroma/commit/5b2a4c5a26c503c79bc86ba3c4ae5b330028bd3d
`
``
87
`+
hugo.Deprecate("--omitEmpty", "Flag is no longer needed, empty classes are now always omitted.", "v0.149.0")
`
``
88
`+
}
`
``
89
`+
options := []html.Option{
`
``
90
`+
html.WithCSSComments(!omitClassComments),
`
90
91
` }
`
91
``
`-
options = append(options, html.WithCSSComments(!omitClassComments))
`
92
92
`formatter := html.New(options...)
`
93
93
``
94
94
`w := os.Stdout
`
`@@ -106,7 +106,7 @@ See https://xyproto.github.io/splash/docs/all.html for a preview of the availabl
`
106
106
`_ = cmd.RegisterFlagCompletionFunc("lineNumbersInlineStyle", cobra.NoFileCompletions)
`
107
107
`` cmd.PersistentFlags().StringVar(&lineNumbersTableStyle, "lineNumbersTableStyle", "", foreground and background colors for table line numbers, e.g. --lineNumbersTableStyle "#fff000 bg:#000fff")
``
108
108
`_ = cmd.RegisterFlagCompletionFunc("lineNumbersTableStyle", cobra.NoFileCompletions)
`
109
``
`` -
cmd.PersistentFlags().BoolVar(&omitEmpty, "omitEmpty", false, omit empty CSS rules)
``
``
109
`` +
cmd.PersistentFlags().BoolVar(&omitEmpty, "omitEmpty", false, omit empty CSS rules (deprecated, no longer needed))
``
110
110
`_ = cmd.RegisterFlagCompletionFunc("omitEmpty", cobra.NoFileCompletions)
`
111
111
`` cmd.PersistentFlags().BoolVar(&omitClassComments, "omitClassComments", false, omit CSS class comment prefixes in the generated CSS)
``
112
112
`_ = cmd.RegisterFlagCompletionFunc("omitClassComments", cobra.NoFileCompletions)
`