Skip to content

Commit 061a88d

Browse files
authored
Merge pull request #3129 from davep/faq-in-docs
Move the Textual FAQ into the main docs
2 parents bf0c025 + a9de513 commit 061a88d

File tree

5 files changed

+18
-37
lines changed

5 files changed

+18
-37
lines changed

.faq/FAQ.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1+
---
2+
hide:
3+
- navigation
4+
---
5+
16
<!-- Auto-generated by FAQtory -->
27
<!-- Do not edit by hand! -->
38

49
# Frequently Asked Questions
510

6-
{%- for question in questions %}
7-
- [{{ question.title }}](#{{ question.slug }})
8-
{%- endfor %}
9-
10-
1111
{%- for question in questions %}
1212

13-
<a name="{{ question.slug }}"></a>
1413
## {{ question.title }}
1514

1615
{{ question.body }}

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ format-check:
2828
clean-screenshot-cache:
2929
rm -rf .screenshot_cache
3030

31+
.PHONY: faq
32+
faq:
33+
$(run) faqtory build
34+
3135
.PHONY: docs-offline-nav
3236
docs-offline-nav:
3337
echo "INHERIT: mkdocs-offline.yml" > mkdocs-nav-offline.yml
@@ -67,10 +71,6 @@ docs-deploy: clean-screenshot-cache docs-online-nav
6771
$(run) mkdocs gh-deploy --config-file mkdocs-nav-online.yml
6872
rm -f mkdocs-nav-online.yml
6973

70-
.PHONY: faq
71-
faq:
72-
$(run) faqtory build
73-
7474
.PHONY: build
7575
build: docs-build-offline
7676
poetry build

FAQ.md renamed to docs/FAQ.md

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
1+
---
2+
hide:
3+
- navigation
4+
---
5+
16
<!-- Auto-generated by FAQtory -->
27
<!-- Do not edit by hand! -->
38

49
# Frequently Asked Questions
5-
- [Does Textual support images?](#does-textual-support-images)
6-
- [How can I fix ImportError cannot import name ComposeResult from textual.app ?](#how-can-i-fix-importerror-cannot-import-name-composeresult-from-textualapp-)
7-
- [How can I select and copy text in a Textual app?](#how-can-i-select-and-copy-text-in-a-textual-app)
8-
- [How can I set a translucent app background?](#how-can-i-set-a-translucent-app-background)
9-
- [How do I center a widget in a screen?](#how-do-i-center-a-widget-in-a-screen)
10-
- [How do I fix WorkerDeclarationError?](#how-do-i-fix-workerdeclarationerror)
11-
- [How do I pass arguments to an app?](#how-do-i-pass-arguments-to-an-app)
12-
- [No widget called TextLog](#no-widget-called-textlog)
13-
- [Why do some key combinations never make it to my app?](#why-do-some-key-combinations-never-make-it-to-my-app)
14-
- [Why doesn't Textual look good on macOS?](#why-doesn't-textual-look-good-on-macos)
15-
- [Why doesn't Textual support ANSI themes?](#why-doesn't-textual-support-ansi-themes)
16-
- [Why doesn't the `DataTable` scroll programmatically?](#why-doesn't-the-`datatable`-scroll-programmatically)
17-
18-
<a name="does-textual-support-images"></a>
10+
1911
## Does Textual support images?
2012

2113
Textual doesn't have built-in support for images yet, but it is on the [Roadmap](https://textual.textualize.io/roadmap/).
2214

2315
See also the [rich-pixels](https://github.com/darrenburns/rich-pixels) project for a Rich renderable for images that works with Textual.
2416

25-
<a name="how-can-i-fix-importerror-cannot-import-name-composeresult-from-textualapp-"></a>
2617
## How can I fix ImportError cannot import name ComposeResult from textual.app ?
2718

2819
You likely have an older version of Textual. You can install the latest version by adding the `-U` switch which will force pip to upgrade.
@@ -33,7 +24,6 @@ The following should do it:
3324
pip install textual-dev -U
3425
```
3526

36-
<a name="how-can-i-select-and-copy-text-in-a-textual-app"></a>
3727
## How can I select and copy text in a Textual app?
3828

3929
Running a Textual app puts your terminal in to *application mode* which disables clicking and dragging to select text.
@@ -46,7 +36,6 @@ may expect from the command line. The exact modifier key depends on the terminal
4636

4737
Refer to the documentation for your terminal emulator, if it is not listed above.
4838

49-
<a name="how-can-i-set-a-translucent-app-background"></a>
5039
## How can I set a translucent app background?
5140

5241
Some terminal emulators have a translucent background feature which allows the desktop underneath to be partially visible.
@@ -56,7 +45,6 @@ Textual uses 16.7 million colors where available which enables consistent colors
5645

5746
For more information on ANSI colors in Textual, see [Why no Ansi Themes?](#why-doesnt-textual-support-ansi-themes).
5847

59-
<a name="how-do-i-center-a-widget-in-a-screen"></a>
6048
## How do I center a widget in a screen?
6149

6250
To center a widget within a container use
@@ -146,7 +134,6 @@ if __name__ == "__main__":
146134
ButtonApp().run()
147135
```
148136

149-
<a name="how-do-i-fix-workerdeclarationerror"></a>
150137
## How do I fix WorkerDeclarationError?
151138

152139
Textual version 0.31.0 requires that you set `thread=True` on the `@work` decorator if you want to run a threaded worker.
@@ -169,7 +156,6 @@ async def run_in_background():
169156

170157
This change was made because it was too easy to accidentally create a threaded worker, which may produce unexpected results.
171158

172-
<a name="how-do-i-pass-arguments-to-an-app"></a>
173159
## How do I pass arguments to an app?
174160

175161
When creating your `App` class, override `__init__` as you would when
@@ -203,7 +189,6 @@ Greetings(to_greet="davep").run()
203189
Greetings("Well hello", "there").run()
204190
```
205191

206-
<a name="no-widget-called-textlog"></a>
207192
## No widget called TextLog
208193

209194
The `TextLog` widget was renamed to `RichLog` in Textual 0.32.0.
@@ -216,7 +201,6 @@ Here's how you should import RichLog:
216201
from textual.widgets import RichLog
217202
```
218203

219-
<a name="why-do-some-key-combinations-never-make-it-to-my-app"></a>
220204
## Why do some key combinations never make it to my app?
221205

222206
Textual can only ever support key combinations that are passed on by your
@@ -246,7 +230,6 @@ If you need to test what [key
246230
combinations](https://textual.textualize.io/guide/input/#keyboard-input)
247231
work in different environments you can try them out with `textual keys`.
248232

249-
<a name="why-doesn't-textual-look-good-on-macos"></a>
250233
## Why doesn't Textual look good on macOS?
251234

252235
You may find that the default macOS Terminal.app doesn't render Textual apps (and likely other TUIs) very well, particuarily when it comes to box characters.
@@ -282,7 +265,6 @@ We recommend any of the following terminals:
282265

283266
<img width="1002" alt="Screenshot 2023-06-19 at 11 00 25" src="https://github.com/Textualize/textual/assets/554369/9a8cde57-5121-49a7-a2e0-5f6fc871b7a6">
284267

285-
<a name="why-doesn't-textual-support-ansi-themes"></a>
286268
## Why doesn't Textual support ANSI themes?
287269

288270
Textual will not generate escape sequences for the 16 themeable *ANSI* colors.
@@ -296,7 +278,6 @@ Textual has a design system which guarantees apps will be readable on all platfo
296278

297279
There is currently a light and dark version of the design system, but more are planned. It will also be possible for users to customize the source colors on a per-app or per-system basis. This means that in the future you will be able to modify the core colors to blend in with your chosen terminal theme.
298280

299-
<a name="why-doesn't-the-`datatable`-scroll-programmatically"></a>
300281
## Why doesn't the `DataTable` scroll programmatically?
301282

302283
If scrolling in your `DataTable` is _apparently_ broken, it may be because your `DataTable` is using the default value of `height: auto`.

faq.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# FAQtory settings
22

3-
faq_url: "https://github.com/textualize/textual/blob/main/FAQ.md" # Replace this with the URL to your FAQ.md!
3+
faq_url: "https://textual.textualize.io/FAQ/" # Replace this with the URL to your FAQ.md!
44

55
questions_path: "./questions" # Where questions should be stored
6-
output_path: "./FAQ.md" # Where FAQ.md should be generated
6+
output_path: "./docs/FAQ.md" # Where FAQ.md should be generated
77
templates_path: ".faq" # Path to templates

mkdocs-nav.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ nav:
200200
- "how-to/index.md"
201201
- "how-to/center-things.md"
202202
- "how-to/design-a-layout.md"
203+
- "FAQ.md"
203204
- "roadmap.md"
204205
- "Blog":
205206
- blog/index.md

0 commit comments

Comments
 (0)