From fd26e24130887febed32d7c05413ec39471d8f4c Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Wed, 26 Feb 2025 16:36:27 +0000 Subject: [PATCH] update docs with syntax extras --- docs/examples/widgets/text_area_custom_language.py | 2 +- docs/getting_started.md | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/examples/widgets/text_area_custom_language.py b/docs/examples/widgets/text_area_custom_language.py index 1fba66403..f96dbc72a 100644 --- a/docs/examples/widgets/text_area_custom_language.py +++ b/docs/examples/widgets/text_area_custom_language.py @@ -22,7 +22,7 @@ class TextAreaCustomLanguage(App): text_area.cursor_blink = False # Register the Java language and highlight query - text_area.register_language(java_language, java_highlight_query) + text_area.register_language("java", java_language, java_highlight_query) # Switch to Java text_area.language = "java" diff --git a/docs/getting_started.md b/docs/getting_started.md index 5081bef36..e32396618 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -1,10 +1,11 @@ + All you need to get started building Textual apps. ## Requirements Textual requires Python 3.8 or later (if you have a choice, pick the most recent Python). Textual runs on Linux, macOS, Windows and probably any OS where Python also runs. -!!! info inline end "Your platform" +!!! info "Your platform" ### :fontawesome-brands-linux: Linux (all distros) @@ -12,12 +13,13 @@ Textual requires Python 3.8 or later (if you have a choice, pick the most recent ### :material-apple: macOS - The default terminal app is limited to 256 colors. We recommend installing a newer terminal such as [iterm2](https://iterm2.com/), [Kitty](https://sw.kovidgoyal.net/kitty/), or [WezTerm](https://wezfurlong.org/wezterm/). + The default terminal app is limited to 256 colors. We recommend installing a newer terminal such as [iterm2](https://iterm2.com/), [Ghostty](https://ghostty.org/), [Kitty](https://sw.kovidgoyal.net/kitty/), or [WezTerm](https://wezfurlong.org/wezterm/). ### :material-microsoft-windows: Windows The new [Windows Terminal](https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=en-gb&gl=GB) runs Textual apps beautifully. + ## Installation Here's how to install Textual. @@ -36,6 +38,12 @@ If you plan on developing Textual apps, you should also install textual develope pip install textual-dev ``` +If you would like to enable syntax highlighting in the [TextArea](./widgets/text_area.md) widget, you should specify the "syntax" extras when you install Textual: + +``` +pip install "textual[syntax]" +``` + ### From conda-forge Textual is also available on [conda-forge](https://conda-forge.org/). The preferred package manager for conda-forge is currently [micromamba](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html):