From 069a18abd527715e4c4e4db57a09b349e510992f Mon Sep 17 00:00:00 2001 From: Michael Rossetti Date: Thu, 15 Aug 2024 14:28:09 -0400 Subject: [PATCH] Workshop Content (#1) * Workshop exercises and notes outline * Prereqs * Exercises * Quarto book * Linked files not rendering (bug) * Content review * Pages still not rendering (bug) --- .github/workflows/deploy.yml | 69 ++++++ .gitignore | 4 + Makefile | 23 ++ README.md | 14 +- docs/.gitignore | 1 + docs/_quarto.yml | 131 +++++++++++ .../command-line-computing/index.qmd | 189 ++++++++++++++++ .../windows-command-prompt.qmd | 152 +++++++++++++ docs/exercises/hello-python/index.qmd | 58 +++++ docs/exercises/run-the-app/index.qmd | 32 +++ .../exercises/run-the-app/troubleshooting.qmd | 20 ++ docs/index.qmd | 42 ++++ docs/notes/clis/brew.qmd | 41 ++++ docs/notes/clis/conda.qmd | 1 + docs/notes/clis/pip.qmd | 1 + docs/notes/clis/python.qmd | 1 + docs/notes/dev-tools/git-bash.qmd | 1 + docs/notes/dev-tools/github-desktop.qmd | 1 + docs/notes/dev-tools/mac-terminal.qmd | 1 + docs/notes/dev-tools/vs-code.qmd | 1 + docs/notes/environment-variables.qmd | 1 + docs/prereqs/local-dev-setup/anaconda.qmd | 68 ++++++ docs/prereqs/local-dev-setup/git-client.qmd | 41 ++++ docs/prereqs/local-dev-setup/github.qmd | 14 ++ docs/prereqs/local-dev-setup/index.qmd | 25 +++ .../local-dev-setup/jupyter-notebooks.qmd | 6 + .../local-dev-setup/terminal-config.qmd | 68 ++++++ docs/prereqs/local-dev-setup/terminal.qmd | 35 +++ .../local-dev-setup/vs-code-config.qmd | 209 ++++++++++++++++++ .../local-dev-setup/vs-code-text-editor.qmd | 21 ++ docs/styles.css | 35 +++ 31 files changed, 1298 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 Makefile create mode 100644 docs/.gitignore create mode 100644 docs/_quarto.yml create mode 100644 docs/exercises/command-line-computing/index.qmd create mode 100644 docs/exercises/command-line-computing/windows-command-prompt.qmd create mode 100644 docs/exercises/hello-python/index.qmd create mode 100644 docs/exercises/run-the-app/index.qmd create mode 100644 docs/exercises/run-the-app/troubleshooting.qmd create mode 100644 docs/index.qmd create mode 100644 docs/notes/clis/brew.qmd create mode 100644 docs/notes/clis/conda.qmd create mode 100644 docs/notes/clis/pip.qmd create mode 100644 docs/notes/clis/python.qmd create mode 100644 docs/notes/dev-tools/git-bash.qmd create mode 100644 docs/notes/dev-tools/github-desktop.qmd create mode 100644 docs/notes/dev-tools/mac-terminal.qmd create mode 100644 docs/notes/dev-tools/vs-code.qmd create mode 100644 docs/notes/environment-variables.qmd create mode 100644 docs/prereqs/local-dev-setup/anaconda.qmd create mode 100644 docs/prereqs/local-dev-setup/git-client.qmd create mode 100644 docs/prereqs/local-dev-setup/github.qmd create mode 100644 docs/prereqs/local-dev-setup/index.qmd create mode 100644 docs/prereqs/local-dev-setup/jupyter-notebooks.qmd create mode 100644 docs/prereqs/local-dev-setup/terminal-config.qmd create mode 100644 docs/prereqs/local-dev-setup/terminal.qmd create mode 100644 docs/prereqs/local-dev-setup/vs-code-config.qmd create mode 100644 docs/prereqs/local-dev-setup/vs-code-text-editor.qmd create mode 100644 docs/styles.css diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..6678b5f --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,69 @@ + +name: deploy + +on: + push: + branches: + - main + + # make this workflow manually runnable + # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + + +jobs: + deploy-book: + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + steps: + - uses: actions/checkout@v4 + + # + # PYTHON STUFF + # + + # INSTALL PYTHON + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + ## INSTALL DOCUMENTATION DEPENDENCIES + #- name: Install docs dependencies + # run: | + # pip install -r docs/requirements.txt + + # + # QUARTO STUFF + # + + # INSTALL QUARTO + - name: Set up Quarto + uses: quarto-dev/quarto-actions/setup@v2 + with: + # Install LaTeX to build PDF book (to make the build pass) + tinytex: true + # optionally pin a version: + # version: pre-release + + # RENDER HTML AND PDF (see docs/_build) + - name: Build the book + run: | + quarto render docs/ + + # + # GITHUB PAGES STUFF + # + + # Upload the book's HTML as an artifact + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: "docs/_build" + + # Deploy the book's HTML to GitHub Pages + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index 82f9275..fe573f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ + + +.DS_Store + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0ee7199 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ + +preview: + quarto preview docs/ + +render: + quarto render docs/ + +build: + quarto render docs/ + open docs/_build/index.html + +open: + open docs/_build/index.html + +#open-pdf: +# open docs/_build/index.pdf + + +# remove cache to get a clean build, as desired: +render-fresh: + rm -rf docs/_build + rf -rf docs/.quarto + quarto render docs/ diff --git a/README.md b/README.md index fb07e42..f376ecb 100644 --- a/README.md +++ b/README.md @@ -5,18 +5,16 @@ **Description:** Install and configure tools to help you manage and develop Python programs like a professional. Attendees will become familiar with development tools such as a text editor and command line application. **Learning Objectives:** -1. Use GitHub Desktop software to download existing Python repositories from GitHub. -2. Utilize local development tools to write and execute Python code for research and software development. +1. Utilize local development tools to write and execute Python code for research and software development. +2. Use GitHub Desktop software to download existing Python repositories from GitHub. 3. Use a text editor to read, write, and save files of Python code. 4. Create and manage virtual environments using Anaconda. -5. Manage package installations effectively using pip within a virtual environment -2. use a requirements file to list package dependencies for a given project. -6. Discuss security measures needed to protect secret credentials used by research and application code. -7. Run Python programs on your computer. +5. Manage package installations effectively using Pip within a virtual environment, and practice using a requirements file to list package dependencies for a given project. +6. Run Python programs on your computer. +7. Discuss security measures needed to protect secret credentials used by research and application code. **Required Software:** + GitHub Desktop (requires a GitHub account) + VS Code Text Editor -+ Anaconda ++ Anaconda, Python, and Pip + Command Line Application (Terminal on Mac, Git Bash on Windows) - diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..075b254 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +/.quarto/ diff --git a/docs/_quarto.yml b/docs/_quarto.yml new file mode 100644 index 0000000..cda1817 --- /dev/null +++ b/docs/_quarto.yml @@ -0,0 +1,131 @@ +project: + type: book # website + output-dir: "_build" + preview: + port: 4567 + browser: true + + + render: + # be able to link to these other hidden documents not included in the sidebar contents + # (this doesn't work though???) + # https://quarto.org/docs/projects/quarto-projects.html#render-targets + # https://github.com/quarto-dev/quarto-cli/discussions/7312#discussioncomment-7345228 + - prereqs/local-dev-setup/terminal-config.qmd + - prereqs/local-dev-setup/vs-code-config.qmd + - exercises/run-the-app/troubleshooting.qmd + - notes/clis/brew.qmd + + +# https://quarto.org/docs/books/ +# https://quarto.org/docs/reference/projects/books.html +book: + title: "Local Development Tools for Python Programming" + author: "Michael Rossetti" + date: "last-modified" # "7/24/2024" + date-format: "iso" + #doi: "...." + #isbn: "..." + #issn: "..." + #edition: "v2" + +#website: + + site-url: https://s2t2.github.io/python-dev-tools-workshop-2024/ + repo-url: https://github.com/s2t2/python-dev-tools-workshop-2024 + repo-branch: main + repo-subdir: docs + repo-actions: [edit, issue, source] + #downloads: [pdf, epub, docx] + + # https://quarto.org/docs/websites/website-tools.html#google-analytics + #google-analytics: "G-..." + + #sharing: [twitter, facebook] + # https://quarto.org/docs/websites/website-tools.html#open-graph + open-graph: true + + # https://quarto.org/docs/reference/projects/books.html#search + search: true + #location: sidebar # navbar, sidebar + #type: textbox # overlay, textbox + + #cover-image: images/cover.png + #favicon: images/favicon.ico + + # https://quarto.org/docs/websites/website-navigation.html#side-navigation + #sidebar: + # logo: images/ospo-logo.png + + #sidebar: + # contents: + # - index.qmd + # + # - section: + # href: prereqs/local-dev-setup/index.qmd + # title: "Prerequisites" + # contents: + # - prereqs/local-dev-setup/github.qmd + # - prereqs/local-dev-setup/vs-code-text-editor.qmd + # - prereqs/local-dev-setup/terminal.qmd + # - prereqs/local-dev-setup/anaconda.qmd + # - prereqs/local-dev-setup/git-client.qmd + + + chapters: + - index.qmd + + - "-------------" + + - part: "Setup Guide (Prereqs)" + href: prereqs/local-dev-setup/index.qmd + chapters: + - prereqs/local-dev-setup/github.qmd + - prereqs/local-dev-setup/vs-code-text-editor.qmd + - prereqs/local-dev-setup/terminal.qmd + - prereqs/local-dev-setup/anaconda.qmd + - prereqs/local-dev-setup/git-client.qmd + + + + - "-------------" + + - part: "Workshop Exercises" + chapters: + - href: exercises/command-line-computing/index.qmd + text: Command-line Computing + - href: exercises/hello-python/index.qmd + text: Hello Python + - href: exercises/run-the-app/index.qmd + text: Run the App (Tic Tac Toe) + + + - "-------------" + + + #appendices: + + + # shows up at bottom of page + #body-footer: "© Copyright 2024, Your Name Here" + + #page-footer: + # center: | + #

© Copyright 2024, GWU Open Source Program Office (OSPO)

+ + +#bibliography: references.bib + +format: + html: + # https://quarto.org/docs/output-formats/html-themes.html + theme: + light: default #flatly + dark: darkly + css: styles.css + number-sections: false + from: markdown+emoji # enable emojis + + + #pdf: + # documentclass: scrreprt diff --git a/docs/exercises/command-line-computing/index.qmd b/docs/exercises/command-line-computing/index.qmd new file mode 100644 index 0000000..69d122d --- /dev/null +++ b/docs/exercises/command-line-computing/index.qmd @@ -0,0 +1,189 @@ +# "Command-line Computing" Exercise + +Before we start learning about Python or software development, it will be helpful for us to achieve a basic level of familiarity with a command-line application. We use the command-line to navigate the computer's filesystem, execute Python scripts, and perform other tasks using command-line utilities (CLIs). + +Commands may differ based on which operating system and command-line application you're using, but we should encouraged to learn the prevalent "unix-style" commands: + + + On Mac OS, the default Terminal application will allow students to use unix-style commands. + + On Windows OS, the default Command Prompt application uses different commands, but installing the Git Bash application will allow students to use unix-style commands. + +Additional References: + + + [Intro to the Command-Line - Mozilla](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Understanding_client-side_tools/Command_line) + +## Instructions + +Open the Terminal application (Mac) or the Git Bash application (Windows). + +After typing each of the commands below, press "enter" to execute it. + +Optionally clear previous terminal output at any time by pressing "command + k", or by typing `clear` and pressing "enter". + +### Current User + +Display the current user's name: + +```sh +whoami +``` + +### Present Working Directory + +Display the current/present working directory: + +```sh +pwd +``` + +### Listing Files in a Directory + +List files in the current working directory: + +```sh +ls +``` + +Alternatively, list files using a different display, including file permissions and hidden files: + +```sh +ls -al +``` + +### Navigating and Managing Directories + +Change directories (specifying an absolute file path): + +```sh +cd ~/Desktop +``` + +> FYI: the tilde (`~`) represents your "home" filepath + +> FYI: you can use `cd ..` to move "up" one directory relative to the current working directory + +Open a directory via the operating system's filesystem explorer: + +```sh +# Mac Terminal: +open . + +# Windows Git Bash: +explorer . +``` + +Make a new directory: + +```sh +mkdir my_folder +``` + +Remove a directory: + +```sh +# triggers an error: +# rm my_folder + +# uses options called flags to recursively (-r) force (-f) removal: +rm -rf my_folder +``` + +### Managing Files + +Setup a new directory in which to add some files, and navigate into that directory: + +```sh +mkdir my_folder +cd my_folder +``` + +Create one or more files in the new directory you just created: + +```sh +touch README.md +touch index.html +touch my_data.csv +touch my_message.txt +``` + +Remove a file: + +```sh +rm index.html +``` + +Open a file in a text editor like VS Code (then edit it, and save it): + +```sh +code my_message.txt +``` + +> NOTE: Mac users may need to first configure the `code` command by following these [VS Code shell command setup instructions](../../prereqs/local-dev-setup/vs-code-config.qmd#shell-commands) + +Display file contents: + +```sh +cat my_message.txt +``` + +Move a file: + +```sh +mv ~/Desktop/my_folder/my_message.txt ~/Desktop +``` + +> FYI: If you are into maximum efficiency, press "tab" to auto-complete file paths so you don't have to type the whole thing. :smiley_cat: + +Copy a file: + +```sh +cp ~/Desktop/my_message.txt ~/Desktop/my_folder +``` + +Copy contents of a file into the clipboard for pasting: + +```sh +# Mac OS: +pbcopy < ~/Desktop/my_folder/my_message.txt + +# Windows OS: +cat ~/Desktop/my_folder/my_message.txt | clip + +# ... then just paste as you normally would after copying some text +``` + + +
+ +## Further Exploration (Mac Only) + +There are many other utilities to use from the command-line. For example, you may optionally try some of the examples below. + +Making your computer speak: + +```sh +say "Hello, I am your computer. Let's be friends." +``` + +Tracing the route traveled by a network request: + +```sh +traceroute google.com +# ... stop after a few seconds if necessary by pressing: control + c +``` + +Timing the duration of a network request: + +```sh +ping google.com +# ... stop after a few seconds if necessary by pressing: control + c +``` + +Requesting the contents of a webpage: + +```sh +curl google.com + +curl http://www.google.com + +curl https://raw.githubusercontent.com/prof-rossetti/intro-to-python/master/data/products.json +``` diff --git a/docs/exercises/command-line-computing/windows-command-prompt.qmd b/docs/exercises/command-line-computing/windows-command-prompt.qmd new file mode 100644 index 0000000..42882af --- /dev/null +++ b/docs/exercises/command-line-computing/windows-command-prompt.qmd @@ -0,0 +1,152 @@ +# Command-line Computing Exercise + +## Command Prompt (Windows OS) + +Open the Command Prompt application. + +> FYI: If you are into maximum efficiency through keyboard shortcuts, get there quick by pressing the "windows" button, then begin typing the word "command", then hit enter when you see "Command Prompt" show up. :smiley_cat: +> +> ![a screenshot of the command prompt app showing up as a result of a search](/img/exercises/command-line-computing/windows-shortcut.png) + +![a screenshot of the command prompt](/img/exercises/command-line-computing/windows-command-prompt.png) + +## Instructions + +After typing each of the commands below, press "enter" to execute it. + +Optionally, clear previous output at any time by typing "CLS" and pressing "enter". + +### Current User + +Print the current user's name: + +```sh +whoami +``` + +### Present Working Directory + +Print the current/present working directory: + +```sh +cd +``` + +### List Files in a Directory + +List files in the current working directory: + +```sh +dir +``` + +### Navigate and Manage Directories + +Change directories (specifying absolute file path): + +```sh +cd C:\Users\YOUR_USERNAME\Desktop\ # where YOUR_USERNAME is the name of the user currently operating your local machine +``` + +> NOTE: if your username has a space in it (e.g. "Sammy Student"), then you may run into issues unless you surround the name of that directory with quotes (e.g. `cd C:\Users\"Sammy Student"\Desktop\`. This usage of quotes applies to any / all files and directories which may have spaces in them, so in general you are encouraged to create new files and directories without any spaces in them, to make life easier on yourself. + +Make a new directory: + +```sh +mkdir my_folder +``` + +Remove a directory: + +```sh +rmdir my_folder +``` + +### Manage Files + +Change directories (using relative file path): + +```sh +cd my_folder # first re-create this directory if it doesn't exist, else this will trigger an error +``` + +> FYI: Use the command `cd ..` to move "up" one directory relative to the current working directory. + +Create one or more files: + +```sh +type nul > README.md +type nul > index.html +type nul > my_data.csv +type nul > my_message.txt +``` + +> CLARIFICATION: yes, `type` is part of the command :smiley_cat: + +Remove/delete a file: + +```sh +del index.html +``` + +Edit and save a file, using a command-line utility provided by your preferred text editor (just choose one of these, depending on which editor you're using): + +```sh +code my_message.txt # VS Code text editor, may first require installation of shell commands from the settings +atom my_message.txt # Atom text editor, may first require installation of shell commands from the settings +``` + +Print file contents: + +```sh +type my_message.txt +``` + +Move a file to target location: + +```sh +move C:\Users\YOUR_USERNAME\Desktop\my_folder\my_message.txt C:\Users\YOUR_USERNAME\Desktop +``` + +> FYI: If you are into maximum efficiency, press "tab" to auto-complete file paths so you don't have to type the whole thing. :smiley_cat: + +Copy a file: + +```sh +xcopy C:\Users\YOUR_USERNAME\Desktop\my_message.txt C:\Users\YOUR_USERNAME\Desktop\my_folder +``` + +Copy contents of a file into the clipboard for pasting: + +```sh +type C:\Users\YOUR_USERNAME\Desktop\my_folder\my_message.txt | clip +# ... then just paste as you normally would after copying some text +``` + +### Further Exploration + +Optionally explore additional command-line interfaces, if you're curious. + +#### Internet Computing + +Trace the route traveled by a network request: + +```sh +tracert google.com # stop after a few seconds if necessary by pressing: control + c +``` + +Time the duration of a network request: + +```sh +ping google.com # stop after a few seconds if necessary by pressing: control + c +``` + +Download the [cURL](https://curl.haxx.se/download.html) utility if necessary, then request the contents of a webpage: + +```sh +curl google.com +curl http://www.google.com +curl https://raw.githubusercontent.com/prof-rossetti/intro-to-python/master/data/products.json +``` + +You may need to execute these commands from within the downloaded directory. See ["Installing cURL on Windows"](http://stackoverflow.com/questions/9507353/how-do-i-install-set-up-and-use-curl-on-a-windows) for more support. diff --git a/docs/exercises/hello-python/index.qmd b/docs/exercises/hello-python/index.qmd new file mode 100644 index 0000000..16f0fb2 --- /dev/null +++ b/docs/exercises/hello-python/index.qmd @@ -0,0 +1,58 @@ +# "Hello Python" Exercise + +In this exercise, we'll practice using the local development environment to create, edit, and execute a simple Python program. + +## Instructions + +### Python Shell + +First we will explore the Python shell, which will be able to execute single expressions of Python code. We might use the Python interpreter in practice to quickly test out short snippets of code. + +Open an interactive Python interpreter: + +```sh +python -i +``` + +You will be able to execute Python expressions, such as the following: + +```python +x = 2 + 2 + +print(x) +``` + +Press enter after each expression. + +When done, type `exit()` and press enter to quit the interpreter, and return to the command line. + +### Python Scripts + +Some limitations of the Python interpreter are that it is harder to execute multi-line expressions, and after we quit the interpreter the code we wrote is lost. + +In order to write longer Python programs, and save some code for later, we will use a Python script. A Python script is a text file containing Python code, where the file extension is ".py". + +Exercise: + + 1. Use your text editor to create and save a new file on the Desktop called "my_script.py". + 2. Use your text editor to write some Python code (like the example code below) in the file. Remember to save the file (anytime before running)! + 1. From your command-line application, ensure your Anaconda "base" environment is active. + 2. From your command-line application, execute the file (`python ~/Desktop/my_script.py`) to see its output. + + +Example Python code: + +```{python} +# this is the "my_script.py" file located on the Desktop... + +# this is a comment + +print("HELLO WORLD!") + +x = 2 + 2 +print(x) +``` + +## Success Criteria + +Once you see the printed messages in your command-line application, you have succeeded. Edit the file (by changing the message or the numbers), save it again, and run it again. diff --git a/docs/exercises/run-the-app/index.qmd b/docs/exercises/run-the-app/index.qmd new file mode 100644 index 0000000..6d1cc0b --- /dev/null +++ b/docs/exercises/run-the-app/index.qmd @@ -0,0 +1,32 @@ + +# "Run the App" Exercise (Tic Tac Toe) + +In this exercise, we'll practice downloading, configuring, and running an existing Python application. + +We'll discuss topics related to command line computing, Anaconda virtual environments, Python package management, and environment variables. + +## Instructions + + 1. Visit this ["Tic Tac Toe" repository](https://github.com/s2t2/tic-tac-toe-py) on GitHub. This repository contains a simple command-line game. We'll refer to this repository as the "upstream" remote repository. + 2. Click the "Fork" button (top right of the page) to make a copy of the repo under your own control. We'll refer to your forked copy as the "origin" remote repository. + 3. Follow the instructions in the repository's "README.md" file to install, setup and run the Python code contained inside: + 1. Click the green button on GitHub to "Clone", or download, your remote fork. Choose the GitHub Desktop option, selecting the "for my own purposes" option, if prompted by GitHub Desktop. When prompted where to download it, choose a familiar location like the Desktop. We'll refer to this as the "local repository". + 2. Use the finder or file explorer to verify you have downloaded the files and they exist, for example on your Desktop. + 3. Use the command-line to navigate to the local repository (using one or more `cd` commands). + 4. Use the `conda` utility to create a new virtual environment with the specified version of Python, then activate the virtual environment. + 5. Use the `pip` utility to install any required third-party packages specified in the repo's "requirements.txt" file. + 6. Use the `python` utility to run the Python file(s) as described in the README's "Usage" section. + +## Success Criteria + +Once you have played a single game, you will have succeeded. + +For fun, try replaying the game against different kinds of opponents (computer, human, etc.). + +## Further Exploration + +Optionally simulate many games between computer players, and see the CSV file of game outcomes that gets produced. + +Practice passing environment variables to customize the game count and player types. + +## [Troubleshooting & Help](./troubleshooting.qmd) diff --git a/docs/exercises/run-the-app/troubleshooting.qmd b/docs/exercises/run-the-app/troubleshooting.qmd new file mode 100644 index 0000000..ad43d4a --- /dev/null +++ b/docs/exercises/run-the-app/troubleshooting.qmd @@ -0,0 +1,20 @@ + +# Troubleshooting Python Applications + +Here are some common errors you may run into while trying to run Python apps locally. + +## Bad Anaconda Installation + +If you try to run a `conda` command, and you see an error like **"conda: command not found"**, it means there's something wrong with your installation. + +It's OK. Feel free to reach out to an instructor and ask for help. See also these [known troubleshooting remedies](https://github.com/prof-rossetti/intro-to-python/issues/13). + +We will probably have to ask `where anaconda` in the Anaconda Prompt program to learn where your Anaconda installation resides, then issue a corresponding command like `~/anaconda3/Scripts/conda init bash` in Git Bash to fix the issue. Then close and re-open Git Bash for the changes to take effect. + +## Can't Install Packages / Forgot to Navigate to the Local Repo + +If the `pip install -r requirements.txt` command throws an error like **"Could not open requirements file: [Errno 2] No such file or directory"**, make sure you are running it from the repository's root directory, where the "requirements.txt" file exists (see the initial `cd` step to navigate into the repository's root directory). + +## Forgot to Install Packages + +If you see an error like **"ModuleNotFoundError: No module named '...'"**, it's because the given package isn't installed, so run the `pip install -r requirements.txt` command from the repository's root directory to ensure that package has been installed into the virtual environment, before trying to run the app again. diff --git a/docs/index.qmd b/docs/index.qmd new file mode 100644 index 0000000..1eb4c10 --- /dev/null +++ b/docs/index.qmd @@ -0,0 +1,42 @@ + +:::{.content-hidden when-format="html" when-page="index"} +# Local Development Tools for Python Programming +::: + +Install and configure tools to help you manage and develop Python programs like a professional. Attendees will become familiar with development tools such as a text editor and command line application. + +## Learning Objectives + +1. Utilize local development tools to write and execute Python code for research and software development. +2. Use GitHub Desktop software to download existing Python repositories from GitHub. +3. Use a text editor to read, write, and save files of Python code. +4. Create and manage virtual environments using Anaconda. +5. Manage package installations effectively using Pip within a virtual environment, and practice using a requirements file to list package dependencies for a given project. +6. Run Python programs on your computer. +7. Discuss security measures needed to protect secret credentials used by research and application code. + +## Prerequisites + +This workshop requires the following software: + ++ GitHub Desktop (requires a GitHub account) ++ VS Code Text Editor ++ Anaconda, Python, and Pip ++ Command Line Application (Terminal on Mac, Git Bash on Windows) + +If you have never worked with these tools before, we will walk you through how to install them. Just follow the [Local Development Environment Setup Guide](./prereqs/local-dev-setup/index.qmd). We will use a "Full Setup" for the exercises in this workshop. + +## Agenda + ++ 0:00 - Welcome and Announcements: + + Make sure you have already installed the prerequisite software before the workshop. It may take a few hours, so get started early, like a few days in advance. ++ 0:05 - Installation Support: + + If anyone ran into issues installing the prerequisite software, we will take a few moments to help provide troubleshooting support, before moving on to the exercises. ++ 0:20 - ["Command Line Computing" Exercise](./exercises/command-line-computing/index.qmd): + + Get comfortable navigating the filesystem using `cd` commands. ++ 0:35 - ["Hello Python" Exercise](./exercises/hello-python/index.qmd): + + Write some code in a Python script, save it, and run it from the command line. ++ 0:50 - Break / Installation Support ++ 0:60 - ["Run the App (Tic Tac Toe)" Exercise](./exercises/run-the-app/index.qmd): + + Download an existing Python app from GitHub, setup a virtual environment to satisfy the application's dependencies, and run the application from the command line. ++ 0:90 - Stop diff --git a/docs/notes/clis/brew.qmd b/docs/notes/clis/brew.qmd new file mode 100644 index 0000000..30c2487 --- /dev/null +++ b/docs/notes/clis/brew.qmd @@ -0,0 +1,41 @@ +# The `brew` Utility (Mac OS) + +[Homebrew](https://brew.sh/) is a command-line utility which makes it easy to install programs on Mac OS. + +## Detection + +Check to see if Homebrew is installed: + +```sh +which brew +``` + +## Installation + +Install Homebrew if necessary: + +```sh +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +``` + +> FYI: during the installation process you might also need to install "Xcode Developer Tools" (using the provided `xcode-select` command when prompted to do so). + +## Usage + +List installed programs: + +```sh +brew list +``` + +Installing programs: + +```sh +brew install my_program # where my_program is the name of the program to be installed +``` + +Uninstalling programs: + +```sh +brew uninstall my_program # where my_program is the name of the program to be installed +``` diff --git a/docs/notes/clis/conda.qmd b/docs/notes/clis/conda.qmd new file mode 100644 index 0000000..364f3ee --- /dev/null +++ b/docs/notes/clis/conda.qmd @@ -0,0 +1 @@ +# The `conda` Utility (Anaconda) diff --git a/docs/notes/clis/pip.qmd b/docs/notes/clis/pip.qmd new file mode 100644 index 0000000..799dc31 --- /dev/null +++ b/docs/notes/clis/pip.qmd @@ -0,0 +1 @@ +# The `pip` Utility diff --git a/docs/notes/clis/python.qmd b/docs/notes/clis/python.qmd new file mode 100644 index 0000000..f22b4ca --- /dev/null +++ b/docs/notes/clis/python.qmd @@ -0,0 +1 @@ +# The `python` Utility diff --git a/docs/notes/dev-tools/git-bash.qmd b/docs/notes/dev-tools/git-bash.qmd new file mode 100644 index 0000000..f4abc1e --- /dev/null +++ b/docs/notes/dev-tools/git-bash.qmd @@ -0,0 +1 @@ +# Git Bash (Windows OS) diff --git a/docs/notes/dev-tools/github-desktop.qmd b/docs/notes/dev-tools/github-desktop.qmd new file mode 100644 index 0000000..cf48606 --- /dev/null +++ b/docs/notes/dev-tools/github-desktop.qmd @@ -0,0 +1 @@ +# GitHub Desktop Software diff --git a/docs/notes/dev-tools/mac-terminal.qmd b/docs/notes/dev-tools/mac-terminal.qmd new file mode 100644 index 0000000..d1efb18 --- /dev/null +++ b/docs/notes/dev-tools/mac-terminal.qmd @@ -0,0 +1 @@ +# The Terminal (Mac OS) diff --git a/docs/notes/dev-tools/vs-code.qmd b/docs/notes/dev-tools/vs-code.qmd new file mode 100644 index 0000000..87c539d --- /dev/null +++ b/docs/notes/dev-tools/vs-code.qmd @@ -0,0 +1 @@ +# VS Code Text Editor diff --git a/docs/notes/environment-variables.qmd b/docs/notes/environment-variables.qmd new file mode 100644 index 0000000..1d535f2 --- /dev/null +++ b/docs/notes/environment-variables.qmd @@ -0,0 +1 @@ +# Environment Variables diff --git a/docs/prereqs/local-dev-setup/anaconda.qmd b/docs/prereqs/local-dev-setup/anaconda.qmd new file mode 100644 index 0000000..e244786 --- /dev/null +++ b/docs/prereqs/local-dev-setup/anaconda.qmd @@ -0,0 +1,68 @@ + +# Anaconda, Python, and Pip + +The goal is to have access to command-line tools for running Python programs and installing Python packages. + +The Python programming language evolves over time as new features are added and new versions are released. For this workshop, we'll want to be running any Python version 3.7 or greater. By default, Mac computers have a super old version of Python (2.x) we don't want to mess with, and Windows computers don't have any version of Python installed. So we'll need to install Python separately. + +Rather than install a single specific version of Python, and use that same version for all projects, sometimes different projects in a professional setting will require different minor versions of Python. So we'll use a tool called Anaconda to manage project-specific "virtual environments". Each virtual environment is like a separate work space with a different version of Python and combination of third-party Python packages installed inside. + +## Installation + +Unless it is already installed, [install Anaconda](https://www.anaconda.com/download) for either Mac or Windows. + +## Success Criteria + +If successful, you should be able to run the commands below. + + +Check what version of `conda` is installed: + +```sh +conda --version +``` + +List any existing virtual environments (hopefully you see "base"): + +```sh +conda info --envs +``` + +Create a new virtual environment, for example one called "my-first-env", with a specific version of Python: + +```sh +conda create -n my-first-env python=3.8 +``` + +Activate a virtual environment to start using it: + +```sh +conda activate my-first-env +``` + +See which version of Python and Pip are installed in the active environment: + +```sh +python --version +pip --version +``` + +List Python packages installed in the active environment: + +```sh +pip list +``` + +## Troubleshooting + +### Anaconda Initialization + +When using `conda` to activate a virtual environment for the first time, when prompted to do so, Windows Git Bash users may need to run `conda init bash`, and Mac Zsh profile users may need to run `conda init zsh`. If you do, close your command-line application and open another window for the changes to take affect, then try again. + +### Bad Anaconda Installation + +If you try to run a `conda` command, and you see an error like **"conda: command not found"**, it means there's something wrong with your installation. + +It's OK. Feel free to reach out to an instructor and ask for help. See also these [known troubleshooting remedies](https://github.com/prof-rossetti/intro-to-python/issues/13). + +We will probably have to ask `where anaconda` in the Anaconda Prompt program to learn where your Anaconda installation resides, then issue a corresponding command like `~/anaconda3/Scripts/conda init bash` in Git Bash to fix the issue. Then close and re-open Git Bash for the changes to take effect. diff --git a/docs/prereqs/local-dev-setup/git-client.qmd b/docs/prereqs/local-dev-setup/git-client.qmd new file mode 100644 index 0000000..cf4e19f --- /dev/null +++ b/docs/prereqs/local-dev-setup/git-client.qmd @@ -0,0 +1,41 @@ + +# Version Control Utilities + +The goal of a "version control" tool is to help us track changes in our code, and easily interface with code hosting and collaboration platforms like GitHub. + +Git is a leading system for performing version control. Professionals may prefer to use Git from the command line, but there is a learning curve. So beginners are encouraged to get started with GitHub Desktop first, which provides an easier to use graphical user interface (GUI). + +In this workshop we will use GitHub Desktop to download repositories from GitHub. We will revisit command-line Git in a future workshop. + +## GitHub Desktop + +### Installation and Configuration + +Beginners are encouraged to install [GitHub Desktop software](https://desktop.github.com/), for Mac or Windows. + +> NOTE: GitHub Desktop may require the Git command line utility to also be installed on your computer (see below). + +After installing, you will need to login with your GitHub account credentials. See this [GitHub Desktop setup guide](https://docs.github.com/en/desktop/installing-and-authenticating-to-github-desktop/setting-up-github-desktop) for more information. + +After installing, from the settings, choose VS Code as your default text editor, and either Terminal (Mac) or Git Bash (Windows) as your default command-line utility. + +### Success Criteria + +You should be able to open the GitHub Desktop application, and visit the settings to see you are logged in with your GitHub account, and also see the desired tools selected in the integration settings. + +## Git CLI + +### Installation and Configuration + +Installing Git depends on your operating system: + + + Windows users who have [installed Git Bash](./terminal.qmd) will have satisfied the Git installation requirement. + + Mac users may find that a system version of Git is already installed, and that might be sufficient to satisfy the Git installation requirement. Any Mac users who encounter errors or who desire a newer version of Git can install Git from https://git-scm.com/downloads, or consider [installing Homebrew](../../notes/clis/brew.qmd), and using Homebrew to install Git (`brew install git`). + +### Success Criteria + +Verifying Git has been installed: + +```sh +git --version +``` diff --git a/docs/prereqs/local-dev-setup/github.qmd b/docs/prereqs/local-dev-setup/github.qmd new file mode 100644 index 0000000..02e4b7e --- /dev/null +++ b/docs/prereqs/local-dev-setup/github.qmd @@ -0,0 +1,14 @@ + +# GitHub + +We'll use GitHub to manage, share, and track different versions of our software projects, called code "repositories". + +## Create Account + +Unless you already have one, take a moment to [create a GitHub account](https://github.com/). + +Afterwards, consider signing up for the [GitHub Student Developer Pack](https://education.github.com/pack), which provides some free resources. + +## Success Criteria + +If successful, when you view this (or any) repository on GitHub, you should be able to click the buttons on the top-right of the page to "Star" this repository, and also optionally "Fork" it (i.e. create a copy under your own control). diff --git a/docs/prereqs/local-dev-setup/index.qmd b/docs/prereqs/local-dev-setup/index.qmd new file mode 100644 index 0000000..29c59d6 --- /dev/null +++ b/docs/prereqs/local-dev-setup/index.qmd @@ -0,0 +1,25 @@ +# Local Development Environment Setup Guide + +This document helps you install and configure tools to develop and run Python applications on your local machine. + +For anyone interested in running Python notebook documents only, start with a "Notebook Setup". + +Otherwise, for those interested in a more professional development experience, choose the "Full Setup". + +## Option A) Notebook Setup + +Tools required for running Python notebooks locally: + + 1. [Command-line Application](./terminal.qmd) + 2. [Anaconda, Python, and Pip](./anaconda.qmd) + 3. [Jupyter Notebooks](./jupyter-notebooks.qmd) + +## Option B) Full Setup + +Tools required for running Python applications locally: + + 1. [GitHub](./github.qmd) + 2. [Text Editor](./vs-code-text-editor.qmd) + 3. [Command-line Application](./terminal.qmd) + 4. [Anaconda, Python, and Pip](./anaconda.qmd) + 5. [Version Control Tool](./git-client.qmd) diff --git a/docs/prereqs/local-dev-setup/jupyter-notebooks.qmd b/docs/prereqs/local-dev-setup/jupyter-notebooks.qmd new file mode 100644 index 0000000..91f9092 --- /dev/null +++ b/docs/prereqs/local-dev-setup/jupyter-notebooks.qmd @@ -0,0 +1,6 @@ + +## Jupyter Notebooks + +After installing Anaconda, you should be able to access Jupyter Notebooks manually via the Anaconda Navigator program, or programmatically from the command line. + +Review the professor's notes on [running Jupyer Notebooks locally](/notes/devtools/jupyter-notebooks.qmd) for more information. diff --git a/docs/prereqs/local-dev-setup/terminal-config.qmd b/docs/prereqs/local-dev-setup/terminal-config.qmd new file mode 100644 index 0000000..dea0cb5 --- /dev/null +++ b/docs/prereqs/local-dev-setup/terminal-config.qmd @@ -0,0 +1,68 @@ +# Mac Terminal Configuration + +These are some of the author's personal terminal configurations, for your reference. Feel free but not obligated to use them. + +## Theme + +[Download](http://ethanschoonover.com/solarized/files/solarized.zip) the [Solarized](http://ethanschoonover.com/solarized) color themes, and unzip. + +In Terminal Settings, import a new Profile, and choose the **solaraized/osx-terminal.app-colors-solarized/Solarized Dark ansi.terminal** theme. + +Set the Solarized Dark profile theme as default. + +Increase font size to 18. + +## Shortcuts + +Optionally further configure the profile by setting specific variables in a special configuration file. This file is called "\~/.bash_profile" for bash shell users (older Macs, Windows Git Bash), or "\~/.zshrc" for zsh shell users (newer Macs). Files beginning with a "." are generally hidden files, so to access them we'll use the text editor's shell commands: + +```sh +# Windows Git Bash, Older Macs: +code ~/.bash_profile + +# Newer Macs: +code ~/.zshrc +``` + +After opening the file in your text editor, you can place any of the following contents inside: + + +``` sh +# this is the ~/.bash_profile file or the ~/.zshrc file... + +# +# CONFIGURATIONS +# + +# control the "prompt" message that shows up in the terminal +# ... see also: https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html +export PS1=" --->> " + +# control some colors +# ... see also: https://osxdaily.com/2012/02/21/add-color-to-the-terminal-in-mac-os-x/ +export CLICOLOR=1 +export LSCOLORS=GxFxCxDxBxegedabagaced + +# +# SHORTCUTS / ALIASES +# + +# listing all files in an easier to read format: +alias ll="ls -lahG" + +# shortcuts for most common git commands: +alias gs="git status" +alias gd="git diff" +alias gl="git log" +alias gr="git remote -v" +alias gb="git branch" +alias gpom="git pull origin main" + +# hiding or showing all icons on the desktop (when in screenshare or zen modes): +alias deskhide="defaults write com.apple.finder CreateDesktop false && killall Finder" +alias deskshow="defaults write com.apple.finder CreateDesktop true && killall Finder" +``` + +> NOTE: if you see some Anaconda-related stuff in this file, leave it as-is! + +After editing the config file, save the file. You may need to close your terminal window and re-open a new one for the changes to take effect. diff --git a/docs/prereqs/local-dev-setup/terminal.qmd b/docs/prereqs/local-dev-setup/terminal.qmd new file mode 100644 index 0000000..47f9eee --- /dev/null +++ b/docs/prereqs/local-dev-setup/terminal.qmd @@ -0,0 +1,35 @@ + +# Command-line Application + +The goal is to have access to a command-line application, which we'll use to programmatically interface with our computers. + +## Installation and Configuration + +The choice of command line tool depends on your operating system: + + + Mac users who don't already have a preferred command-line application are encouraged to use the built-in Terminal application (no need to download anything, although you may want to optionally [customize the Terminal](./terminal-config.qmd) appearance as desired). + + Windows users who don't already have a preferred command-line application are encouraged to install [Git Bash](https://git-scm.com/downloads), which will allow Windows users to write the same unix-style commands as Mac users. + +## Success Criteria + +If successful, you should be able to use your command-line application to issue the commands below, which are some of the most relevant and common commands for navigating the filesystem. + +Change directories, for example to the Desktop: + +```sh +cd ~/Desktop +``` + +What is the present working directory? Where are we right now? + +```sh +pwd +``` + +List the files and folders in this place: + +```sh +ls -al +``` + +You should now also be able to use your command-line application to complete the ["Command-line Computing" Exercise](../../exercises/command-line-computing/index.qmd), which will introduce you to additional commands. diff --git a/docs/prereqs/local-dev-setup/vs-code-config.qmd b/docs/prereqs/local-dev-setup/vs-code-config.qmd new file mode 100644 index 0000000..a1999ab --- /dev/null +++ b/docs/prereqs/local-dev-setup/vs-code-config.qmd @@ -0,0 +1,209 @@ +# VS Code Text Editor + +## Installation + +[Download VS Code](https://code.visualstudio.com/Download). + +## Basic Configuration + +After you have downloaded VS Code, you'll want to take some time to familiarize yourself with its [settings](https://code.visualstudio.com/docs/getstarted/settings) and menus. + +The Command Pallette (accessible via "command + shift + p" keyboard shortcut) allows you to perform tasks using a command-based interface, and is a big time saving feature. + +The Extensions menu (accessible via "command + shift + x" keyboard shortcut) allows you to install and manage third-party extensions. + + +### Shell Commands + +Shell commands will allow us to open a VS Code window from the command line. + +On a Windows, you may not need to take any action. But on a Mac, follow [these steps](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line) to enable VS Code shell commands. + +After enabling shell commands, you should be able to use the `code` command to open files and folders from the command-line: + +```sh +# open all files and folders in the current working directory: +code . + +# open all files and folders in the specified directory, e.g. "path/to/my-project": +code path/to/my-project +``` + + +### Python Syntax Auto-completion + +Once configured, the text editor is capable of automatically completing snippets of Python code for you. This helps improve accuracy, and saves time. + +When you open a Python file in VS Code, it should prompt you to install the official Python extension (`ms-python.python`). You are recommended to install this extension to enable Python syntax auto-completion. + +### Vertical Column Selection + +If configured, your text editor can also enable vertical text selection. This comes in handy if you have to change multiple lines of text at the same time, including commenting-out many lines at once. + +By default, you should be able to achieve column selection functionality in VS Code by pressing "shift + alt" (Windows) or "shift + option" (Mac), then clicking and dragging up or down. + +![a screenshot of the text editor's column selection](https://user-images.githubusercontent.com/1328807/50870478-2e9b8400-1386-11e9-9378-0afadc4a7dce.gif) + + + + + + + + + + + + +
+ + +## Advanced Configuration + +These are some of the author's personal VS Code configurations, for your reference. Feel free but not obligated to use them. + + + +### Python Snippets + +Use the command palette and start typing "snippets" to find the "Preferences > Configure User Snippets" setting which should yield a snippets JSON file. Feel free to update yours to include any of these helpful Python snippets: + +``` +{ + // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and + // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope + // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is + // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: + // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. + // Placeholders with the same ids are connected. + // Example: + // "Print to console": { + // "scope": "javascript,typescript", + // "prefix": "log", + // "body": [ + // "console.log('$1');", + // "$2" + // ], + // "description": "Log output to console" + // } + + "Python For Loop": { + "prefix": ["for"], + "body": [ + "for item in my_list:", + " print(item)" + ], + "description": "A for loop in Python." + }, + + "Python Function Definition": { + "prefix": ["def"], + "body": [ + "def my_func():", + " pass" + ], + "description": "A function definition in Python." + }, + + "Python Class Constructor": { + "prefix": ["init", "__init", "defi"], + "body": [ + "def __init__(self):", + " pass" + ], + "description": "A class initializer method for Python." + }, + + "Python Try Block": { + "prefix": ["try"], + "body": [ + "try:", + " pass", + "except Exception as err:", + " print('OOPS', err)" + ], + "description": "A try block for error-handling in Python. Try to use the specific error class if you know it, instead of Exception." + }, + + "Python Main Conditional": { + "scope": "python", + "prefix": ["main", "__main"], + "body": [ + "if __name__ == '__main__':", + " pass" + ], + "description": "The main conditional for Python." + } +} +``` + +See also: https://code.visualstudio.com/docs/editor/userdefinedsnippets + + + + + +### Recommended Extensions + +Here is a sample of the authors's installed extensions (results from running `code --list-extensions`): + + + `mechatroner.rainbow-csv` + + `mikestead.dotenv` + + `ms-python.python` + + `sleistner.vscode-fileutils` + + `streetsidesoftware.code-spell-checker` + + `whizkydee.material-palenight-theme` + + `xamm.filepath` + + `yzhang.markdown-all-in-one` + +You might try searching these manually or [importing them programmatically](https://stackoverflow.com/a/49398449/670433) via `code --install-extension EXTENSION_NAME`, where "EXTENSION_NAME" is the extension's identifier (e.g. `code --install-extension ms-python.python`). + + +### Recommended User Settings + +Use the command palette and start typing "settings" to find the "Preferences > Open Settings (JSON)" setting which should yield a snippets JSON file. Feel free to update yours to include any of these settings overrides: + +```json +{ + "workbench.colorTheme": "Palenight Theme", + "editor.fontSize": 14, + "editor.tabSize": 4, + "files.trimTrailingWhitespace": true, + "files.insertFinalNewline": true, + "files.trimFinalNewlines": true, + "telemetry.telemetryLevel": "off", +} +``` + + +### Recommended Keyboard Shortcuts + +Use the command palette and start typing "shortcuts" to find the "Preferences > Open Keyboard Shortcuts (JSON)" setting which should yield a snippets JSON file. Feel free to update yours to include any of these keyboard shortcut overrides: + +```json +// Place your key bindings in this file to override the defaults +[ + { + "key": "cmd+\\", + "command": "workbench.action.toggleSidebarVisibility" + }, + { + "key": "cmd+b", + "command": "-workbench.action.toggleSidebarVisibility" + }, + { + "key": "shift+cmd+d", + "command": "editor.action.duplicateSelection" + }, + { + "key": "cmd+t", + "command": "workbench.action.quickOpen" + }, + { + "key": "ctrl+shift+m", + "command": "markdown-preview-enhanced.openPreview", + "when": "editorLangId == 'markdown'" + }, +] + +``` diff --git a/docs/prereqs/local-dev-setup/vs-code-text-editor.qmd b/docs/prereqs/local-dev-setup/vs-code-text-editor.qmd new file mode 100644 index 0000000..bf43111 --- /dev/null +++ b/docs/prereqs/local-dev-setup/vs-code-text-editor.qmd @@ -0,0 +1,21 @@ + + +# Text Editor + +The goal is to have access to a text-editing application of choice, which we'll use to create and edit files of Python code (i.e. text files written in the Python Language and ending in the ".py" extension). + +We'll be writing Python scripts using software called a ["text editor"](https://idrh.ku.edu/text-editors-and-word-processors). Similar to word processing software like Microsoft Word, text editors allow us to write and save documents of text. But unlike word processors, which save extra metadata (e.g. styles and formatting) along with the underling text, text editors allow us to save files comprised of just text. + +There are many text editor options out there, and it seems each developer has their own preference. Regardless of which text editor you choose, you are highly encouraged to configure it with certain plugins, packages and extensions to enhance your experience and save you time. + +## VS Code + +### Installation and Configuration + +Unless you already have a text editor of choice, install [VS Code](https://code.visualstudio.com/). + +After installing VS Code, take some time to explore the settings and available extensions. Optionally see the [VS Code Configuration Guide](./vs-code-config.qmd) for more details. + +### Success Criteria + +You should be able to open the VS Code application. diff --git a/docs/styles.css b/docs/styles.css new file mode 100644 index 0000000..08200d7 --- /dev/null +++ b/docs/styles.css @@ -0,0 +1,35 @@ +/* hide book title and tools in the sidebar + +.sidebar-title > a { + display: none; +} +*/ + +/* hide just the book title in the sidebar +.sidebar-title > a { + display: none; +} +*/ + +/* display a border on the left sidebar */ +#quarto-sidebar { + border-right: 1px solid #cccccc; +} + +/* display a top border on the footer +.footer { + border-top: 2px solid #cccccc; +} + +*/ + + +/* hide book header with redundant book title + + ... oh but this hides all page titles too hmm + +#title-block-header { + display:none; +} + +*/