Skip to content

Commit 04820b9

Browse files
authored
v0.7.0 (#44)
1 parent 919784d commit 04820b9

38 files changed

+488
-113
lines changed

.github/workflows/quartodoc.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
tags:
77
- 'v[0-9]+.[0-9]+.[0-9]+' # build on version tags
88
- '!v[0-9]+.[0-9]+.[0-9]+.[0-9]+' # but not if version involves a dev component
9+
- '!v[0-9]+.[0-9]+.[0-9]+.dev' # or a .dev suffix
910
branches:
1011
- main
1112

@@ -60,6 +61,8 @@ jobs:
6061
env_file = os.getenv("GITHUB_ENV")
6162
with open(env_file, "a") as github_env:
6263
github_env.write(f"DOCS_SUBDIR={subdir}")
64+
if is_dev:
65+
github_env.write(f"\nDOCS_PROFILE=dev")
6366
6467
# If event is a tag, set subdir to '<tag_name>'
6568
- name: "[tag] Set versioned DOCS_SUBDIR"
@@ -80,7 +83,7 @@ jobs:
8083
git config --local user.name "$GITHUB_ACTOR"
8184
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
8285
git add -A
83-
git commit -m "Build docs from ${GITHUB_REF}"
86+
git commit -m "Build docs from ${GITHUB_REF}" || exit 0
8487
8588
# Rebase to include any changes pushed while building docs
8689
git pull --rebase origin gh-pages

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ All notable changes to `shinyswatch` will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased] - YYYY-MM-DD
8+
## [0.7.0] - 2024-07-18
99

1010
### Breaking changes
1111

12-
* shinyswatch now uses the newly-introduced `shiny.ui.Theme()` class to define themes. As a result, `shinyswatch.theme.{name}` objects can no longer be added anywhere in the app's UI. Instead, pass a shinyswatch theme to the `theme` argument of any `shiny.ui.page_*()` functions (Shiny Core) or to `shiny.express.ui.page_opts()` (Shiny Express). (#39)
12+
* shinyswatch now requires shiny v1.0.0 or newer to use the newly-introduced `shiny.ui.Theme()` class to define themes. As a result, `shinyswatch.theme.{name}` objects can no longer be added anywhere in the app's UI. Instead, pass a shinyswatch theme to the `theme` argument of any `shiny.ui.page_*()` functions (Shiny Core) or to `shiny.express.ui.page_opts()` (Shiny Express). (#39)
1313

