diff --git a/.gitattributes b/.gitattributes index d7bdd748..913a1eff 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,9 @@ *.golden linguist-generated +styles/gallery/auto.png filter=lfs diff=lfs merge=lfs -text +styles/gallery/dark.png filter=lfs diff=lfs merge=lfs -text +styles/gallery/dracula.png filter=lfs diff=lfs merge=lfs -text +styles/gallery/light.png filter=lfs diff=lfs merge=lfs -text +styles/gallery/notty.png filter=lfs diff=lfs merge=lfs -text +styles/gallery/pink.png filter=lfs diff=lfs merge=lfs -text +styles/gallery/tokyo-night.png filter=lfs diff=lfs merge=lfs -text +styles/gallery/ascii.png filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md index 83f04b1b..6945bc45 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Stylesheet-based markdown rendering for your CLI apps. -![Glamour dark style example](https://stuff.charm.sh/glamour/glamour-example.png) +![Glamour dark style example](https://github.com/user-attachments/assets/55f9aa4b-5f15-4097-95f1-46a156324e45) `glamour` lets you render [markdown](https://en.wikipedia.org/wiki/Markdown) documents & templates on [ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code) @@ -59,6 +59,7 @@ You can find all available default styles in our [gallery](https://github.com/ch Want to create your own style? [Learn how!](https://github.com/charmbracelet/glamour/tree/master/styles) There are a few options for using a custom style: + 1. Call `glamour.Render(inputText, "desiredStyle")` 1. Set the `GLAMOUR_STYLE` environment variable to your desired default style or a file location for a style and call `glamour.RenderWithEnvironmentConfig(inputText)` 1. Set the `GLAMOUR_STYLE` environment variable and pass `glamour.WithEnvironmentConfig()` to your custom renderer @@ -66,8 +67,9 @@ There are a few options for using a custom style: ## Glamourous Projects Check out these projects, which use `glamour`: + - [Glow](https://github.com/charmbracelet/glow), a markdown renderer for -the command-line. + the command-line. - [GitHub CLI](https://github.com/cli/cli), GitHub’s official command line tool. - [GitLab CLI](https://gitlab.com/gitlab-org/cli), GitLab's official command line tool. - [Gitea CLI](https://gitea.com/gitea/tea), Gitea's official command line tool. @@ -77,15 +79,15 @@ the command-line. We’d love to hear your thoughts on this project. Feel free to drop us a note! -* [Twitter](https://twitter.com/charmcli) -* [The Fediverse](https://mastodon.social/@charmcli) -* [Discord](https://charm.sh/chat) +- [Twitter](https://twitter.com/charmcli) +- [The Fediverse](https://mastodon.social/@charmcli) +- [Discord](https://charm.sh/chat) ## License [MIT](https://github.com/charmbracelet/glamour/raw/master/LICENSE) -*** +--- Part of [Charm](https://charm.sh). diff --git a/examples/artichokes/artichokes.md b/examples/artichokes/artichokes.md index a4b69143..db7773c2 100644 --- a/examples/artichokes/artichokes.md +++ b/examples/artichokes/artichokes.md @@ -51,16 +51,15 @@ Remember that to compile Haskell you’ll need `ghc`. ```haskell module Main where -import Data.Function ( (&) ) -import Data.List ( intercalculate ) +import Data.List (intercalate) hello :: String -> String -hello s = - "Hello, " ++ s ++ "." +hello s = "Hello, " <> s <> "." main :: IO () -main = - map hello [ "artichoke", "alcachofa" ] & intercalculate "\n" & putStrLn +main = putStrLn + $ intercalate "\n" + $ hello <$> [ "artichoke", "alcachofa" ] ``` *** diff --git a/styles/gallery/ascii.png b/styles/gallery/ascii.png index 3e16c26e..483522de 100644 Binary files a/styles/gallery/ascii.png and b/styles/gallery/ascii.png differ diff --git a/styles/gallery/auto.png b/styles/gallery/auto.png index d62f66fa..0a6ec01f 100644 Binary files a/styles/gallery/auto.png and b/styles/gallery/auto.png differ diff --git a/styles/gallery/dark.png b/styles/gallery/dark.png index d62f66fa..f0d53307 100644 Binary files a/styles/gallery/dark.png and b/styles/gallery/dark.png differ diff --git a/styles/gallery/dracula.png b/styles/gallery/dracula.png index 5715063a..13d1adc4 100644 Binary files a/styles/gallery/dracula.png and b/styles/gallery/dracula.png differ diff --git a/styles/gallery/light.png b/styles/gallery/light.png index 02eea86a..6b156b3b 100644 Binary files a/styles/gallery/light.png and b/styles/gallery/light.png differ diff --git a/styles/gallery/notty.png b/styles/gallery/notty.png index 3e16c26e..483522de 100644 Binary files a/styles/gallery/notty.png and b/styles/gallery/notty.png differ diff --git a/styles/gallery/pink.png b/styles/gallery/pink.png index 42335e48..a168eb6e 100644 Binary files a/styles/gallery/pink.png and b/styles/gallery/pink.png differ diff --git a/styles/gallery/tokyo-night.png b/styles/gallery/tokyo-night.png index 7f63dea8..851d9421 100644 Binary files a/styles/gallery/tokyo-night.png and b/styles/gallery/tokyo-night.png differ diff --git a/testdata/example.md b/testdata/example.md index a4b69143..db7773c2 100644 --- a/testdata/example.md +++ b/testdata/example.md @@ -51,16 +51,15 @@ Remember that to compile Haskell you’ll need `ghc`. ```haskell module Main where -import Data.Function ( (&) ) -import Data.List ( intercalculate ) +import Data.List (intercalate) hello :: String -> String -hello s = - "Hello, " ++ s ++ "." +hello s = "Hello, " <> s <> "." main :: IO () -main = - map hello [ "artichoke", "alcachofa" ] & intercalculate "\n" & putStrLn +main = putStrLn + $ intercalate "\n" + $ hello <$> [ "artichoke", "alcachofa" ] ``` ***