You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Copyright 2017-present The Hugo Authors. All rights reserved.
2
+
//
3
+
// Licensed under the Apache License, Version 2.0 (the "License");
4
+
// you may not use this file except in compliance with the License.
5
+
// You may obtain a copy of the License at
6
+
// http://www.apache.org/licenses/LICENSE-2.0
7
+
//
8
+
// Unless required by applicable law or agreed to in writing, software
9
+
// distributed under the License is distributed on an "AS IS" BASIS,
10
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+
// See the License for the specific language governing permissions and
12
+
// limitations under the License.
13
+
14
+
package commands
15
+
16
+
import (
17
+
"os"
18
+
19
+
"github.com/alecthomas/chroma"
20
+
"github.com/alecthomas/chroma/formatters/html"
21
+
"github.com/alecthomas/chroma/styles"
22
+
"github.com/spf13/cobra"
23
+
)
24
+
25
+
typegenChromaStylesstruct {
26
+
stylestring
27
+
highlightStylestring
28
+
linesStylestring
29
+
cmd*cobra.Command
30
+
}
31
+
32
+
// TODO(bep) highlight
33
+
funccreateGenChromaStyles() *genChromaStyles {
34
+
g:=&genChromaStyles{
35
+
cmd: &cobra.Command{
36
+
Use: "chromastyles",
37
+
Short: "Generate CSS stylesheet for the Chroma code highlighter",
38
+
Long: `Generate CSS stylesheet for the Chroma code highlighter for a given style. This stylesheet is needed if pygmentsUseClasses is enabled in config.
39
+
40
+
See https://help.farbox.com/pygments.html for preview of available styles`,
g.cmd.PersistentFlags().StringVar(&g.style, "style", "friendly", "highlighter style (see https://help.farbox.com/pygments.html)")
49
+
g.cmd.PersistentFlags().StringVar(&g.highlightStyle, "highlightStyle", "bg:#ffffcc", "style used for highlighting lines (see https://github.com/alecthomas/chroma)")
50
+
g.cmd.PersistentFlags().StringVar(&g.linesStyle, "linesStyle", "", "style used for line numbers (see https://github.com/alecthomas/chroma)")
0 commit comments