diff --git a/README.md b/README.md index db440e94..8082c29a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ -# Glamour +# Why is this forked? + +This is hard forked from github.com/charmbracelet/glamour to allow the `gh` maintainers to enhance the use of `glamour` in `gh`, while providing the flexibility for us to share modifications and extensions. It is not intended to be a long-term maintained fork and you should not rely on it. + +Once we determine how to address concerns for the project, we will decide what to do next based on how our needs align with the preferences of the maintainers of charmbracelet/glamour. + +## Original README with minor tweaks to indicate upstream/fork relationship

Glamour Title Treatment
diff --git a/examples/artichokes/main.go b/examples/artichokes/main.go index 231f154e..614f632b 100644 --- a/examples/artichokes/main.go +++ b/examples/artichokes/main.go @@ -6,7 +6,7 @@ import ( "log" "os" - "github.com/charmbracelet/glamour" + "github.com/cli/glamour" "github.com/muesli/termenv" ) diff --git a/examples/custom_renderer/main.go b/examples/custom_renderer/main.go index e92b0ae5..09a09f55 100644 --- a/examples/custom_renderer/main.go +++ b/examples/custom_renderer/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/charmbracelet/glamour" + "github.com/cli/glamour" ) func main() { diff --git a/examples/helloworld/main.go b/examples/helloworld/main.go index 53282da3..c4e1d0c8 100644 --- a/examples/helloworld/main.go +++ b/examples/helloworld/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/charmbracelet/glamour" + "github.com/cli/glamour" ) func main() { diff --git a/examples/stdin-stdout-custom-styles/main.go b/examples/stdin-stdout-custom-styles/main.go index 7633cf39..7296a2a3 100644 --- a/examples/stdin-stdout-custom-styles/main.go +++ b/examples/stdin-stdout-custom-styles/main.go @@ -14,7 +14,7 @@ import ( "io" "os" - "github.com/charmbracelet/glamour" + "github.com/cli/glamour" ) const defaultWidth = 80 diff --git a/examples/stdin-stdout/main.go b/examples/stdin-stdout/main.go index 83e0dcfe..47acbb3a 100644 --- a/examples/stdin-stdout/main.go +++ b/examples/stdin-stdout/main.go @@ -14,7 +14,7 @@ import ( "io" "os" - "github.com/charmbracelet/glamour" + "github.com/cli/glamour" ) const defaultWidth = 80 diff --git a/glamour.go b/glamour.go index 6e1e7e40..07b53d3b 100644 --- a/glamour.go +++ b/glamour.go @@ -15,8 +15,8 @@ import ( "github.com/yuin/goldmark/util" "golang.org/x/term" - "github.com/charmbracelet/glamour/ansi" - styles "github.com/charmbracelet/glamour/styles" + "github.com/cli/glamour/ansi" + styles "github.com/cli/glamour/styles" ) const ( @@ -215,6 +215,18 @@ func WithChromaFormatter(formatter string) TermRendererOption { } } +// WithOptions sets multiple TermRenderer options within a single TermRendererOption. +func WithOptions(options ...TermRendererOption) TermRendererOption { + return func(tr *TermRenderer) error { + for _, o := range options { + if err := o(tr); err != nil { + return err + } + } + return nil + } +} + func (tr *TermRenderer) Read(b []byte) (int, error) { return tr.renderBuf.Read(b) } diff --git a/glamour_test.go b/glamour_test.go index 4114998f..70c6e011 100644 --- a/glamour_test.go +++ b/glamour_test.go @@ -8,8 +8,8 @@ import ( "strings" "testing" - styles "github.com/charmbracelet/glamour/styles" "github.com/charmbracelet/x/exp/golden" + styles "github.com/cli/glamour/styles" ) const markdown = "testdata/readme.markdown.in" diff --git a/go.mod b/go.mod index 89af5a9c..5a631997 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/charmbracelet/glamour +module github.com/cli/glamour go 1.21 diff --git a/internal/generate-style-json/main.go b/internal/generate-style-json/main.go index ee2adb81..6a90c7ef 100644 --- a/internal/generate-style-json/main.go +++ b/internal/generate-style-json/main.go @@ -6,8 +6,8 @@ import ( "os" "path/filepath" - "github.com/charmbracelet/glamour/ansi" - styles "github.com/charmbracelet/glamour/styles" + "github.com/cli/glamour/ansi" + styles "github.com/cli/glamour/styles" ) func writeStyleJSON(filename string, styleConfig *ansi.StyleConfig) error { diff --git a/styles/dracula.go b/styles/dracula.go index 12eaf9d4..73c9c2e1 100644 --- a/styles/dracula.go +++ b/styles/dracula.go @@ -1,6 +1,6 @@ package styles -import "github.com/charmbracelet/glamour/ansi" +import "github.com/cli/glamour/ansi" // DraculaStyleConfig is the dracula style. var DraculaStyleConfig = ansi.StyleConfig{ diff --git a/styles/styles.go b/styles/styles.go index 422c7cfe..d29be6ed 100644 --- a/styles/styles.go +++ b/styles/styles.go @@ -3,7 +3,7 @@ package styles //go:generate go run ../internal/generate-style-json import ( - "github.com/charmbracelet/glamour/ansi" + "github.com/cli/glamour/ansi" ) const ( diff --git a/styles/tokyo-night.go b/styles/tokyo-night.go index 5cb966e2..17bd16cb 100644 --- a/styles/tokyo-night.go +++ b/styles/tokyo-night.go @@ -1,6 +1,6 @@ package styles -import "github.com/charmbracelet/glamour/ansi" +import "github.com/cli/glamour/ansi" // TokyoNightStyle is the tokyo night style. var TokyoNightStyleConfig = ansi.StyleConfig{