Skip to content

Commit

Permalink
Bypass typo over-fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Apr 4, 2024
1 parent 92a5f02 commit 7dd092a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/pygments.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ This `ansi-html` formatter is designed to only work with the `ansi-color` lexer.

### Formatter usage

To test it, let's generate a `cowsay.ans` file that is full of ANSI colors:
To test it, let's generate a `cowsay.ansi` file that is full of ANSI colors:

```ansi-shell-session
$ fortune | cowsay | lolcat --force > ./cowsay.ans
$ cat ./cowsay.ans
$ fortune | cowsay | lolcat --force > ./cowsay.ansi
$ cat ./cowsay.ansi
 ________________________________ 
/ Reality is for people who lack \
\ imagination.                   /
Expand All @@ -84,7 +84,7 @@ from pygments.formatters import get_formatter_by_name
lexer = get_lexer_by_name("ansi-color")
formatter = get_formatter_by_name("ansi-html")

ansi_content = Path("./cowsay.ans").read_text()
ansi_content = Path("./cowsay.ansi").read_text()

print(highlight(ansi_content, lexer, formatter))
```
Expand Down Expand Up @@ -295,10 +295,10 @@ See how the raw string is split into Pygments tokens, including the new `Token.C

Because they're properly registered to Pygments, all these new components can be invoked with the [`pygmentize` CLI](https://pygments.org/docs/cmdline/).

For example, here is how we can render the `cowsay.ans` file from the [example above](<>) into a standalone HTML file:
For example, here is how we can render the `cowsay.ansi` file from the [example above](<>) into a standalone HTML file:

```ansi-shell-session
$ pygmentize -f ansi-html -O full -o cowsay.html ./cowsay.ans
$ pygmentize -f ansi-html -O full -o cowsay.html ./cowsay.ansi
$ cat cowsay.html
```

Expand Down

0 comments on commit 7dd092a

Please sign in to comment.