Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ Vale runs [via GH action on PRs](https://github.com/posit-dev/positron-website/a

## Local development

If you have Quarto and Chrome or Edge installed locally, you can preview the site by running one of the Debug Configurations in VS Code or Positron.
If you have [Quarto installed locally](https://quarto.org/docs/get-started/) and Chrome or Edge, you can preview the site by running one of the Debug Configurations in VS Code or Positron.

The configurations run `quarto preview` and then open the site in a new browser window.
- **Preview Docs (Chrome)**: Preview the site in Chrome
- **Preview Docs (Edge)**: Preview the site in Edge

The site will re-render as you make changes to the `.qmd` files.

Alternatively, you can run the command `quarto preview` in the terminal.

## Managing execution and rendering

Some `.qmd` files used for our site involve executable code, like the `.qmd` file that creates <https://positron.posit.co/download>. We currently use the ["Local Execution with CI Rendering" option described in the Quarto docs](https://quarto.org/docs/publishing/ci.html#rendering-for-ci), with the [freeze](https://quarto.org/docs/projects/code-execution.html#freeze) execution option to make it easier for us to collaborate together across the large number of pages. For now, if you need to update a page involving computations, be sure to render that page locally and check in the files created in the `_freeze` directory.
1 change: 1 addition & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ website:
- remote-ssh.qmd
- updating.qmd
- extension-development.qmd
- folder-templates.qmd
- section: "Migrating from RStudio"
contents:
- rstudio-keybindings.qmd
Expand Down
42 changes: 42 additions & 0 deletions folder-templates.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: "Folder Templates"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we like this title but I wanted to keep it generic for when we eventually add more templates (built-in or even user supported). Not in love with this title so I'm open to ideas.

The doc feels a little incomplete to me but I can't figure out what's missing...

---

The **New Folder from Template** feature helps you start new projects faster. Use this feature when you want to avoid manual setup, or ensure your project includes all recommended files and settings from the start. Instead of running multiple setup commands, you can make a few selections and Positron sets up everything for you automatically. This feature is ideal if you want to:

- Save time and avoid manual setup steps
- Start with a ready-to-use environment for your language or framework

## Template contents

When you use a folder template, Positron creates a new project folder and configures the following items:

- **Environment directory:** A dedicated environment (such as `.venv` for Python) so you can install packages without affecting other projects.
- **Version control:** A `.git` directory and a `.gitignore` file with common patterns for your language or framework.
- **Directory structure:** Folders and files recommended for your template type, so your project is organized from the start.
- **Interpreter instance:** A new interpreter session starts automatically, ready for you to run code.
- **Editor:** An untitled file is opened in the editor, or a notebook is started with your chosen interpreter.

## Using a template

To bring up the **New Folder from Template** dialog, select the "New" dropdown menu in the top-left or select the workspace switcher in the top-right. Select the "New Folder from Template" option from the menu to bring up the dialog.

You can also bring up the dialog by running the _Workspaces: New Folder from Template..._ command in the Command Palette.

After setup, your project is ready for development. You can open the folder in the current window or a new window. By default, Positron starts a session for the interpreter you selected. You can customize this behavior in the settings. For more details, see the [interpreter startup guide](interpreter-startup.qmd#configuring-interpreter-startup).

## About Python templates

Python templates create a project with an isolated environment. This prevents conflicts between package versions and makes your work more reproducible.

You can choose to use a `pyproject.toml` file for advanced dependency management.

For more about environment managers, see the [supported environment managers guide](python-installations.qmd#supported-environment-managers). For details about Python interpreter discovery, see the [Discovering Python Installations guide](python-installations.qmd).

## About R templates

R templates help you create projects with the right R version.

You can choose to use `renv` for reproducibility, but this is an advanced option. Most users should leave this box unchecked unless you are familiar with `renv` and need strict dependency management for your project.

`renv` is an R package that manages project dependencies. It creates a snapshot of the R packages in your project and saves them in a `renv.lock` file. This is helpful for power users who need to share projects or ensure exact package versions. You can learn more about renv [here](https://rstudio.github.io/renv/articles/renv.html).
2 changes: 1 addition & 1 deletion python-installations.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ You can create new Python environments directly from Positron using the _Python:

The environment will be created in your workspace and automatically discovered.

You can also use the **New Folder From Template** feature to create a new Python project, and set up an environment as part of the project.
You can also use the [New Folder From Template feature](folder-templates.qmd#new-folder-from-template) to create a new Python project, and set up an environment as part of the project.

### Discovering existing environments

Expand Down