91 Commits

Author SHA1 Message Date
Will McGugan
88220b8f02 docs 2025-10-05 11:57:18 +01:00
Will McGugan
ac2d2a6796 empty class 2025-07-29 14:44:06 +01:00
Will McGugan
4659ee9394 add api docs 2025-07-16 17:58:56 +01:00
Will McGugan
e452077d3e added textual.getters 2025-07-06 19:47:55 +01:00
Will McGugan
ae1174019c update nav 2025-06-25 20:45:38 +01:00
Will McGugan
ead2b31bc1 added escaping to docs 2025-04-15 16:02:44 +01:00
Will McGugan
df77f680cb docs update 2025-02-07 13:49:38 +00:00
Will McGugan
3716641824 snapshots 2025-02-06 16:57:27 +00:00
Will McGugan
bda56ab531 words 2025-02-06 16:39:45 +00:00
Will McGugan
7d228fd228 content docs 2025-02-02 19:37:36 +00:00
Will McGugan
f0cfabb4d4 css styles 2025-01-27 18:58:24 +00:00
Will McGugan
a0910ceb30 wrap and overflow docs 2025-01-27 12:18:59 +00:00
Will McGugan
ed4b11ef2a documented position absolute 2024-11-23 20:02:22 +00:00
Will McGugan
bd041b24b4 merge 2024-10-17 12:05:24 +01:00
Will McGugan
4a822bc53e background tint style (#5117)
* background tint style

* changelog

* hlines

* doc fix

* added tint

* missing snapshots
2024-10-14 14:50:19 +01:00
Will McGugan
6298acb2a2 link widget 2024-10-13 18:44:33 +01:00
Will McGugan
584dd0c7ad Merge branch 'main' into masked_input 2024-08-27 12:32:14 +01:00
Will McGugan
142ca7485c Remove classic footer 2024-08-22 13:29:50 +01:00
Angelo Mottola
e437bf5bbe Introduced MaskedInput widget 2024-07-22 00:38:41 +02:00
Will McGugan
f242d477b9 add api 2024-07-17 21:35:02 +01:00
Will McGugan
54cec67bd8 titles 2024-07-17 17:16:40 +01:00
Will McGugan
b38b170d99 hatch docs 2024-06-05 15:11:14 +01:00
Will McGugan
86c11a0b4d docs 2024-05-22 12:03:18 +01:00
Will McGugan
cc19158a9a inline docs 2024-03-30 13:21:29 +00:00
Dave Pearson
2299fdfc9c Add the Unmount event to the docs 2024-03-26 08:55:08 +00:00
Dave Pearson
a47be5a347 Add AppFocus and AppBlur to the events
Now that they're supported by more than just textual-web it makes sense to
expose them a little better in the docs.
2024-03-18 11:50:50 +00:00
Dave Pearson
2b1088b2ac Sort the index of events 2024-03-18 11:22:57 +00:00
Dave Pearson
1f03c0724a Add the Print event to the list of events in the reference 2024-03-18 11:22:19 +00:00
Rodrigo Girão Serrão
bdaf164ffd Fix docs order. 2024-02-29 11:35:12 +00:00
Rodrigo Girão Serrão
d1d6fe28a3 Add support for 'TEXTUAL_ANIMATIONS'. 2024-01-23 13:48:19 +00:00
Will McGugan
0ad03f3731 Packaging how to (#4031)
* how-to

* how-to

* tweaks

* fix nav

* tweak

* example repository

* fix word

* Apply suggestions from code review

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* definition

* words

* elaborate

* Update docs/how-to/package-with-hatch.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* clarification

* Update docs/how-to/package-with-hatch.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Words

* added info

* words

* Update docs/how-to/package-with-hatch.md

Co-authored-by: Darren Burns <darrenburns@users.noreply.github.com>

* words

* ws

* capitalize

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
Co-authored-by: Darren Burns <darrenburns@users.noreply.github.com>
2024-01-17 13:05:26 +00:00
Will McGugan
dbcecda90d remove how-to (#4020)
* remove how-to

* remove index
2024-01-15 14:33:46 +00:00
Dave Pearson
0bea8b250c HOWTO package a Textual application (#3977)
* Initial draft of the howto for packaging an application

There's a fair bit more I think needs adding, but this has the core concepts
within it. Things still to decide or do are:

- How much lead-in and hand-holding is needed for Hatch and Poetry

For example, should we walk the reader through the `init` process for Hatch
and Poetry, and then guide them to the correct directory in which to create
their application, etc?

- How to do the example repo

Should I do two repos, one for Hatch and one for Poetry? Or should I do one
repo with a Hatch and a Poetry example within sub-directories? In either
case having a tidy one-to-one relationship with what I talk about in the
text won't be quite right.

Mainly though I feel the core of what's needed is here (and it's not much,
but has taken some testing and checking and whittling down to get here).

* Title tweak

* Add a note about declaring Textual as a dependency

While this might seem obvious, and while some tools will, as a natural
consequence of using them, ensure that this happens, it's worth highlighting
this so that the reader is mindful of this.

Also, someone might be reading the HOWTO while considering how they to this
with their own build system.

* Break paragraphs down into different lines

Just an internal layout thing. Some folk seem to like this sort of thing.

* Add a summary

* Some rewording

* Link to the example repos

* Post-initial-proof-read

* Link to pip and pipx

* Don't repeat help in the same sentence

* Remove an actual needless word

* Remove the dual use of application in a sentence

* Link to TCSS files in case the reader needs a refresh

* Explain what the example repositories were built for/with

It should be obvious from the names; but it can't hurt to be *very* clear.

* Update docs/how-to/package-an-application.md

Co-authored-by: Will McGugan <willmcgugan@gmail.com>

* Changes in response to feedback

* Trim down the into a wee bit

* Trim down the into a wee bit more

---------

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2024-01-15 10:15:10 +00:00
Will McGugan
b61b878fda Make cache public (#3976)
* pulic cache

* changelog

* Apply suggestions from code review

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2024-01-08 13:19:33 +00:00
Will McGugan
b8fccd494a lazy mount (#3936)
* lazy mount

* Lazy test

* doc

* Add to docs

* snapshot and changelog

* typing

* future

* less flaky

* comment
2024-01-01 15:54:55 +00:00
Will McGugan
bfbc6fb285 added howto (#3854)
* added howto

* don't need this

* don't need this

* move title

* docstring
2023-12-12 14:39:27 +00:00
Will McGugan
a2a6f56cec docs fix (#3841) 2023-12-09 12:12:46 +00:00
Rodrigo Girão Serrão
d993cce505 Rename link-hover-* rules to link-*-hover. (#3736)
Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2023-11-29 14:09:58 +00:00
Rodrigo Girão Serrão
fe0892e0cf Merge pull request #3751 from Textualize/documentation-fixes
Documentation fixes.
2023-11-27 16:53:35 +00:00
Will McGugan
370f5f7214 Keyline rule (#3669)
* canvas

* imports

* more box drawing

* lines

* lines

* box drawing table

* fix box table

* tweak test

* canvas color

* simplify canvas

* optimization

* clipping

* render experiment

* keyline css

* tests

* don't draw around invisible widgets

* optimize

* snapshot test

* docs and examples

* tab size

* disclaimer

* docs

* changelog

* snapshots

* accidental add

* rename for consistency

* simplify color

* docstrings

* comment

* snapshots

* micro optimize

* micro-optimization

* typing

* set over list

* remove comment

* docstring

* punctuation

* Update docs/styles/keyline.md

Co-authored-by: Darren Burns <darrenburns@users.noreply.github.com>

---------

Co-authored-by: Darren Burns <darrenburns@users.noreply.github.com>
2023-11-27 11:54:53 +00:00
Rodrigo Girão Serrão
c19d54de67 Documentation fixes. 2023-11-27 10:31:33 +00:00
Rodrigo Girão Serrão
b902b1cae6 Improve documentation. 2023-11-22 15:51:19 +00:00
Darren Burns
bbde62fc57 Text area (#2931)
* Add docstring and switch to tree-sitter-languages wheels - although the wheels arent working

* Adding highlights files

* Fix index error on SyntaxAwareDocument

* Narrowing highlighting scope

* Adding basic highlights for Markdown

* Using utf-8 byte length instead of codepoint count in syntax aware doc

* Start creating an ABC defining functionality required by Document impls

* Simplify tree-sitter logic

* Extracting more ABC

* Fix width calculation, add SyntaxTheme

* Ensure the highlight line style goes right to the very end

* Updating a docstring

* Renaming, and adding document width guide

* Ensuring that line number column toggling refreshes virtual size

* Ensuring that line number column toggling refreshes virtual size

* Width guide

* Fix focus event stopping

* Use release_mouse

* Improving a docstring

* Remove bash

* TextArea language snapshot testing

* Updating snapshots for TextArea since we now highlight more nodes

* Typing fixes

* Testing

* Adding tests

* Fixing language selection

* Refresh size on indent width change

* Testing, renaming, fixing display of selection

* Fix multibyte highlight glitch

* Fix deleting right with selection at end of document in TextArea

* Fixing utf-8 multibyte character issues

* Default location of text insertion is cursor position, add cursor_location properties

* Removing some debugging code

* Cursor location tests

* Updating snapshots

* Cached utf8 encoding

* TextArea selection snapshot testing

* Tidying docstrings and queries

* Updating selection snapshot output

* Binding for ESC to shift focus

* Only build the tree-sitter query once!

* Expand cursor scroll horizontal leeway in TextArea

* Property setter for cursor_location in TextArea shouldnt return value

* Avoiding NamedTuple subclassing - using type aliasing instead

* Tidying API, docstrings etc.

* Tidying the API and docstrings

* TextArea additional cursor tests

* Testing pageup and pagedown in TextArea

* Fix a faulty test

* Docstring in a test for TextArea edit

* Stop using DEFAULT_SYNTAX_THEME

* Docstrings

* Change cursor_destination to move_cursor, add more tests

* Remove faulty assertion

* Tidying cursor movement

* Tidying up, adding docstrings for component classes

* Fix a broken selection test

* Remove some unused highlighting machinery

* Fix some Python highlighting issues

* Make HTML syntax highlight nicely

* Create tag name for mismatching HTML end tag

* Add styling for YAML, update boolean styling

* Stylising toml types

* Styling floats

* JSON syntax highlighting

* Updating snapshots

* Syntax highlighting datetimes in TOML

* Namespace TOML errors in highlighting

* Add a move_cursor_relative method

* Update TOML TextArea snapshot for datetime highlighting support

* Adjusting selections

* At TextArea widget level, delete_range is insert_range of empty string

* Refactoring

* Dunder all, docstring fix

* Fix XFAIL

* Remove unused import

* More tests, tidying up

* Cleaning the API

* Docstrings for TextArea

* A bunch of docstrings, delete unused code

* More tidying and docstrings

* Cursor origin on document load, correctly handle delete word left/right when selection is non-empty, fix delete_line when selection spans multiple lines and is in reverse direction

* Moving things around

* Fixing dunder all to export DocumentBase

* Add docstring

* Record cursor width on programmatic insert since it can result in the cursor moving

* Typing fixes

* Fixing remaining typing issues with TextArea

* Add tree-sitter-languages stubs and fix typing issues in documents

* Fixing remaining typing issues with document

* Updating Syntax themes

* Improve highlighting, add initial TextArea docs page

* Add TextArea indent note

* Start TextArea guide inside reference

* Add TextArea to widget gallery

* Fleshing out TextArea docs

* Add note

* Fix TextArea programmatic insert/cursor interaction

* Improve a test

* Testing replacement within selection

* Testing double-width character keyboard navigation and deletion keybinds with active selections

* Testing "delete to start of line" TextArea binding

* Testing TextArea delete line methods and delete to end of line

* Testing shift selecting using keyboard in vertical direction

* Expand tests for home and end keybinds in TextArea

* Renaming tests, testing empty replace and insert

* Testing delete word left via API

* Testing delete word left via API

* Testing delete_word_left with tabs, and delete_word_right

* Remove unused variables

* Remove debugging width guide

* Fix snapshot report path

* Deleting word left/right interaction with line ends fixes, ensure cursor width recorded on all edits

* Docstring fixes

* Unpin textual snapshot library dependency (issue is fixed)

* Docstring fixes

* Fix recording cursor width

* Fix a docstring

* Add select_all to TextArea

* Remove unused tree-sitter stuff from .gitignore

* Line select

* Make word pattern private in TextArea

* Add blinking cursor to TextArea

* Renaming, adding missing return typing

* Add selection bindings

* Moving cursor left/right by word while selecting

* Change escape keybind description, TextArea

* Stripping whitespace when going word left/right

* Add missing annotation

* Cursor word right and left parity with PyCharm

* Use repaint=False for cursor blink

* Improve focus/blur styling

* A whole bunch of TextArea testing

* Simplify delete_left and delete_right

* Testing hiding line numbers in snapshot

* Adding snapshot test for unfocus styling

* Create initial snapshot for text-area unfocused

* Support shift+home, shift+end

* Document shift+home, shift+end

* Add Dracula syntax highlighting theme

* Small change to delete_line behaviour when multiple lines selected to match vscode/pycharm behaviour

* Add test for new delete line logic

* Delete line improvement

* Add extra test for delete_line multiple selection

* Test cursor "smart" home behaviour

* Fix typo

* Highlight matching brackets

* Update snapshot

* Update snapshot

* Fix xfails

* Simplify delete_word_left

* Catch correct exception to ensure support for Python 3.7

* Add styling for Markdown

* Add styles for Dracula for Markdown

* Remove unused _fix_direction.py

* Add docstring to EditResult

* Use default=0 in max inside Document

* Remove redundant actions

* Use cell-width aware expand tabs implementation from @willmcgugan

* Construct strip with cell length

* Some TextArea keyword-only arguments

* Begin moving over to TextAreaTheme #skipci

* Prepare queries inside document #skip-ci

* Add comment

* Refactoring

* TextAreaTheme styling

* Setting width of blank selected lines

* Building the highlight map in the text area

* Remove unused default css from TextArea

* Moving highlighting stylize into widget

* Moving syntax highlighting into TextArea widget

* Remove unused code

* Optimise imports

* Fix highlighting when initial text supplied to TextArea

* Rebuild highlight map when the theme changes

* Extending

* Restore themes

* Remove old comment, fix docstring

* Fixing docstrings

* Fixing mypy

* Fixing mypy issues in document

* Tidying things

* Updating version

* Add theme

* Fix VSCode theme bracket matching

* Only match brackets when theres no selection

* Highlighting tidying

* Fix markdown header highlighting

* Setting theme correctly in background

* Tidying module interface

* Merging main

* Fixing a bunch of typing problems

* Fixing more typing problems

* Correctly setting theme object

* mypy

* Small fix to bracket matching

* Improve a docstring

* Fix docstring

* Testing builtin and custom languages

* Unit testing theme stuff

* Reworking themes

* Error handling

* Improve error message

* Testing new theme setting approach, error handling

* Improvements/tests for theme and language setting

* Remove unused TextArea unfocus snapshot

* Update snapshot file

* Adding theme snapshot tests

* Add `function.call` style binding in dark vscode theme

* Renaming a test file

* Making active line clearer on vscode theme

* Renaming tests

* A whole lot of docs for TextArea

* Update wording in docs

* A bit more docs

* Example on adding Java as a custom language

* More custom language docs

* Finishing up custom themeing/syntax highlighting guide for TextArea

* Add note on potential issue

* Fix wording

* Add note on Apple Silicon Python 3.7 fallback

* Add another note on Apple Silicon Python 3.7 fallback

* Fix class names in example files

* Add some documentation for useful TextArea APIs

* TextArea docs improvements

* TextArea docs typo fix

* Note about extending TextArea

* Tab-stop support when spaces used for indent

* Docs update

* Text area blog post (#3356)

* Start blog post

* Add demo script to blog post

* Continuing the blog post

* Yet more writing for TextArea blog post

* Working on closing section

* Finishing up

* Update docs/blog/posts/text-area-learnings.md

Co-authored-by: Dave Pearson <davep@davep.org>

* Update docs/blog/posts/text-area-learnings.md

Co-authored-by: Dave Pearson <davep@davep.org>

* Typo fix

* Update docs/blog/posts/text-area-learnings.md

Co-authored-by: Dave Pearson <davep@davep.org>

---------

Co-authored-by: Dave Pearson <davep@davep.org>

* Remove redundant pass

* Add docstring

* Docs fix

* Simplify docs

* Improve docstring

* Add links in docstrings

---------

Co-authored-by: Dave Pearson <davep@davep.org>
2023-09-21 11:10:14 +01:00
Will McGugan
f187a420ef welcome tweak 2023-09-19 12:46:43 +01:00
Will McGugan
b99da2d6b9 Testing guide (#3329)
* testing docs

* words

* words

* testing doc

* Apply suggestions from code review

Co-authored-by: Gobion <1312216+brokenshield@users.noreply.github.com>

---------

Co-authored-by: Gobion <1312216+brokenshield@users.noreply.github.com>
2023-09-17 10:34:32 +01:00
Will McGugan
1db9ecb302 Update Collapsible (#3305)
* Update Collapsible

* snapshot tests

* word

* Update docs/widgets/collapsible.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Update docs/widgets/collapsible.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* simplify render

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-09-14 16:26:41 +01:00
Will McGugan
5d6a95dec5 Command Palette tweaks and docs (#3289)
* renames to command palette and docs

* docs

* simplifyt

* note

* docstring

* Update src/textual/command.py

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Update docs/examples/guide/command_palette/command01.py

Co-authored-by: Dave Pearson <davep@davep.org>

* populate text

* screen commands

* Update docs/guide/command_palette.md

Co-authored-by: Dave Pearson <davep@davep.org>

* Update docs/guide/command_palette.md

Co-authored-by: Dave Pearson <davep@davep.org>

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
Co-authored-by: Dave Pearson <davep@davep.org>
2023-09-13 15:03:25 +01:00
Dave Pearson
85a3af320a Merge branch 'main' into M-x 2023-09-06 14:46:33 +01:00
TomJGooding
06b6426750 feat: add rule widget (#3209)
* feat: add rule widget

* add star to init

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* remove unnecessary validations

* update rule styles

* add tests for invalid rules

* add minimum heights and widths

* tidy up examples

* remove old example

* move examples styling to tcss

* modify examples to fit docs screenshots

* add docs first draft

* add snapshot tests

* add rule to widget gallery

* make non-widget rule classes available

* tentatively update changelog

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2023-09-04 17:57:10 +01:00
Dave Pearson
64354a35fd Merge branch 'main' into M-x 2023-08-22 08:29:50 +01:00