1414
* The `default` argument of `theme_picker_ui()` is now deprecated. Instead, pass the initial theme to the `theme` argument of any `shiny.ui.page_*()` functions (Shiny Core) or to `shiny.express.ui.page_opts()` (Shiny Express). This change separates the initial theme selection from the placement of the theme picker input. (#39)
1515

16-
* `shinyswatch.get_theme_deps()` was removed from the pacakge. If needed, use the `._html_dependency()` method of the theme object. (#39)
16+
* `shinyswatch.get_theme_deps()` was removed from the package. If needed, use the `._html_dependency()` method of the theme object. (#39)
1717

1818
### New features
1919

Makefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,28 @@ coverage: ## check code coverage quickly with the default Python
6767
# sites for the same repository, in particular to put the dev docs at `dev/`.
6868
DOCS_SUBDIR:=
6969
DOCS_OUTPUT_DIR:="_site/$(DOCS_SUBDIR)"
70+
DOCS_PROFILE:=
71+
72+
SHINYSWATCH_VERSION := $(shell python3 -c "import shinyswatch; print(shinyswatch.__version__)")
7073

7174
quarto-shinylive: ## Make sure quarto-shinylive is installed
7275
cd docs && (test -f _extensions/quarto-ext/shinylive/shinylive.lua || quarto install extension --no-prompt quarto-ext/shinylive)
7376
quarto-interlinks: ## Make sure quartodocs's interlinks is installed
7477
cd docs && (test -f _extensions/machow/interlinks/interlinks.lua || quarto install extension --no-prompt machow/quartodoc)
75-
docs-quartodoc: quarto-shinylive quarto-interlinks ## Build quartodoc
78+
quarto-line-highlight:
79+
cd docs && (test -f _extensions/shafayetShafee/line-highlight/_extension.yml || quarto install extension --no-prompt shafayetShafee/line-highlight)
80+
docs-quartodoc: quarto-shinylive quarto-interlinks quarto-line-highlight ## Build quartodoc
7681
cd docs && python -m quartodoc build --verbose
7782
cd docs && python -m quartodoc interlinks
7883
docs-render: quarto-shinylive
79-
cd docs && quarto render
84+
export SHINYSWATCH_VERSION=$(SHINYSWATCH_VERSION) && \
85+
cd docs && quarto render --profile ${DOCS_PROFILE}
8086
docs-render-ci: quarto-shinylive
81-
cd docs && quarto render --no-clean --output-dir $(DOCS_OUTPUT_DIR)
87+
export SHINYSWATCH_VERSION=$(SHINYSWATCH_VERSION) && \
88+
cd docs && quarto render --no-clean --output-dir $(DOCS_OUTPUT_DIR) --profile ${DOCS_PROFILE}
8289
docs-watch: quarto-shinylive
83-
cd docs && quarto preview
90+
export SHINYSWATCH_VERSION=$(SHINYSWATCH_VERSION) && \
91+
cd docs && quarto preview --profile ${DOCS_PROFILE}
8492
docs-ci: docs-quartodoc docs-render-ci ## Build quartodoc for CI
8593
docs-readme: README.md ## Build README.md from index.qmd
8694
quarto render docs/index.qmd --output README.md --output-dir . --profile readme

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
/_sidebar.yml
88
/site_libs/
99
/index.html
10+
/changelog.md

docs/_quarto-dev.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
website:
2+
announcement:
3+
dismissable: false
4+
content: |
5+
This is the development version of shinyswatch. [Go to the stable version](https://posit-dev.github.io/py-shinyswatch).

docs/_quarto.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ project:
22
type: website
33
resources:
44
- objects.json
5+
pre-render:
6+
- cp ../CHANGELOG.md changelog.md
57

68
metadata-files:
79
- _sidebar.yml
@@ -68,12 +70,31 @@ quartodoc:
6870

6971
website:
7072
title: shinyswatch
73+
site-url: https://posit-dev.github.io/py-shinyswatch
74+
repo-url: https://github.com/posit-dev/py-shinyswatch
7175
navbar:
76+
foreground: white
77+
background: primary
7278
left:
73-
# - href: https://machow.github.io/quartodoc/
74-
# text: quartodoc home
79+
- href: index.qmd
80+
text: Get Started
7581
- file: reference/index.qmd
7682
text: "Reference"
77-
right:
83+
- text: "News"
84+
menu:
85+
- text: v0.7.0
86+
href: https://shiny.posit.co/blog/posts/shinyswatch-0.7.0/
87+
- text: "---"
88+
- text: "Changelog"
89+
href: changelog.md
90+
tools:
7891
- icon: github
79-
href: https://github.com/rstudio/py-shinyswatch
92+
href: https://github.com/posit-dev/py-shinyswatch
93+
page-footer:
94+
center: |
95+
shinyswatch v{{< env SHINYSWATCH_VERSION >}}
96+
97+
format:
98+
html:
99+
theme: shiny.scss
100+

docs/index.qmd

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,12 @@ Example Shiny application:
8282
:::
8383

8484
::: {.content-visible when-format="html"}
85+
::: column-page-inset
8586
```{shinylive-python}
8687
#| standalone: true
8788
#| components: [editor, viewer]
8889
#| layout: horizontal
89-
#| viewerHeight: 800
90+
#| viewerHeight: 400
9091
## file: app.py
9192
{{< include "examples/darkly/app.py" >}}
9293
@@ -96,6 +97,7 @@ Example Shiny application:
9697
9798
```
9899
:::
100+
:::
99101

100102
> Note: When writing [shiny apps that use shinyswatch on shinylive.io](`{python} shinylive_example_url("darkly")`), remember to add `shinyswatch` to your `requirements.txt` file!
101103
@@ -109,11 +111,12 @@ To add a theme picker to your app, add the theme picker UI and server functions
109111
:::
110112

111113
::: {.content-visible when-format="html"}
114+
::: column-page-inset
112115
```{shinylive-python}
113116
#| standalone: true
114117
#| components: [editor, viewer]
115118
#| layout: horizontal
116-
#| viewerHeight: 800
119+
#| viewerHeight: 400
117120
## file: app.py
118121
{{< include "examples/theme-picker/app.py" >}}
119122
@@ -123,6 +126,7 @@ To add a theme picker to your app, add the theme picker UI and server functions
123126
124127
```
125128
:::
129+
:::
126130

127131
## Plot Theming
128132

@@ -134,11 +138,12 @@ In the example below, try changing the theme and re-running the app to see how t
134138
:::
135139

136140
::: {.content-visible when-format="html"}
141+
::: column-page-inset
137142
```{shinylive-python}
138143
#| standalone: true
139144
#| components: [editor, viewer]
140145
#| layout: horizontal
141-
#| viewerHeight: 800
146+
#| viewerHeight: 550
142147
## file: app.py
143148
{{< include "examples/plot-theming/app.py" >}}
144149
@@ -148,6 +153,7 @@ In the example below, try changing the theme and re-running the app to see how t
148153
149154
```
150155
:::
156+
:::
151157

152158
::: {.content-visible when-format="markdown"}
153159
## Development

0 commit comments

Comments
 (0)