Skip to content

Reorganize Menus: Get Started and Concepts (no tutorials) #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
524ebd8
get started and concept changes from #250 4751da3b8a309c688fe6fcb2f97…
chendaniely Mar 14, 2025
034a3cc
fix / remove title case from welcome page
chendaniely Mar 14, 2025
72edae7
fix nav (rm top deploy and concepts workflow), fix run title
chendaniely Mar 14, 2025
4dea60b
tutorials don't exist in this PR
chendaniely Mar 14, 2025
b889a69
remove the docs/shinylive pages and images (moved to get-started)
chendaniely Mar 14, 2025
42ad0cf
Merge branch 'main' into get-started-concepts-only
chendaniely Mar 15, 2025
4b8b1c6
re-direct+re-name learn shiny to get started
chendaniely Mar 17, 2025
44eda8f
Merge branch 'get-started-concepts-only' of github.com:posit-dev/py-s…
chendaniely Mar 17, 2025
e2bc169
replace screenshot of template dashboard with actual dashboard
chendaniely Mar 17, 2025
ee62f64
make dashboard example 90% width, fix trailing :::: link to create an…
chendaniely Mar 18, 2025
fc9c0eb
remove *.quarto_ipynb
chendaniely Mar 18, 2025
1d87e25
add reactivity example and clean up template example
chendaniely Mar 18, 2025
a8b789d
fix link to shiny create video in get started to link to docs
chendaniely Mar 18, 2025
3c51114
add emojis to get started to match concepts
chendaniely Mar 18, 2025
fa2421c
round of edits + the component buttons aren't right
chendaniely Mar 21, 2025
a63b372
make the buttons a bit smaller (still not flowing correctly)
chendaniely Mar 21, 2025
7b8d307
match colors to top menu, leave a reference to posit blue
chendaniely Mar 21, 2025
086837d
don't use bullets with emojis, just list with the emojis
chendaniely Mar 21, 2025
6ec21e5
fix font awesome, and buttons not flowing correctly
chendaniely Mar 28, 2025
c3cbf37
fix typo
chendaniely Mar 28, 2025
f0fe875
remove copy+pasted repeted text
chendaniely Mar 28, 2025
e82cc92
write a short blurb about the shiny example
chendaniely Mar 28, 2025
9ebf49c
200px button size a bit too big. moving to 150px
chendaniely Mar 28, 2025
fa0de40
split up welcome, now with more links
chendaniely Apr 4, 2025
84cc7ba
add a point to open source
chendaniely Apr 4, 2025
0ca8b9b
fix same typo in #268
chendaniely Apr 8, 2025
b85ed76
Merge branch 'main' into get-started-concepts-only
gadenbuie Apr 14, 2025
770fb4f
chore: Use quarto v1.7.23
gadenbuie Apr 14, 2025
db43acf
feat: initial shiny app preview
gadenbuie Apr 14, 2025
5cf56e5
feat: cards design for gallery links
gadenbuie Apr 14, 2025
db8df57
chore(welcome): Tweak CTA section
gadenbuie Apr 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

env:
QUARTO_VERSION: 1.6.42
QUARTO_VERSION: 1.7.23

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@
"flake8.args": [
"--ignore=E501,E203"
],
"quarto.path": "~/.local/share/qvm/versions/v1.6.42/bin/quarto"
"quarto.path": "~/.local/share/qvm/versions/v1.7.23/bin/quarto"
}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ VENV = venv
PYBIN = $(VENV)/bin


QUARTO_VERSION ?= 1.6.42
QUARTO_VERSION ?= 1.7.23
QUARTO_PATH = ~/.local/share/qvm/versions/v${QUARTO_VERSION}/bin/quarto

