diff --git a/docs/custom_theme/main.html b/docs/custom_theme/main.html index fbbfd659ab..b87addcdd5 100644 --- a/docs/custom_theme/main.html +++ b/docs/custom_theme/main.html @@ -30,4 +30,23 @@ + + {% endblock %} diff --git a/docs/guide/widgets.md b/docs/guide/widgets.md index f568f09b2a..d699546063 100644 --- a/docs/guide/widgets.md +++ b/docs/guide/widgets.md @@ -535,6 +535,10 @@ Here's a sketch of what the app should ultimately look like: There are three types of built-in widget in the sketch, namely ([Input](../widgets/input.md), [Label](../widgets/label.md), and [Switch](../widgets/switch.md)). Rather than manage these as a single collection of widgets, we can arrange them in to logical groups with compound widgets. This will make our app easier to work with. +??? textualize "Try in Textual-web" + +
+ ### Identifying components We will divide this UI into three compound widgets: diff --git a/docs/how-to/design-a-layout.md b/docs/how-to/design-a-layout.md index b9f17c51c7..80c82c9d7e 100644 --- a/docs/how-to/design-a-layout.md +++ b/docs/how-to/design-a-layout.md @@ -27,6 +27,11 @@ Here's our sketch: It's rough, but it's all we need. +??? textualize "Try in Textual-web" + + + + ## Tip 2. Work outside in Like a sculpture with a block of marble, it is best to work from the outside towards the center. diff --git a/docs/images/icons/textualize-logo.svg b/docs/images/icons/textualize-logo.svg new file mode 100644 index 0000000000..b22765adb8 --- /dev/null +++ b/docs/images/icons/textualize-logo.svg @@ -0,0 +1,3 @@ + diff --git a/docs/index.md b/docs/index.md index 0c03a8cfd9..1c06781407 100644 --- a/docs/index.md +++ b/docs/index.md @@ -24,7 +24,7 @@ Welcome to the [Textual](https://github.com/Textualize/textual) framework docume Textual is a *Rapid Application Development* framework for Python, built by [Textualize.io](https://www.textualize.io). -Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal *or* a web browser (with [textual-web](https://github.com/Textualize/textual-web))! +Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal *or* a [web browser](https://github.com/Textualize/textual-web)! diff --git a/docs/stylesheets/custom.css b/docs/stylesheets/custom.css index ee10d06544..171dd9f8b9 100644 --- a/docs/stylesheets/custom.css +++ b/docs/stylesheets/custom.css @@ -72,3 +72,45 @@ td code { opacity: 0.85; } + +.textual-web-demo iframe { + border: none; + width: 100%; + aspect-ratio: 16 / 9; + padding: 0; + margin: 0; +} + + +.textual-web-demo { + display: flex; + width: 100%; + aspect-ratio: 16 / 9; + padding: 0; + margin: 0; + opacity: 0; + transition: 0.3s opacity; +} + +.textual-web-demo.-loaded { + opacity: 1.0; + transition: 0.3s opacity; +} + +:root { + --md-admonition-icon--textualize: url('/images/icons/textualize-logo.svg') +} +.md-typeset .admonition.textualize, +.md-typeset details.textualize { + border-color: rgb(43, 155, 70); +} +.md-typeset .textualize > .admonition-title, +.md-typeset .textualize > summary { + background-color: rgba(43, 155, 70, 0.1); +} +.md-typeset .textualize > .admonition-title::before, +.md-typeset .textualize > summary::before { + background-color: rgb(43, 155, 70); + -webkit-mask-image: var(--md-admonition-icon--textualize); + mask-image: var(--md-admonition-icon--textualize); +} diff --git a/docs/tutorial.md b/docs/tutorial.md index 6c875aa059..e9311dfe88 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -31,6 +31,18 @@ Here's what the finished app will look like: ```{.textual path="docs/examples/tutorial/stopwatch.py" title="stopwatch.py" press="tab,enter,tab,enter,tab,enter,tab,enter"} ``` +### Try it out! + +The following is *not* a screenshot, but a fully interactive Textual app running in your browser. + + +!!! textualize "Try in Textual-web" + + + +See [textual-web](https://github.com/Textualize/textual-web) if you are interested in publishing your apps on the web. + + ### Get the code If you want to try the finished Stopwatch app and follow along with the code, first make sure you have [Textual installed](getting_started.md) then check out the [Textual](https://github.com/Textualize/textual) repository: diff --git a/mkdocs-common.yml b/mkdocs-common.yml index 50c574073d..a69cfc5cf4 100644 --- a/mkdocs-common.yml +++ b/mkdocs-common.yml @@ -34,6 +34,7 @@ markdown_extensions: alternate_style: true - pymdownx.snippets - markdown.extensions.attr_list + - pymdownx.details theme: name: material