From f9922ebe29fb79bf8838e35f084756987ebb6247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gir=C3=A3o=20Serr=C3=A3o?= <5621605+rodrigogiraoserrao@users.noreply.github.com> Date: Wed, 22 Mar 2023 23:00:13 +0000 Subject: [PATCH 1/2] Improve subsection titles. Related issues: #2108 Related PRs: #2110, #2064 --- .../border_sub_title_align_all_example.md | 58 +++++++++---------- docs/styles/border_subtitle_align.md | 2 +- docs/styles/border_title_align.md | 2 +- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/snippets/border_sub_title_align_all_example.md b/docs/snippets/border_sub_title_align_all_example.md index b46502f2f..22049c434 100644 --- a/docs/snippets/border_sub_title_align_all_example.md +++ b/docs/snippets/border_sub_title_align_all_example.md @@ -1,38 +1,38 @@ This example shows all border title and subtitle alignments, together with some examples of how (sub)titles can have custom markup. - Open the code tabs to see the details of the code examples. +Open the code tabs to see the details of the code examples. - === "Output" +=== "Output" - ```{.textual path="docs/examples/styles/border_sub_title_align_all.py"} - ``` + ```{.textual path="docs/examples/styles/border_sub_title_align_all.py"} + ``` - === "border_sub_title_align_all.py" +=== "border_sub_title_align_all.py" - ```py hl_lines="6 18 24 30 39 40 42 45 51 57 63" - --8<-- "docs/examples/styles/border_sub_title_align_all.py" - ``` + ```py hl_lines="6 18 24 30 39 40 42 45 51 57 63" + --8<-- "docs/examples/styles/border_sub_title_align_all.py" + ``` - 1. Border (sub)titles can contain nested markup. - 2. Long (sub)titles get truncated and occupy as much space as possible. - 3. (Sub)titles can be stylised with Rich markup. - 4. An empty (sub)title isn't displayed. - 5. The markup can even contain Rich links. - 6. If the widget does not have a border, the title and subtitle are not shown. - 7. When the side borders are not set, the (sub)title will align with the edge of the widget. - 8. The title and subtitle are aligned on the left and very long, so they get truncated and we can still see the rightmost character of the border edge. - 9. The title and subtitle are centered and very long, so they get truncated and are centered with one character of padding on each side. - 10. The title and subtitle are aligned on the right and very long, so they get truncated and we can still see the leftmost character of the border edge. - 11. An auxiliary function to create labels with border title and subtitle. + 1. Border (sub)titles can contain nested markup. + 2. Long (sub)titles get truncated and occupy as much space as possible. + 3. (Sub)titles can be stylised with Rich markup. + 4. An empty (sub)title isn't displayed. + 5. The markup can even contain Rich links. + 6. If the widget does not have a border, the title and subtitle are not shown. + 7. When the side borders are not set, the (sub)title will align with the edge of the widget. + 8. The title and subtitle are aligned on the left and very long, so they get truncated and we can still see the rightmost character of the border edge. + 9. The title and subtitle are centered and very long, so they get truncated and are centered with one character of padding on each side. + 10. The title and subtitle are aligned on the right and very long, so they get truncated and we can still see the leftmost character of the border edge. + 11. An auxiliary function to create labels with border title and subtitle. - === "border_sub_title_align_all.css" +=== "border_sub_title_align_all.css" - ```sass hl_lines="12 16 30 34 41 46" - --8<-- "docs/examples/styles/border_sub_title_align_all.css" - ``` + ```sass hl_lines="12 16 30 34 41 46" + --8<-- "docs/examples/styles/border_sub_title_align_all.css" + ``` - 1. The default alignment for the title is `left` and the default alignment for the subtitle is `right`. - 2. Specifying an alignment when the (sub)title is too long has no effect. (Although, it will have an effect if the (sub)title is shortened or if the widget is widened.) - 3. Setting the alignment does not affect empty (sub)titles. - 4. If the border is not set, or set to `none`/`hidden`, the (sub)title is not shown. - 5. If the (sub)title alignment is on a side which does not have a border edge, the (sub)title will be flush to that side. - 6. Naturally, (sub)title positioning is affected by padding. + 1. The default alignment for the title is `left` and the default alignment for the subtitle is `right`. + 2. Specifying an alignment when the (sub)title is too long has no effect. (Although, it will have an effect if the (sub)title is shortened or if the widget is widened.) + 3. Setting the alignment does not affect empty (sub)titles. + 4. If the border is not set, or set to `none`/`hidden`, the (sub)title is not shown. + 5. If the (sub)title alignment is on a side which does not have a border edge, the (sub)title will be flush to that side. + 6. Naturally, (sub)title positioning is affected by padding. diff --git a/docs/styles/border_subtitle_align.md b/docs/styles/border_subtitle_align.md index 73108892d..d19d95fc1 100644 --- a/docs/styles/border_subtitle_align.md +++ b/docs/styles/border_subtitle_align.md @@ -40,7 +40,7 @@ This example shows three labels, each with a different border subtitle alignment ``` -### All title and subtitle combinations +### Complete usage reference --8<-- "docs/snippets/border_sub_title_align_all_example.md" diff --git a/docs/styles/border_title_align.md b/docs/styles/border_title_align.md index 01b55bad8..a2a909890 100644 --- a/docs/styles/border_title_align.md +++ b/docs/styles/border_title_align.md @@ -40,7 +40,7 @@ This example shows three labels, each with a different border title alignment: ``` -### All title and subtitle combinations +### Complete usage reference --8<-- "docs/snippets/border_sub_title_align_all_example.md" From e15805b93bbd2a4b2e321b0c0accba23bf198b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gir=C3=A3o=20Serr=C3=A3o?= <5621605+rodrigogiraoserrao@users.noreply.github.com> Date: Thu, 23 Mar 2023 09:38:50 +0000 Subject: [PATCH 2/2] Fix #1540. (#2097) --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 4b4000e7b..bd731999d 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,11 @@ docs-serve: clean-screenshot-cache docs-online-nav $(run) mkdocs serve --config-file mkdocs-nav-online.yml rm -f mkdocs-nav-online.yml +.PHONY: docs-serve-offline +docs-serve-offline: clean-screenshot-cache docs-offline-nav + $(run) mkdocs serve --config-file mkdocs-nav-offline.yml + rm -f mkdocs-nav-offline.yml + .PHONY: docs-build docs-build: docs-online-nav $(run) mkdocs build --config-file mkdocs-nav-online.yml