-
Notifications
You must be signed in to change notification settings - Fork 307
Add Quarto Space docs #1226
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
gshotwell
wants to merge
6
commits into
huggingface:main
Choose a base branch
from
gshotwell:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Quarto Space docs #1226
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Quarto on Spaces | ||
|
||
[Quarto](https://quarto.org/) is a powerful tool for creating reproducible scientific and technical documents. | ||
With Quarto, you can interleave markdown and code chunks to generate pdfs, websites, presentations, and more. | ||
|
||
## Getting Started with Quarto on Spaces | ||
|
||
### Edit the site on Hugging Face | ||
|
||
1. Create the Quarto space | ||
|
||
Quarto spaces have very minimal compute requirements, so a small CPU space will be sufficient for most sites. You can create a space by clicking this button: | ||
|
||
<a href="https://huggingface.co/new-space?template=posit/quarto-template"> <img src="https://huggingface.co/datasets/huggingface/badges/raw/main/deploy-to-spaces-lg.svg"/> </a> | ||
|
||
2. Edit in the browser | ||
|
||
You can make changes to the quarto site directly in Hugging Face. | ||
There are three main types of files which you will need to edit in order to make changes: | ||
|
||
- The `src/_quarto.yml` file contains the site navigation, and is the best place to start if you want to change the structure of the site. | ||
- The notebook and `.qmd` files in the `src` directory contain the actual content of the web pages. | ||
- The `Dockerfile` contains the instructions for building the site. For example, if you want to change the version of Quarto which the site uses, you should update the Dockerfile. | ||
|
||
3. Commit your changes and build the site | ||
|
||
### Local development | ||
|
||
Editing the site on Hugging Face is a convenient way to make small changes, but most of the time you will want to develop and preview the site locally before deploying. | ||
This will allow you to view your changes more quickly, and to use the full power of the Quarto development environment. | ||
|
||
1. Create the Quarto space as above | ||
|
||
2. Clone the Repo | ||
|
||
To clone the space locally run the following command, making sure to replace `<YOUR_HF_USER>` with your Hugging Face username and `quarto-template` with the name you chose for your space. | ||
|
||
``` | ||
git clone https://huggingface.co/spaces/<YOUR_HF_USER>/quarto-template | ||
``` | ||
|
||
3. Install Quarto | ||
|
||
In order to render your Quarto site without Docker, we recommend installing Quarto by following the instructions on the [official Quarto website](https://quarto.org/docs/get-started/). | ||
|
||
3. Install Quarto VS Code extension | ||
|
||
The [Quarto VS Code Extention](https://quarto.org/docs/tools/vscode.html) includes a number of productivity tools, including YAML Autocomplete, a preview button, and a visual editor. Quarto works great without VS Code, but the extension does make it easier to get the most out of Quarto. | ||
|
||
4. Edit the site | ||
The website files are contained in the `src` directory, and the site navigation is defined in `src/_quarto.yml`, try editing these files and either clicking the "Preview" button in VS Code or calling `quarto preview src` from the command line. | ||
|
||
5. Commit your changes and push | ||
Your site will rebuild whenever you push new commits to the `main` branch of your space repository. | ||
|
||
### Learn about Quarto | ||
|
||
You can do a lot of things with Quarto, and they are all documented on the [Quarto Website](https://quarto.org/guide/). In particular, you may be interested in: | ||
|
||
- All about building [websites](https://quarto.org/docs/websites/) | ||
- Building Static [Dashboards](https://quarto.org/docs/dashboards/) | ||
- How to write [books](https://quarto.org/docs/books/index.html) and [manuscripts](https://quarto.org/docs/manuscripts/) | ||
- Reproducible [presentations](https://quarto.org/docs/manuscripts/) | ||
- Including [Observable](https://quarto.org/docs/interactive/ojs/) or [Shiny](https://quarto.org/docs/interactive/shiny/) applications in your Quarto site | ||
gshotwell marked this conversation as resolved.
Show resolved
Hide resolved
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.