.PHONY: install-quarto
Expand All @@ -23,7 +23,7 @@ install-quarto:
@echo "Error: qvm is not installed. Please visit https://github.com/dpastoor/qvm/releases/ to install it." >&2 \
exit 1; \
fi
qvm install ${QUARTO_VERSION}
qvm install v${QUARTO_VERSION}
@echo "🔹 Updating .vscode/settings.json"
@awk -v path="${QUARTO_PATH}" '/"quarto.path":/ {gsub(/"quarto.path": ".*"/, "\"quarto.path\": \"" path "\"")} 1' .vscode/settings.json > .vscode/settings.json.tmp && mv .vscode/settings.json.tmp .vscode/settings.json
@echo "🔹 Updating .github/workflows/deploy-docs.yml"
Expand Down
35 changes: 22 additions & 13 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ project:
- api/core
- api/testing
- templates
- get-started
resources:
- /pypi/**
- /robots.txt
Expand Down Expand Up @@ -73,7 +74,9 @@ website:
logo-alt: The logo for Shiny for Python
search: true
left:
- text: "Learn Shiny"
- text: "Get Started"
file: get-started/index.qmd
- text: "Concepts"
file: docs/overview.qmd
- text: "Components"
menu:
Expand All @@ -86,13 +89,6 @@ website:
- text: "Templates"
file: templates/index.qmd
icon: code-square
- text: "Deploy"
menu:
- text: "Overview"
href: docs/deploy.qmd
- docs/deploy-cloud.qmd
- docs/deploy-on-prem.qmd
- docs/shinylive.qmd
- text: "Gallery"
file: gallery/index.qmd
- text: "Playground"
Expand Down Expand Up @@ -226,8 +222,25 @@ website:
href: "/layouts/arrange/index.html#column-nesting"
- text: "Controlling for Page Size"
href: "/layouts/arrange/index.html#controlling-for-page-width-and-height"
- id: get-started
style: "floating"
collapse-level: 1
align: left
contents:
- get-started/index.qmd
- get-started/what_is_shiny.qmd
- get-started/install.qmd
- get-started/create-run.qmd
- get-started/debug.qmd
- section: "Deploy"
contents:
- text: "Overview"
href: get-started/deploy.qmd
- get-started/deploy-cloud.qmd
- get-started/deploy-on-prem.qmd
- get-started/shinylive.qmd

- id: docs
- id: concepts
style: "floating"
collapse-level: 2
align: left
Expand All @@ -236,10 +249,6 @@ website:
contents:
- docs/overview.qmd
- docs/user-interfaces.qmd
- section: "<span class='emoji-icon'>💻</span> __Workflow__"
contents:
- docs/install-create-run.qmd
- docs/debug.qmd
- section: "<span class='emoji-icon'>🤖</span> __Generative AI__"
contents:
- docs/genai-inspiration.qmd
Expand Down
2 changes: 1 addition & 1 deletion docs/_metadata.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sidebar: get-started
sidebar: concepts
183 changes: 0 additions & 183 deletions docs/install-create-run.qmd

This file was deleted.

1 change: 1 addition & 0 deletions get-started/_metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sidebar: get-started
17 changes: 17 additions & 0 deletions get-started/assets/code-welcome.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added get-started/assets/dashboard-template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added get-started/assets/positron-run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added get-started/assets/tipping-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added get-started/assets/vscode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions get-started/create-run.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
title: "Create and Run"
---

When you [install shiny](get-started/install.qmd), you will have access to the `shiny` command line interface (CLI).
You can use this interface to help you create and run your Shiny applications.

## Create a Shiny application

The best way to create a new Shiny app is with the `shiny create` command line interface.
This command asks you a series of questions about what kind of app you want to create,
and then provides all the boilerplate code you need to get started with a working app.

```bash
shiny create
```

![Running the shiny create command from a terminal](/docs/assets/shiny-create.mp4){class="img-shadow"}

::: callout-tip
### Copy/paste examples

If you find an example on this site that you want to run or edit locally,
you can use the following command to get a basic app template,
then copy and paste the code from the example into the template.

```bash
shiny create --template basic-app -m express
```
:::


## Run your Shiny application

Shiny apps can be launched from Positron, VS Code, or the command line via `shiny run`.

::: {.callout-tip}
#### Name your app `app.py`

We recommend naming your shiny application `app.py`.
This is the default file that `shiny run` will look for, so you can run the application in the terminal without any additional parameters.

If you need a more unique name, we recommend beginning the file with `app`, so the shiny extension can still run with a [play button click](install.qmd#positron).
:::

### Positron and VS Code

The best way to run (and develop) Shiny apps is in [Positron][positron] or [Visual Studio Code][vscode] with the [Shiny extension][vscode-shiny].
When a Shiny `app.py` file is being edited, the default behavior of the Run button (circled in red in the screenshot below) becomes "Run Shiny App".

![Visual Studio Code running with the Shiny extension](assets/positron-run.png)

This launches a Python process in a dedicated terminal instance, and a captive web browser.
This lets you test your app without leaving your editor, and whenever you make changes to your app's source, the preview will update. To preview your app in a full browser, click the icon to the right of the URL bar to launch the app in an external browser.

Next to the Run button is a dropdown menu that lets you "Debug Shiny App". This launches the app in debug mode, which lets you set breakpoints and step through your code.
See the [debugging](debug.qmd) section for more information.

### Command line

To run a Shiny app from the command line, use the `shiny run` command.
This command takes a single argument, the path to the app's entry point.
For example, if your app's entry point is `app.py` in the directory `./app_dir`, you can run it like this:

```bash
shiny run --reload --launch-browser app_dir/app.py
```

This should start your app and also automatically launch a web browser.

The `--reload` flag means that file changes in the current directory tree will cause the Python process to restart and the browser to reload.
Update and save changes to `app.py` and then wait a moment for the changes to appear in the browser.

With these two `shiny` commands, you now have a project that you can run in your terminal.
You can use any text editor or Python IDE to write Shiny apps, but we've taken special care to ensure a smooth workflow for [Positron][positron] and [Visual Studio Code][vscode].

[positron]: https://positron.posit.co/
[vscode]: https://code.visualstudio.com/
[vscode-shiny]: https://marketplace.visualstudio.com/items?itemName=posit.shiny
[vscode-python]: https://marketplace.visualstudio.com/items?itemName=ms-python.python
4 changes: 1 addition & 3 deletions docs/debug.qmd → get-started/debug.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ The error displayed in the app is only the final part of the stack trace, but th
When Shiny apps are deployed, error messages are sanitized to the eliminate the possibility of leaking sensitive information. To unsanitize error messages, you'll need to set `sanitize_errors=False` in the `App` constructor (of a [Shiny core app](express-vs-core.qmd)).
:::



## Debugging

### VS Code debugger
### Positron and VS Code debugger

The [VS Code debugger](https://code.visualstudio.com/docs/editor/debugging) is a powerful tool for debugging Python code.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading