Skip to content

Commit

Permalink
shuffled jupyter content from nasa cookbook
Browse files Browse the repository at this point in the history
  • Loading branch information
jules32 committed Jul 8, 2022
1 parent d8a45b4 commit 1636cea
Show file tree
Hide file tree
Showing 11 changed files with 275 additions and 52 deletions.
4 changes: 2 additions & 2 deletions _site/quarto-workflows/browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-0.9.550">
<meta name="generator" content="quarto-0.9.653">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down Expand Up @@ -202,7 +202,7 @@ <h2 class="anchored" data-anchor-id="commit-and-publish">Commit and publish</h2>
<p><img src="images/github-commit.png" class="img-fluid figure-img"></p>
</figure>
</div>
<p>Now, click back to the main page of your GitHub repository. You should see the orange dot <a href="first-observations.md#confirm">confirming your website is published</a>. You’ll have to wait for the GitHub Action to tell quarto to build your site for you to see the update, but it will be there!</p>
<p>Now, click back to the main page of your GitHub repository. You should see the orange dot <a href="explore.qmd#confirm">confirming your website is published</a>. You’ll have to wait for the GitHub Action to tell quarto to build your site for you to see the update, but it will be there!</p>
</section>
<section id="limitations" class="level2">
<h2 class="anchored" data-anchor-id="limitations">Limitations</h2>
Expand Down
2 changes: 1 addition & 1 deletion _site/quarto-workflows/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-0.9.550">
<meta name="generator" content="quarto-0.9.653">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down
164 changes: 137 additions & 27 deletions _site/quarto-workflows/jupyter.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _site/quarto-workflows/rstudio.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-0.9.550">
<meta name="generator" content="quarto-0.9.653">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down Expand Up @@ -215,7 +215,7 @@ <h3 class="anchored" data-anchor-id="install-quarto">Install Quarto</h3>
</section>
<section id="rstudio-orientation" class="level3">
<h3 class="anchored" data-anchor-id="rstudio-orientation">RStudio orientation</h3>
<p>Now let’s take a moment to get oriented. This is an RStudio project, which is indicated in the top-left. The bottom right pane shows all the files in your project; everything we’ve cloned from GitHub.</p>
<p>Now let’s take a moment to get oriented. This is an RStudio project, which is indicated in the top-right. The bottom right pane shows all the files in your project; everything we’ve cloned from GitHub. We can open any RStudio project by opening its <code>.Rproj</code> file, or from RStudio File &gt; Open Project ….</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="images/rstudio-orientation.png" class="img-fluid figure-img" alt="Screenshot of the RStudio IDE highlighting the project name and files pane"></p>
Expand Down
18 changes: 9 additions & 9 deletions _site/search.json

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions _site/site_libs/quarto-html/quarto-syntax-highlighting.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion _site/site_libs/quarto-html/quarto.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
const convertToMenu = () => {
for (const child of el.children) {
child.style.opacity = 0;
child.style.display = "none";
}

const toggleContainer = window.document.createElement("div");
Expand Down Expand Up @@ -312,6 +313,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {

const clone = child.cloneNode(true);
clone.style.opacity = 1;
clone.style.display = null;
toggleContents.append(clone);
}
toggleContents.style.height = "0px";
Expand Down Expand Up @@ -376,6 +378,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
const convertToSidebar = () => {
for (const child of el.children) {
child.style.opacity = 1;
clone.style.display = null;
}

const placeholderEl = window.document.getElementById(
Expand Down Expand Up @@ -424,7 +427,10 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
const margin = lastBottom - top;
marginChild.style.marginTop = `${margin}px`;
}
lastBottom = top + marginChild.getBoundingClientRect().height;
const styles = window.getComputedStyle(marginChild);
const marginTop = parseFloat(styles["marginTop"]);

lastBottom = top + marginChild.getBoundingClientRect().height + marginTop;
}

// Manage the visibility of the toc and the sidebar
Expand Down
16 changes: 8 additions & 8 deletions _site/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://openscapes.github.io/quarto-website-tutorial/transition-from-rmarkdown.html</loc>
<lastmod>2022-06-09T20:31:05.410Z</lastmod>
<lastmod>2022-07-08T00:04:57.906Z</lastmod>
</url>
<url>
<loc>https://openscapes.github.io/quarto-website-tutorial/index.html</loc>
<lastmod>2022-07-07T22:43:50.786Z</lastmod>
<lastmod>2022-07-08T00:04:58.299Z</lastmod>
</url>
<url>
<loc>https://openscapes.github.io/quarto-website-tutorial/learning-more.html</loc>
<lastmod>2022-07-07T22:43:50.268Z</lastmod>
<lastmod>2022-07-08T00:04:58.634Z</lastmod>
</url>
<url>
<loc>https://openscapes.github.io/quarto-website-tutorial/explore.html</loc>
<lastmod>2022-07-07T22:43:39.945Z</lastmod>
<lastmod>2022-07-08T00:04:59.049Z</lastmod>
</url>
<url>
<loc>https://openscapes.github.io/quarto-website-tutorial/quarto-workflows/browser.html</loc>
<lastmod>2022-06-09T20:31:06.924Z</lastmod>
<lastmod>2022-07-08T00:04:59.372Z</lastmod>
</url>
<url>
<loc>https://openscapes.github.io/quarto-website-tutorial/quarto-workflows/jupyter.html</loc>
<lastmod>2022-06-09T20:31:07.279Z</lastmod>
<lastmod>2022-07-08T00:04:59.806Z</lastmod>
</url>
<url>
<loc>https://openscapes.github.io/quarto-website-tutorial/quarto-workflows/index.html</loc>
<lastmod>2022-06-09T20:31:07.609Z</lastmod>
<lastmod>2022-07-08T00:05:00.127Z</lastmod>
</url>
<url>
<loc>https://openscapes.github.io/quarto-website-tutorial/quarto-workflows/rstudio.html</loc>
<lastmod>2022-06-09T20:31:08.031Z</lastmod>
<lastmod>2022-07-08T00:05:00.487Z</lastmod>
</url>
</urlset>
2 changes: 1 addition & 1 deletion _site/transition-from-rmarkdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-0.9.550">
<meta name="generator" content="quarto-0.9.653">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down
101 changes: 100 additions & 1 deletion quarto-workflows/jupyter.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,106 @@ cd quarto-website-tutorial

### Install Quarto

Not needed - Quarto is already installed on the NASA-Openscapes JupyterHub! Otherwise you would do so from <https://quarto.org/docs/get-started/>.
Not needed - Quarto is already installed on the NASA-Openscapes JupyterHub! But to install elsewhere you would do so from <https://quarto.org/docs/get-started/>.

Quarto is a Command Line Interface (CLI), like git. Once download is complete, follow the installation prompts on your computer like you do for other software. You won't see an application to click on when it is installed.

*Note for Mac users: If you do not have administrative privileges, please select "Install for me only" during the Destination Selection installation step (you will first click on "Change Install Location" at the Installation Type step).*

You can check to confirm that Quarto is installed properly from the command line:

``` bash
quarto check install
```

::: {.callout-note collapse="true"}
## Additional checks

You can also run:

- `quarto check knitr` to locate R, verify we have the rmarkdown package, and do a basic render
- `quarto check jupyter` to locate Python, verify we have Jupyter, and do a basic render
- `quarto check` to run all of these checks together
:::

::: {.callout-tip collapse="true"}
## Historical aside: Install Quarto in a docker container

In Summer 2021 some NASA Mentors trying to install quarto locally was not an option, but they were able to install it inside a container using the following `Dockerfile`:

``` bash
#| fold: true
#| summary: "Show the Dockerfile"

##############################
# This Dockerfile installs quarto and then runs quarto serve against the
# internal /home/quarto/to_serve.
#
# BUILD
# -----
# To build this container, run
#
# docker build -t quarto_serve .
#
# Add the --no-cache option to force docker to build fresh and get the most
# recent version of quarto.
#
#
# RUN
# ---
# 1. Find the directory you want quarto to serve. Let's call this /PATH/TO/earthdata-cloud-cookbook.
# 2. Run docker:
#
# docker run --rm -it -p 4848:4848 -v /PATH/TO/earthdata-cloud-cookbook:/home/quarto/to_serve quarto_serve
#
# 3. Open your browser and go to http://127.0.0.1:4848/
#
##############################

FROM ubuntu:hirsute

######
# Install some command line tools we'll need
######
RUN apt-get update
RUN apt-get -y install wget
RUN apt-get -y install gdebi-core
RUN apt-get -y install git


######
# Install quarto (https://quarto.org/)
######

# This is a quick and dirty way of getting the newest version number from
# https://github.com/quarto-dev/quarto-cli/releases/latest. What's happening is
# we're pulling the version number out of the redirect URL. This will end up
# with QVER set to something like 0.2.11.
RUN QVER=`wget --max-redirect 0 https://github.com/quarto-dev/quarto-cli/releases/latest 2>&1 | grep "Location" | sed 's/L.*tag\/v//' | sed 's/ .*//'` \
&& wget -O quarto.deb "https://github.com/quarto-dev/quarto-cli/releases/download/v$QVER/quarto-$QVER-amd64.deb"
RUN gdebi -n quarto.deb

# Run this to make sure quarto installed correctly
RUN quarto check install


######
# Create a non-root user called quarto
######
RUN useradd -ms /bin/bash quarto
USER quarto
RUN mkdir /home/quarto/to_serve
WORKDIR /home/quarto/to_serve


######
# Start quarto serve
######

CMD quarto serve --no-browse --host 0.0.0.0 --port 4848
```

:::

## Quarto preview

Expand Down

0 comments on commit 1636cea

Please sign in to comment.