diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b15e17..08f1d4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.9.0] - 2022-07-31 ### Changed - Rich-CLI now assumes that the input file is encoded in UTF-8 https://github.com/Textualize/rich-cli/pull/56 +- Add support for setting `--hyperlinks` via the `RICH_HYPERLINKS` environment variable https://github.com/Textualize/rich-cli/pull/58 ## [1.8.0] - 2022-05-07 diff --git a/README.md b/README.md index 21f9bb6..01c3e3e 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,12 @@ If your terminal supports hyperlinks, you can add `--hyperlinks` or `-y` which w rich README.md --hyperlinks ``` +This can also be set via the `RICH_HYPERLINKS` environment variable. So the following is equivalent to the above command: + +``` +RICH_HYPERLINKS=true rich README.md +``` + ## Jupyter notebook You can request Jupyter notebook rendering by adding the `--ipynb` switch. If the file ends with `.ipynb` Jupyter notebook will be auto-detected. diff --git a/pyproject.toml b/pyproject.toml index f766f86..c6cfa1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "rich-cli" homepage = "https://github.com/Textualize/rich-cli" -version = "1.8.0" +version = "1.9.0" description = "Command Line Interface to Rich" authors = ["Will McGugan "] license = "MIT" diff --git a/src/rich_cli/__main__.py b/src/rich_cli/__main__.py index aa0a068..493bcf4 100644 --- a/src/rich_cli/__main__.py +++ b/src/rich_cli/__main__.py @@ -37,7 +37,7 @@ "toml": "toml", } -VERSION = "1.8.0" +VERSION = "1.9.0" AUTO = 0 @@ -370,7 +370,13 @@ class OptionHighlighter(RegexHighlighter): default=None, help="Use [b]LEXER[/b] for syntax highlighting. [dim]See https://pygments.org/docs/lexers/", ) -@click.option("--hyperlinks", "-y", is_flag=True, help="Render hyperlinks in markdown.") +@click.option( + "--hyperlinks", + "-y", + is_flag=True, + help="Render hyperlinks in markdown.", + envvar="RICH_HYPERLINKS", +) @click.option( "--no-wrap", is_flag=True, help="Don't word wrap syntax highlighted files." )