Skip to content

Commit 338800b

Browse files
committed
feat(basic_structure): focus instructions on preview button due to codespace autosave
1 parent 84ed536 commit 338800b

3 files changed

Lines changed: 23 additions & 11 deletions

File tree

pages/basic_structure/index.qmd

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,24 +104,36 @@ This is my homepage.
104104

105105
## Rendering your website
106106

107-
**Rendering** means converting your Quarto source files into the final website - a colelction of `.html` pages that live inside a folder called `_site`. There are two ways to do this.
107+
**Rendering** means converting your Quarto source files into the final website - a collection of `.html` pages that live inside a folder called `_site`. To render your site:
108108

109-
**Option 1: Preview button.** Open `index.qmd` in the editor, and click the **Preview** button in the top right hand corner
109+
1. Open `index.qmd` in the editor, and click the **Preview** button in the top right hand corner
110110

111-
![](preview_button.drawio.png){fig-alt="Screenshot of VSCode with Preview button circled."}
111+
![](preview_button.drawio.png){fig-alt="Screenshot of VSCode with Preview button circled."}
112112

113-
**Option 2: Terminal.** In the bottom panel, ensure you are on the **Terminal** tab. The Terminal is a place where you type commands instead of clicking buttons. We just need to type `quarto preview` then press <kbd>Enter</kbd> on your keyboard.
113+
2. In the bottom panel in the Terminal, you should see it says **Preparing to preview** and runs through files. It is creating `_sites/` folder containing your rendered site. Then when it is done, green text saying `Browse at ...`.
114114

115-
![](preview_terminal.drawio.png){fig-alt="Screenshot of VSCode with 'quarto preview' command in Terminal circled."}
115+
![](preparing_preview.png){fig-alt="Screenshot of the 'Preparing to preview' message in the Terminal."}
116116

117-
After either of these, you should see it says **Preparing to preview** and runs through files. It is creating `_sites/` folder containing your rendered site. Then when it is done, green text saying `Browse at ...`.
117+
3. You are now viewing a **live preview** of your site in the browser. Nothing is public yet; this preview only runs on your own computer. In other words, you are the only person who can see this site right now, and it will not appear on the internet until you deliberately publish or upload the rendered files somewhere.
118+
119+
By default, VSCode will open the preview in-line. This will be quite a small preview - to open it in a new tab, either copy the URL from the Terminal (`http://localhost:...`) or click the "Open in Browser" button in the top right.
120+
121+
![](inline.png){fig-alt="Screenshot of preview opened in-line, with cursor hovering over the 'Open in Browser' button."}
122+
123+
<br>
118124

119-
![](preparing_preview.png){fig-alt="Screenshot of the 'Preparing to preview' message in the Terminal."}
120125

121-
Open that link, by doing <kbd>Ctrl</kbd> and click, or by simply copying and pasting the link into your web browser.
122126

123-
This will open a **live preview** of your site in the browser. Keep the browser open while you edit; every time you save a Quarto file, the preview will auto-refresh so you can immediately see your changes without re-running any commands.
127+
::: {.callout-note title="Optional extra: rendering via the terminal" collapse="true"}
124128

125-
Nothing is public yet; this preview only runs on your own computer. In other words, you are the only person who can see this site right now, and it will not appear on the internet until you deliberately publish or upload the rendered files somewhere.
129+
Alternatively, you can render and preview your site directly via commands in the terminal.
126130

127-
![](site.png){fig-alt="Screenshot of the rendered site."}
131+
In the bottom panel, ensure you are on the **Terminal** tab. The Terminal is a place where you type commands instead of clicking buttons. We just need to type `quarto preview` then press <kbd>Enter</kbd> on your keyboard.
132+
133+
![](preview_terminal.drawio.png){fig-alt="Screenshot of VSCode with 'quarto preview' command in Terminal circled."}
134+
135+
You can then use the `http://localhost:...` link printed in the Terminal to open your site in the browser.
136+
137+
With this method, the site updates automatically whenever files are saved. In Codespaces, files are auto‑saved very frequently, so the preview will re-render often; for that reason, the **Preview** button described above is usually a calmer option during this workshop.
138+
139+
:::

pages/basic_structure/inline.png

187 KB
Loading

pages/basic_structure/site.png

-168 KB
Binary file not shown.

0 commit comments

Comments
 (0)