Skip to content

Commit

Permalink
docs: add FAQ (#189)
Browse files Browse the repository at this point in the history
* docs: add FAQ

* chore(docs): update encoding/locale answer in FAQ

* chore(docs): update color profile disclaimer

* chore(docs): faq copyedits

* chore(docs): additional faq copy edits

* fix(docs): add missing closing code block in faq

---------

Co-authored-by: Christian Rocha <christian@rocha.is>
  • Loading branch information
bashbunni and meowgorithm authored May 23, 2023
1 parent 9bc8570 commit 859b49e
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,45 @@ You can also style the whitespace. For details, see [the docs][docs].

***

## FAQ

<details>
<summary>
Why are things misaligning? Why are borders at the wrong widths?
</summary>
<p>This is most likely due to your locale and encoding, particularly with
regard to Chinese, Japanese, and Korean (for example, <code>zh_CN.UTF-8</code>
or <code>ja_JP.UTF-8</code>). The most direct way to fix this is to set
<code>RUNEWIDTH_EASTASIAN=0</code> in your environment.</p>

<p>For details see <a href="https://github.com/charmbracelet/lipgloss/issues/40">https://github.com/charmbracelet/lipgloss/issues/40.</a></p>
</details>

<details>
<summary>
Why isn't Lip Gloss displaying colors?
</summary>
<p>Lip Gloss automatically degrades colors to the best available option in the
given terminal, and if output's not a TTY it will remove color output entirely.
This is common when running tests, CI, or when piping output elsewhere.</p>

<p>If necessary, you can force a color profile in your tests with
<a href="https://pkg.go.dev/github.com/charmbracelet/lipgloss#SetColorProfile"><code>SetColorProfile</code></a>.</p>

```go
import (
"github.com/charmbracelet/lipgloss"
"github.com/muesli/termenv"
)

lipgloss.SetColorProfile(termenv.TrueColor)
```

*Note:* this option limits the flexibility of your application and can cause
ANSI escape codes to be output in cases where that might not be desired. Take
careful note of your use case and environment before choosing to force a color
profile.
</details>

## What about [Bubble Tea][tea]?

Expand Down

0 comments on commit 859b49e

Please sign in to comment.