class: center, middle, inverse, title-slide .title[ # BAA1030 - Data Analytics and Story Telling ] .subtitle[ ## Lecture 11: Publish your Quarto with GitHub ] .author[ ### Damien Dupré - Dublin City University ] --- # Objectives The last tool for data analytics and visualisations displayed in this lectures is called **GitHub**. GitHub has a lot of different functions. For now, we will only see how to use it to **published the html document output from Quarto**. .center[ <!-- --> ] --- # What is GitHub Primary used to collaborate on code development, it became multi-purpose: - Version Control - File and Code Storage - Collaboration - Developers Social Media - Online Publication & Website Host - Automatic Actions And even more that I am not aware of! --- # What is GitHub Primary used to collaborate on code development, it became multi-purpose: - Version Control - **File and Code Storage** - Collaboration - Developers Social Media - **Online Publication & Website Host** - Automatic Actions And even more that I am not aware of! --- class: title-slide, middle ## 🛠️ Your Turn! 1/ Go to https://github.com and click **sign up** (or **log in** if you already have an account) 2/ Fill the information requested, find a **good user name** as it will be used for your default website (e.g., `firstname-name` is usually good) 3/ Later, add a profile picture
−
+
02
:
00
--- # Welcome to GitHub <!-- --> --- class: inverse, mline, center, middle # GitHub Repository --- # How does GitHub Work? The core principle of GitHub is a remote desktop (or profile) with a folder called **Repository** for each project you are working on or you worked on (also called "Repo" if you want to use the slang). <!-- --> --- class: title-slide, middle ## 🛠️ Your Turn! Follow the steps here after to **create your first repository**. --- # GitHub Repositories [To create a Repository](https://docs.github.com/en/get-started/quickstart/create-a-repo): 1/ In the upper-right corner of any page, use the `+` drop-down menu, and select New repository. <!-- --> --- # GitHub Repositories <!-- --> --- # GitHub Repositories 2/ **Type a short, memorable name** for your repository. For example, "hello-world". <!-- -->
<i class="fas fa-exclamation-triangle faa-flash animated faa-slow " style=" color:red;"></i>
Warning: Do NOT use white space between words, snake case convention highly recommended. 3/ **Optionally**, add a description of your repository. For example, "My first repository on GitHub." --- # GitHub Repositories 4/ **Choose a PUBLIC repository visibility**. For more information, see "About repositories." 5/ Tick **Add a README file**. 6/ Click **Create repository**. ### Congratulations! You've successfully created your first repository, and initialized it with a README file. .center[ <img src="https://external-preview.redd.it/H3X9ghkU1diDoEaB2j6OLakfRVvtelkI-VVCAMvpHFw.jpg?auto=webp&s=812777b2de31ed351475ecfb9cfe91a74931201b" width="50%" /> ] --- class: inverse, mline, center, middle # GitHub Commit --- # Always Commit Changes In GitHub, a commit is a saved change to a project's source code or other files. When you make changes to a file in a GitHub repository, you create a new version of that file. **A commit contains a snapshot of the changes** you've made to one or more files, along with a message that describes the changes. This **message should be descriptive and clear**, so that other developers can understand what changes you've made and why. ### Everytime you want to take into account a change in your repository, you need to commit these changes --- class: title-slide, middle ## 🛠️ Your Turn! When you created your new repository, you initialized it with a README file. README files are a great place to describe your project in more detail, or add some documentation such as how to install or use your project. The contents of your README file are automatically shown on the front page of your repository. **Follow the steps here after to commit a change to the README file.** --- # Commit the First Change 1/ In your repository's list of files, **click README.md**. <img src="https://docs.github.com/assets/cb-44661/mw-1000/images/help/repository/create-commit-open-readme.webp" width="50%" /> --- # Commit the First Change 2/ In the upper right corner of the file view, **click the pen icon to open the file editor**. <img src="https://docs.github.com/assets/cb-90977/mw-1000/images/help/repository/edit-file-edit-button.webp" width="80%" /> 3/ In the text box, **type some information about the project**. 4/ Above the new content, click **Preview**. <img src="https://docs.github.com/assets/cb-66827/mw-1000/images/help/repository/edit-readme-preview-changes.webp" width="80%" /> --- # Commit the First Change .pull-left[ 5/ **Review the changes** you made to the file. You will see the new content in green. 6/ Click **Commit changes...** 7/ In the "Commit message" field, type a short, meaningful **commit message** that describes the change you made to the file. ] .pull-right[ <!-- --> ] 8/ Below the commit message fields, decide whether to add your commit to the current branch or to a new branch. Select **commit directly to the `main` branch** for now.
<i class="fas fa-exclamation-triangle faa-flash animated faa-slow " style=" color:red;"></i>
Warning: For collaborative projects never commit to the main branch 9/ Click **Propose file change**. --- class: title-slide, middle ## 🛠️ Your Turn! **Fill you Repository up with the `report.html` file** created when you used Quarto to render the `report.ipynb` file to html by following the steps described here after: 1/ In your Repository Page in GitHub, Click **Add files** then **Upload files** 2/ **Drop your `report.html` file** in the main box and **commit your changes**
−
+
02
:
00
--- class: inverse, mline, center, middle # GitHub Pages --- # GitHub Pages GitHub Pages is a **web hosting service** offered by GitHub that allows you to host static websites directly from a GitHub repository. This means you can use GitHub to store and version control your website's code, and then host it for free using GitHub Pages. GitHub Pages supports several **different types of websites, including personal or project pages**, documentation, blogs, and more. You can use custom domains or subdomains for your website, and GitHub Pages also supports HTTPS encryption for secure communication. To create a GitHub Pages website, you need to have a GitHub account and a **repository containing your website's HTML, CSS, and other files**. Once you've created your repository and pushed your website's files to it, you can **enable GitHub Pages in the repository settings**. Your website will then be published at a URL based on your GitHub username and repository name (e.g., username.github.io/repository). --- # GitHub Pages <!-- --> --- class: title-slide, middle ## 🛠️ Your Turn! Turn on GitHub Pages for your project repository: 1/ Go to **Settings** and find **Pages** on the left pane 2/ In **Branch**, instead of None select **Main** and click **Save** 3/ Click on **Actions** and wait that "pages build and deployment" finishes. When it's done, go to **https://username.github.io/repository/report**
−
+
03
:
00
--- # GitHub Pages URL By default, your html report will be published at: **https://username.github.io/repository/report** If: - Your GitHub username is **damien-dupre** - Your Repository name is **data-analytics** - Your Project folder name is **project** - Your html file name is **report.html** Then, you report will be published at: **https://damien-dupre.github.io/data-analytics/project/report** --- # GitHub Pages URL
<i class="fas fa-exclamation-triangle faa-flash animated faa-slow " style=" color:red;"></i>
Warning: Do NOT use white space between words, snake case convention highly recommended. If you use a white space in any of the Repository name, Project folder name, or html file name then this white space will be replaced by the symbol **%20** For example, a Repository name called **data analytics** will have the following URL: **https://damien-dupre.github.io/data%20analytics/project/report** --- # GitHub Pages URL There are two special cases to consider with URLs: 1/ If your html file name is **index.html**, then your file URL will be: **https://damien-dupre.github.io/data-analytics/project** 2/ If your Repository name is **username.github.io** (e.g., damien-dupre.github.io), then your file URL will be: **https://damien-dupre.github.io/project/report** --- # GitHub Pages URL Both shortcut could be used to display a document at: **https://username.github.io** If: - Your GitHub username is **damien-dupre** - Your Repository name is **damien-dupre.github.io** - Your html file name is **index.html** Then your report will be published at th URL: **https://damien-dupre.github.io** --- class: inverse, mline, center, middle # Assignment 2 Brief --- # Assignment Instructions ### Context You are Data Analyst for the UNICEF organisation, an you have been asked to design a report to raise awareness of the public on a specific world issue. ### Task Using the files that you already have received by email (i.e., one or both **unicef_indicator_1.csv** and **unicef_indicator_2.csv** files as well as **unicef_metadata.csv** file), **create an html report that contains a story** (i.e., narrative) **and some visualisations** to support this story. This html report must be **rendered by Quarto** and **published with GitHub Pages**. ### Story You can copy-paste the exact same text included in your Tableau Dashboard assignment. You can also modify it or write a new one if you prefer. This story has to __use text emphasis styles__ (e.g., title levels, italic/bold font, list and bullet points, ...). --- # Assignment Instructions .pull-left[ ### Visualisations They will have to be created with ggplot2. You need to __include 4 visualisations__: - A World Map chart, - A bar chart, - A scatterplot with a regression line, - A time-series chart. ] .pull-right[ ### HTML Output The report must contain a YAML text cell with, **at least**, the following code: ```yaml --- format: html: embed-resources: true code-fold: true --- ``` ] More specifications of the YAML, the addition of a HTML theme, full customisation of the visualisations and the use of hashpipe options in the code cells will be positively assessed. --- # Assignment Instructions ## Submission Submit the **URL of your html report** published with GitHub Pages AND the link to your `report.ipynb` file from your Google Drive on the **BAA1030 Loop page** by **April 13th, 1pm**. ## Assessment Criteria - Overall Code (25%) - Data Transformations (25%) - Visualisation Design (25%) - HTML Output (25%) See criteria quality grid for a description of expected submissions. --- class: inverse, mline, left, middle <img class="circle" src="https://github.com/damien-dupre.png" width="250px"/> # Thanks for your attention and don't hesitate to ask if you have any question! [
@damien-dupre](http://github.com/damien-dupre) [
https://damien-dupre.github.io](https://damien-dupre.github.io) [
damien.dupre@dcu.ie](mailto:damien.dupre@dcu.ie)