├── src ├── assets │ ├── styles │ │ ├── sidebar.css │ │ ├── newdefault.css │ │ ├── lecture_header.css │ │ ├── layout.css │ │ ├── homepage.css │ │ └── index.css │ ├── cute-one.png │ ├── favicon.ico │ ├── staytuned.png │ ├── homepage │ │ ├── bg.afdesign │ │ ├── swoosh.png │ │ └── bg.svg │ ├── MIT_logo.svg │ ├── scripts │ │ ├── sidebar.js │ │ └── search.js │ ├── favicon.svg │ ├── mitx_logo.svg │ ├── discord_logo.svg │ ├── piazza_logo.svg │ ├── julia-logo-color.svg │ ├── julia-logo-dark.svg │ └── zoom_logo.svg ├── images_abstractions │ ├── .gitignore │ ├── notes.pptx │ └── linear_transformation.jl ├── structure.md ├── index.jlmd ├── _includes │ ├── md.jlmd │ ├── layout.jlhtml │ └── welcome.md ├── data_science │ └── testCSVwrite.csv ├── clips.md ├── sidebar data.jl ├── search.md ├── cheatsheets.md ├── semesters.md ├── pluto_export_configuration.json ├── logistics.md ├── reviews.md ├── installation.md ├── week0 │ └── basic_syntax.jl ├── climate_science │ └── resistors_and_stencils.jl └── homework │ └── hw0.jl ├── extra_outputs ├── CNAME └── index.html ├── .gitattributes ├── netlify.toml ├── Procfile ├── .gitignore ├── develop.jl ├── LICENSE.md ├── .vscode ├── tasks.json ├── extensions.json └── settings.json ├── tools └── update_notebook_packages.jl ├── pluto-deployment-environment ├── Project.toml └── PlutoDeployment.toml ├── .github └── workflows │ ├── KeepCacheFresh.yml │ └── ExportNotebooks.yml ├── Dockerfile ├── README.md └── Website maintenance.md /src/assets/styles/sidebar.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /extra_outputs/CNAME: -------------------------------------------------------------------------------- 1 | computationalthinking.mit.edu -------------------------------------------------------------------------------- /src/images_abstractions/.gitignore: -------------------------------------------------------------------------------- 1 | *.png 2 | *.jpg -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | page/* linguist-vendored 2 | * text=auto -------------------------------------------------------------------------------- /src/structure.md: -------------------------------------------------------------------------------- 1 | {{ plutonotebookpage ../notebooks/week4/structure.jl }} -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [[headers]] 2 | for = "/*" 3 | [headers.values] 4 | Access-Control-Allow-Origin = "*" 5 | -------------------------------------------------------------------------------- /src/assets/cute-one.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mitmath/computational-thinking/HEAD/src/assets/cute-one.png -------------------------------------------------------------------------------- /src/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mitmath/computational-thinking/HEAD/src/assets/favicon.ico -------------------------------------------------------------------------------- /src/assets/staytuned.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mitmath/computational-thinking/HEAD/src/assets/staytuned.png -------------------------------------------------------------------------------- /src/assets/homepage/bg.afdesign: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mitmath/computational-thinking/HEAD/src/assets/homepage/bg.afdesign -------------------------------------------------------------------------------- /src/assets/homepage/swoosh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mitmath/computational-thinking/HEAD/src/assets/homepage/swoosh.png -------------------------------------------------------------------------------- /src/index.jlmd: -------------------------------------------------------------------------------- 1 | --- 2 | authors: ["Massachusetts Institute of Technology"] 3 | tags: ["homepage"] 4 | layout: "welcome.md" 5 | --- 6 | -------------------------------------------------------------------------------- /src/images_abstractions/notes.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mitmath/computational-thinking/HEAD/src/images_abstractions/notes.pptx -------------------------------------------------------------------------------- /src/_includes/md.jlmd: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "layout.jlhtml" 3 | --- 4 | 5 |
Go to course website :balloon:
4 | 5 | Welcome to **MIT 18.C25 aka 6.C25**, **Fall 2024** edition! 6 | _For older semesters, see: 7 | - Fall 2023: [source code](https://github.com/mitmath/18S191/tree/Fall23) and [website](https://computationalthinking.mit.edu/Fall24/semesters/) 8 | - Fall 2022: [source code](https://github.com/mitmath/18S191/tree/Fall22) and [website](https://computationalthinking.mit.edu/Fall24/semesters/) 9 | - Spring 2021: [source code](https://github.com/mitmath/18S191/tree/Fall24) and [website](https://computationalthinking.mit.edu/Fall24/semesters/) 10 | - Fall 2020: [source code](https://github.com/mitmath/18S191/tree/Fall20) and [website](https://computationalthinking.mit.edu/Fall24/semesters/) 11 | - Spring 2020: [website](https://computationalthinking.mit.edu/Fall24/semesters/) 12 | - Fall 2019: [source code](https://github.com/dpsanders/6.S083_fall_2019/tree/fall_2019) 13 | 14 | This is an introductory course on Computational Thinking. We use the [Julia programming language](http://www.julialang.org) to approach real-world problems in varied areas applying data analysis and computational and mathematical modeling. In this class you will learn computer science, software, algorithms, applications, and mathematics as an integrated whole. 15 | 16 | Topics include: 17 | 18 | - Image analysis 19 | - Machine Learning 20 | - Network theory 21 | - Climate modeling 22 | 23 | # Go to [computationalthinking.mit.edu](https://computationalthinking.mit.edu/) to learn more! 24 | -------------------------------------------------------------------------------- /src/assets/mitx_logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 30 | -------------------------------------------------------------------------------- /src/assets/discord_logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 25 | -------------------------------------------------------------------------------- /src/logistics.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Class logistics" 3 | tags: ["welcome"] 4 | order: 3 5 | layout: "md.jlmd" 6 | --- 7 | 8 | 14 | 15 | # Course logistics 16 | 17 | [](https://discord.gg/Z5qnVf8) 18 | 19 | ### MIT Students Only 20 | [](https://zoom.us/j/96183959527) 21 | [](https://piazza.com/mit/spring2021/6s083) 22 | [](https://canvas.mit.edu/courses/7590) 23 | [](https://lms.mitx.mit.edu/courses/course-v1:MITx+6.S083r+2021_Spring/course/) 24 | 25 | > **Suggestion**: Bookmark this page for easy access to everything you need to follow this class! 26 | 27 | Counts as 6.0001 and 6.0002 credit, or can be taken in addition. Counts as a course 28 | 6 elective. 29 | 30 | Course materials will be published on this website on **Monday 1:00pm**. Each week is a new _chapter_, which includes: 31 | 32 | - Asynchronous video lectures _(total 60 minutes)_ 33 | - Interactive visualizations 34 | - Exercises 35 | 36 | ## Live lectures 37 | 38 | On **Monday 1:00pm - 2:30pm**, after the material is published, there will also be: 39 | 40 | - Q&A on Discord 41 | - Live overview lecture _(30 minutes)_ 42 | 43 | On **Wednesday 1:00pm 2:30pm** _(MIT students only)_, you will meet with fellow students and your TA to: 44 | 45 | - Review the lecture 46 | - Work on problem sets in small groups or individually, with the opportunity to ask questions to your TA 47 | 48 | Start date: February 16, 2021 49 | 50 | ## Discussion forum and homework submission 51 | 52 | - [Discord](https://discord.gg/Z5qnVf8): discussion (we encourage you to hang out here during class!) 53 | 54 | - MIT Only: [Canvas](https://canvas.mit.edu/courses/7590): Homework submissions, Piazza Link. If you're a non-MIT student, don't worry, the **homework has built-in answers checks**, or you can find a partner to cross-grade homeworks via Discord. 55 | 56 | ## Evaluation 57 | 58 | The final grade is 80% problem sets, and 20% MITx _quick questions_. 59 | 60 | - Problem sets are released on Friday and due the following Friday by 11:59pm EST. They have equal weight; your lowest score will be dropped. 61 | 62 | - [MITx](https://lms.mitx.mit.edu/courses/course-v1:MITx+6.S083r+2021_Spring/course/) exercises (_quick questions_) are due before Wednesday (11:59pm), but are best done on Monday, during or right after the lectures. 63 | -------------------------------------------------------------------------------- /.github/workflows/ExportNotebooks.yml: -------------------------------------------------------------------------------- 1 | name: Fall 24 - Export Pluto notebooks & Deploy 2 | on: 3 | push: 4 | branches: 5 | - Fall24 6 | workflow_dispatch: 7 | concurrency: 8 | group: export 9 | cancel-in-progress: true 10 | 11 | jobs: 12 | build-and-deploy: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout Fall 24 source 16 | uses: actions/checkout@v5 17 | 18 | - name: 🙌 Install Julia 19 | uses: julia-actions/setup-julia@v2 20 | with: 21 | version: "1.10.4" 22 | 23 | - name: ⏱ Cache notebook states 24 | uses: actions/cache@v4 25 | with: 26 | path: _cache 27 | key: ${{ runner.os }}-pluto_state_cache-v3-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}-${{ github.run_id }} 28 | restore-keys: | 29 | ${{ runner.os }}-pluto_state_cache-v3-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }} 30 | 31 | - name: ⏱ Cache .julia 32 | uses: actions/cache@v4 33 | with: 34 | path: ~/.julia 35 | key: ${{ runner.os }}-dotjulia-v1-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}-${{ github.run_id }} 36 | restore-keys: | 37 | ${{ runner.os }}-dotjulia-v1-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }} 38 | 39 | - name: 📅 Checkout Fall20, Spring21, Fall22, Fall23 output 40 | uses: actions/checkout@v4 41 | with: 42 | path: Fall23-output 43 | ref: Fall23-output 44 | 45 | - name: 🪴 Generate site 46 | run: | 47 | julia --project=pluto-deployment-environment -e ' 48 | import Pkg 49 | Pkg.instantiate() 50 | import PlutoPages 51 | 52 | PlutoPages.generate("."; html_report_path="generation_report.html") 53 | 54 | cp("./netlify.toml", "./_site/netlify.toml")' 55 | env: 56 | JULIA_PKG_SERVER: "" 57 | 58 | 59 | - name: 📰 Upload site generation report 60 | uses: actions/upload-artifact@v4 61 | if: always() 62 | with: 63 | path: generation_report.html 64 | 65 | - name: 🔀 Combine semesters into single site 66 | run: | 67 | mkdir www 68 | mv Fall23-output/Fall20/ www/Fall20 69 | mv Fall23-output/Spring21/ www/Spring21 70 | mv Fall23-output/Fall22/ www/Fall22 71 | mv Fall23-output/Fall23/ www/Fall23 72 | mv _site www/Fall24 73 | mv extra_outputs/* www 74 | 75 | - name: 🚀 Deploy to GitHub Pages 76 | uses: JamesIves/github-pages-deploy-action@v4 77 | with: 78 | token: ${{ secrets.GITHUB_TOKEN }} 79 | branch: Fall24-output 80 | folder: www 81 | -------------------------------------------------------------------------------- /src/reviews.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Class reviews" 3 | tags: ["welcome"] 4 | order: 2.2123 5 | layout: "md.jlmd" 6 | --- 7 | 8 | 9 | # Student feedback 10 | 11 | 12 |The Introduction to Computational Thinking with Julia class is a welcome departure from the paradigm of teaching the canonical computer science examples such as sorting algorithms and graph search that are often overused in introductory curricula.
The class delves into real-world applications from the very beginning in a way that gives students an opportunity to be excited about the possibilities of computer science and mathematical modelling all while learning how to harness the power and elegance of the modern language of Julia.
"), 20 | ), 21 | ( 22 | "Class Feedback", 23 | "Spring 2020", 24 | @htl("This is one of the best classes I have ever taken. I like how the content is divided into four main real-world applications of computational thinking, which made learning very enjoyable and also made working with Julia easier for me.
I also found it amazing that this class provided applications of topics in differential equations and linear algebra classes and added a new way to view them. Unfortunately, I haven't found a similar class on computational thinking for the spring as the skills I gain are very practical and needed in research (I was impressed by the number of MISTI research opportunities that asked for experience with agent-based modeling or modeling in general.)
"), 25 | ), 26 | ( 27 | "Website Feedback", 28 | "Spring 2020", 29 | @htl("The class website made the class lectures and homework easy to find in addition to the GitHub page and canvas. - The Discord channel and Piazza also made it easier to ask questions and see other students' questions and comments. - The feedback for assignments was very clear, and the instructors were willing to explain my mistakes further by email.
"), 30 | ), 31 | ( 32 | "Lecture Feedback", 33 | "Spring 2020", 34 | @htl("The synchronous lectures were very comfortable, and the instructors encouraged us to ask questions.
"), 35 | ) 36 | ] 37 | 38 | [ 39 | @htl(""" 40 |MIT's Free Online Course to Learn Julia — The Rising Star — Review of 18.S191 by Towards AI Newsletter59 | 60 |
61 | 62 |the course is exceptional🎇🎇🎇
— YT Cai (@Yitao_CAI) December 15, 2020
63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/assets/homepage/bg.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Website maintenance.md: -------------------------------------------------------------------------------- 1 | # Website maintenance 2 | 3 | This document describes how the website works. 4 | 5 | # Overview 6 | 7 | This is the source code for the computational thinking website! It uses a site generation system inspired by [https://www.11ty.dev/](https://www.11ty.dev/), but there are only three template systems: 8 | - **`.jlhtml` files** are rendered by [HypertextLiteral.jl](https://github.com/JuliaPluto/HypertextLiteral.jl) 9 | - **`.jlmd` files** are rendered by [MarkdownLiteral.jl](https://github.com/JuliaPluto/MarkdownLiteral.jl) 10 | - **`.jl` files** are rendered by [PlutoSliderServer.jl](https://github.com/JuliaPluto/PlutoSliderServer.jl) 11 | 12 | The `/src/` folder is scanned for files, and all files are turned into HTML pages. 13 | 14 | Paths correspond to URLs. For example, `src/data_science/pca.jl` will become available at `https://computationalthinking.mit.edu/data_science/pca/`. For files called *"index"*, the URL will point to its parent, e.g. `src/docs/index.jlmd` becomes `https://computationalthinking.mit.edu/docs/`. Remember that changing URLs is very bad! You can't share this site with your friends if the links break. 15 | 16 | > **To add something to our website, just create a new file!** Fons will be happy to figure out the technical bits. 17 | 18 | You can generate & preview the website locally (more on this later), and we have a github action generating the website when we push to the `Fall23` branch. The result (in the `Fall23-output` branch) is deployed with GitHub Pages. 19 | 20 | # Content 21 | 22 | ## Literal templates 23 | We use *Julia* as our templating system! Because we use HypertextLiteral and MarkdownLiteral, you can write regular Markdown files and HTML files, but you can also include `$(interpolation)` to spice up your documents! For example: 24 | 25 | ```markdown 26 | # Hey there! 27 | 28 | This is some *text*. Here is a very big number: $(1 + 1). 29 | ``` 30 | 31 | Besides small inline values, you can also write big code blocks, with `$(begin ... end)`, and you can output HTML. Take a look at some of our files to learn more! 32 | 33 | ## Pluto notebooks 34 | 35 | Pluto notebooks will be rendered to HTML and included in the page. What you see is what you get! 36 | 37 | On a separate system, we are running a PlutoSliderServer that is synchronized to the `Fall23` brach. This makes our notebooks interactive! 38 | 39 | Notebook outputs are **cached** (for a long time) by the file hash. This means that a notebook file will only ever run once, which makes it much faster to work on the website. If you need to re-run your notebook, add a space somewhere in the code :) 40 | 41 | ## `.css`, `.html`, `.gif`, etc 42 | 43 | Web assets go through the system unchanged. 44 | 45 | # Front matter 46 | 47 | Like many SSG systems, we use [*front matter*](https://www.11ty.dev/docs/data-frontmatter/) to add metadata to pages. In `.jlmd` files, this is done with a front matter block, e.g.: 48 | ```markdown 49 | --- 50 | title: "🌼 How to install" 51 | description: "Instructions to install Pluto.jl" 52 | tags: ["docs", "introduction"] 53 | layout: "md.jlmd" 54 | --- 55 | 56 | # Let's install Pluto 57 | 58 | here is how you do it 59 | ``` 60 | 61 | Every page **should probably** include: 62 | - *`title`*: Will be used in the sidebar, on Google, in the window header, and on social media. 63 | - *`description`*: Will be used on hover, on Google, and on social media. 64 | - *`tags`*: List of *tags* that are used to create collections out of pages. Our sidebar uses collections to know which pages to list. (more details in `sidebar data.jl`) 65 | - *`layout`*: The name of a layout file in `src/_includes`. For basic Markdown or HTML, you probably want `md.jlmd`. For Pluto, you should use `layout.jlhtml`. 66 | 67 | ## How to write front matter 68 | For `.jlmd` files, see the example above. 69 | 70 | For `.jl` notebooks, use the [Frontmatter GUI](https://github.com/fonsp/Pluto.jl/pull/2104) built into Pluto. 71 | 72 | For `.jlhtml`, we still need to figure something out 😄. 73 | 74 | # Running locally 75 | 76 | ## Developing *content, styles, etc.* 77 | 78 | Open this repository in VS Code, and install the recommended extensions. 79 | 80 | To start running the development server, open the VS Code *command palette* (press `Cmd+Shift+P`), and search for **`Tasks: Run Task`**, then **`PlutoPages: run development server`**. The first run can take some time, as it builds up the notebook outputs cache. Leave it running. 81 | 82 | This will start two things in parallel: the PlutoPages.jl development server (which generates the static website), and a static file server (with LiveServer.jl). It will open two tabs in your browser: one is the generation dashboard (PlutoPages.jl), the other is the current site preview (LiveServer.jl). 83 | 84 | Whenever you edit a file, PlutoPages will automatically regenerate! Refresh your browser tab. If it does not pick up the change, go to the generation dashboard and click the "Read input files again" button. 85 | 86 | This workflow is recommended for writing static content, styles, and for site maintenance. But for writing Pluto notebooks, it's best to prepare the notebook first, and then run the site (because it re-runs the entire notebook on any change). 87 | -------------------------------------------------------------------------------- /src/assets/piazza_logo.svg: -------------------------------------------------------------------------------- 1 | 24 | -------------------------------------------------------------------------------- /src/assets/styles/layout.css: -------------------------------------------------------------------------------- 1 | /* COLOR */ 2 | 3 | #pages-layout { 4 | /* --bg-color: set by pluto */ 5 | --sidebar-bg: #fafafa; 6 | --sidebar-color: rgb(82, 82, 82); 7 | --sidebar-li-active-bg: rgb(235, 235, 235); 8 | --sidebar-li-hover-bg: rgb(247, 240, 190); 9 | } 10 | @media (prefers-color-scheme: dark) { 11 | #pages-layout { 12 | --sidebar-bg: #303030; 13 | --sidebar-color: rgb(255, 255, 255); 14 | --sidebar-li-active-bg: rgb(82, 82, 82); 15 | --sidebar-li-hover-bg: rgb(108, 94, 70); 16 | } 17 | } 18 | 19 | /* LAYOUT */ 20 | 21 | #pages-layout { 22 | display: flex; 23 | flex-direction: row; 24 | min-height: 100vh; 25 | align-items: stretch; 26 | } 27 | 28 | #pages-sidebar { 29 | font-family: system-ui, sans-serif; 30 | flex: 0 0 auto; 31 | width: 15rem; 32 | font-weight: 400; 33 | z-index: 1900; 34 | } 35 | 36 | #pages-content { 37 | display: block; 38 | flex: 1 1 auto; 39 | min-width: 0; 40 | } 41 | 42 | #pages-sidebar > div { 43 | margin: 1rem; 44 | margin-right: 0; 45 | padding: 0.5rem; 46 | /* padding-bottom: 2rem; */ 47 | border-radius: 1rem; 48 | background: var(--sidebar-bg); 49 | color: var(--sidebar-color); 50 | } 51 | 52 | #toggle-nav { 53 | display: none; 54 | cursor: pointer; 55 | } 56 | 57 | /* SIDEBAR COLLAPSING */ 58 | 59 | #pages-content::after { 60 | content: ""; 61 | z-index: 23400; 62 | touch-action: none; 63 | pointer-events: none; 64 | position: fixed; 65 | top: 0; 66 | left: 0; 67 | right: 0; 68 | bottom: 0; 69 | transition: background-color 0.2s ease-out; 70 | } 71 | 72 | @media screen and (max-width: 768px) { 73 | #pages-layout { 74 | flex-direction: column; 75 | } 76 | #toggle-nav { 77 | display: inline-flex; 78 | align-self: start; 79 | border: none; 80 | background: none; 81 | } 82 | #toggle-nav::after { 83 | --size: 40px; 84 | content: " "; 85 | display: inline-block; 86 | width: var(--size); 87 | height: var(--size); 88 | background-image: url(https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/menu-outline.svg); 89 | background-size: var(--size) var(--size); 90 | filter: var(--image-filters); 91 | } 92 | #pages-sidebar { 93 | position: fixed; 94 | top: 0; 95 | bottom: 0; 96 | right: 100%; 97 | overflow-y: auto; 98 | transition: transform 300ms cubic-bezier(0.18, 0.89, 0.45, 1.12); 99 | } 100 | @media (prefers-reduced-motion) { 101 | #pages-sidebar { 102 | transition: none; 103 | } 104 | } 105 | 106 | .pages_show_sidebar #pages-sidebar { 107 | transform: translateX(100%); 108 | z-index: 23401; 109 | } 110 | .pages_show_sidebar #pages-content::after { 111 | display: block; 112 | background-color: rgba(0, 0, 0, 0.5); 113 | } 114 | } 115 | 116 | /* SIDEBAR */ 117 | 118 | #pages-sidebar { 119 | --child-padding: 0.2em 0.6em; 120 | --border-radius: 0.5em; 121 | } 122 | 123 | #pages-sidebar > div > ul { 124 | margin-block-start: 0px; 125 | margin-block-end: 0px; 126 | } 127 | 128 | #pages-sidebar li, 129 | #pages-sidebar ul { 130 | padding: 0px; 131 | list-style-type: none; 132 | } 133 | 134 | #pages-sidebar a { 135 | color: unset; 136 | text-decoration: none; 137 | } 138 | 139 | #pages-sidebar li li a, 140 | #pages-sidebar li h3 { 141 | border-radius: var(--border-radius); 142 | padding: var(--child-padding); 143 | } 144 | 145 | #pages-sidebar li h3 { 146 | color: var(--sidebar-accent-1); 147 | font-variant-caps: all-petite-caps; 148 | margin-block-start: 3rem; 149 | margin-block-end: 0; 150 | } 151 | 152 | #pages-sidebar li hr { 153 | margin: 3rem 1rem; 154 | /* border-color: red; */ 155 | border-style: solid; 156 | opacity: 0.2; 157 | } 158 | 159 | #pages-sidebar li:first-of-type h3 { 160 | margin-block-start: 0; 161 | } 162 | 163 | #pages-sidebar li, 164 | #pages-sidebar ul { 165 | display: flex; 166 | flex-direction: column; 167 | align-items: stretch; 168 | } 169 | 170 | #pages-sidebar li li.homework { 171 | padding-left: 1ch; 172 | /* background: yellow; */ 173 | } 174 | 175 | #pages-sidebar li li a { 176 | margin: 0.2em 0; 177 | } 178 | 179 | #pages-sidebar li li.homework a { 180 | /* background: #ffb60012; */ 181 | margin: 0.4em 0px; 182 | outline: 3px dashed #92929278; 183 | outline-offset: -1px; 184 | } 185 | 186 | /* #pages-sidebar li li.homework a::before { 187 | content: "👉 "; 188 | } */ 189 | 190 | #pages-sidebar li li span.entry-number { 191 | opacity: 0.6; 192 | } 193 | #pages-sidebar li li.homework span.entry-number { 194 | display: block; 195 | } 196 | 197 | #pages-sidebar li li.active a { 198 | background-color: var(--sidebar-li-active-bg); 199 | } 200 | #pages-sidebar li li:hover a { 201 | background-color: var(--sidebar-li-hover-bg); 202 | } 203 | #pages-sidebar li li.not_in_track { 204 | opacity: 0.4; 205 | } 206 | 207 | /* TRACK CHOOSER */ 208 | 209 | .track-chooser { 210 | margin-top: 3em; 211 | padding: 0.5em; 212 | border: 3px solid var(--track-bg-accent); 213 | background: var(--track-bg); 214 | color: var(--fg); 215 | border-radius: 0.3em; 216 | display: flex; 217 | flex-direction: column; 218 | align-items: center; 219 | } 220 | 221 | .track-chooser h2:not(#asdf) { 222 | font-weight: 900; 223 | font-family: sans-serif; 224 | font-style: normal; 225 | font-size: 1.2rem; 226 | margin-block-end: 0.3em; 227 | margin-block-start: 0; 228 | } 229 | 230 | .track-chooser label { 231 | display: contents; 232 | } 233 | 234 | .track-chooser select { 235 | max-width: 100%; 236 | } 237 | 238 | /* SIDEBAR LOGO */ 239 | 240 | #pages-sidebar .home_link img { 241 | height: 1.2em; 242 | width: 1.2em; 243 | } 244 | #pages-sidebar a.home_link { 245 | font-size: 1.7rem; 246 | padding: 0.3em; 247 | font-weight: 800; 248 | display: flex; 249 | flex-direction: row; 250 | align-items: center; 251 | gap: 0.5ch; 252 | } 253 | 254 | /* Markdown content */ 255 | 256 | .pages-markdown main { 257 | max-width: 700px; 258 | margin-left: auto; 259 | margin-right: auto; 260 | margin-top: 5rem; 261 | } 262 | -------------------------------------------------------------------------------- /src/assets/julia-logo-color.svg: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /src/assets/julia-logo-dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /src/assets/scripts/search.js: -------------------------------------------------------------------------------- 1 | const root_href = document.head.querySelector("link[rel='root']").getAttribute("href") 2 | 3 | const minby = (arr, fn) => arr.reduce((a, b) => (fn(a) < fn(b) ? a : b)) 4 | const maxby = (arr, fn) => arr.reduce((a, b) => (fn(a) > fn(b) ? a : b)) 5 | const range = (length) => [...Array(length).keys()] 6 | 7 | const sortby = (arr, fn) => arr.sort((a, b) => fn(a) - fn(b)) 8 | 9 | const setup_search_index = async () => { 10 | const search_data_href = document.head.querySelector("link[rel='pp-search-data']").getAttribute("href") 11 | console.log(search_data_href) 12 | 13 | const search_data = await (await fetch(search_data_href)).json() 14 | window.search_data = search_data 15 | 16 | console.log(search_data) 17 | 18 | // create a search bar powered by lunr 19 | // const search_bar = document.createElement('div') 20 | // search_bar.id = 'search-bar' 21 | // search_bar.innerHTML = ` 22 | // 23 | // 24 | // ` 25 | // document.body.appendChild(search_bar) 26 | 27 | // create a search index 28 | const before = Date.now() 29 | const search_index = window.lunr(function () { 30 | this.ref("url") 31 | 32 | this.field("title", { boost: 10 }) 33 | this.field("tags", { boost: 5 }) 34 | this.field("text") 35 | this.metadataWhitelist = ["position"] 36 | search_data.forEach(function (doc) { 37 | this.add(doc) 38 | }, this) 39 | }) 40 | const after = Date.now() 41 | console.info(`lunr: Indexing ${search_data.length} documents took ${after - before}ms`) 42 | window.search_index = search_index 43 | 44 | return { search_data, search_index } 45 | } 46 | 47 | const excerpt_length = 200 48 | const excerpt_padding = 50 49 | 50 | const init_search = async () => { 51 | const query = new URLSearchParams(window.location.search).get("q") 52 | console.warn({ query }) 53 | 54 | document.querySelector(".search-bar.big input").value = query 55 | 56 | const { search_data, search_index } = await setup_search_index() 57 | 58 | if (query) { 59 | const results = search_index.search(query) 60 | console.log(results) 61 | 62 | const search_results = document.getElementById("search-results") 63 | 64 | if (results.length !== 0) { 65 | search_results.innerHTML = "" 66 | results.forEach((result) => { 67 | const { url, title, tags, text } = search_data.find((doc) => doc.url === result.ref) 68 | const result_div = document.createElement("a") 69 | result_div.classList.add("search-result") 70 | result_div.innerHTML = ` 71 | 72 | 73 | 74 | ` 75 | console.log(root_href) 76 | result_div.querySelector(".title").innerText = title 77 | result_div.href = new URL(url, new URL(root_href, window.location.href)).href 78 | result_div.querySelector(".tags").innerText = tags.join(", ") 79 | result_div.querySelector(".snippet").innerText = text.substring(0, excerpt_length) + "..." 80 | 81 | const text_match_positions = Object.values(result?.matchData?.metadata ?? {}) 82 | .flatMap((z) => z?.text?.position ?? []) 83 | .sort(([a, _a], [b, _b]) => a - b) 84 | const title_match_positions = Object.values(result?.matchData?.metadata ?? {}) 85 | .flatMap((z) => z?.title?.position ?? []) 86 | .sort(([a, _a], [b, _b]) => a - b) 87 | 88 | console.error(title_match_positions) 89 | if (title_match_positions.length > 0) { 90 | const strong_el = document.createElement("strong") 91 | strong_el.innerText = title 92 | result_div.querySelector(".title").innerHTML = `` 93 | result_div.querySelector(".title").appendChild(strong_el) 94 | } 95 | 96 | if (text_match_positions.length > 0) { 97 | // console.log(text_match_positions) 98 | // console.log(find_longest_run(text_match_positions, 50)) 99 | // console.log(find_longest_run(text_match_positions, 100)) 100 | // console.log(find_longest_run(text_match_positions, 200)) 101 | // console.log(find_longest_run(text_match_positions, 300)) 102 | // console.log(find_longest_run(text_match_positions, 400)) 103 | 104 | const [start_index, num_matches] = find_longest_run(text_match_positions, excerpt_length) 105 | 106 | const excerpt_start = text_match_positions[start_index][0] 107 | const excerpt_end = excerpt_start + excerpt_length 108 | 109 | const highlighted_ranges = text_match_positions.slice(start_index, start_index + num_matches) 110 | 111 | const elements = highlighted_ranges.flatMap(([h_start, h_length], i) => { 112 | const h_end = h_start + h_length 113 | const word = text.slice(h_start, h_end) 114 | const filler = text.slice(h_end, highlighted_ranges[i + 1]?.[0] ?? excerpt_end) 115 | const word_el = document.createElement("strong") 116 | word_el.innerText = word 117 | return [word_el, filler] 118 | }) 119 | 120 | const snippet_p = result_div.querySelector(".snippet") 121 | snippet_p.innerHTML = `` 122 | ;["...", text.slice(excerpt_start - excerpt_padding, excerpt_start).trimStart(), ...elements, "..."].forEach((el) => snippet_p.append(el)) 123 | } 124 | 125 | // text_match_positions.slice(start_index, start_index + num_matches).forEach(([start, length]) => { 126 | 127 | search_results.appendChild(result_div) 128 | }) 129 | } else { 130 | search_results.innerText = `No results found for "${query}"` 131 | } 132 | } 133 | } 134 | 135 | const count = (arr, fn) => arr.reduce((a, b) => fn(a) + fn(b), 0) 136 | 137 | const find_longest_run = (/** @type{Array<[number, number]>} */ positions, max_dist) => { 138 | const legal_run_size = (start_index) => 139 | positions.slice(start_index).filter(([start, length]) => start + length < positions[start_index][0] + max_dist).length 140 | 141 | console.warn(range(positions.length).map(legal_run_size)) 142 | 143 | const best_start = maxby(range(positions.length), legal_run_size) 144 | const best_length = legal_run_size(best_start) 145 | return [best_start, best_length] 146 | } 147 | 148 | window.init_search = init_search 149 | -------------------------------------------------------------------------------- /src/assets/styles/homepage.css: -------------------------------------------------------------------------------- 1 | @import url("newdefault.css"); 2 | 3 | body { 4 | background: url("../homepage/bg.svg"); 5 | background-color: hsl(231deg 14% 57%); 6 | background-size: cover; 7 | backdrop-filter: blur(3vw); 8 | } 9 | main h1 { 10 | font-family: "Vollkorn", serif; 11 | font-weight: 800; 12 | font-style: italic; 13 | margin-block-end: 0.5em; 14 | font-size: 3rem; 15 | margin-block-start: 0; 16 | border-bottom: 5px solid #74747414; 17 | letter-spacing: -0.2px; 18 | color: #424250; 19 | padding: 0px 10px; 20 | text-shadow: 7px 5px 0px #e5dbb8; 21 | } 22 | 23 | a { 24 | text-decoration: none; 25 | /* background: #f3f3ff; */ 26 | /* border: 3px solid; */ 27 | color: black; 28 | /* border-bottom: 0.2em solid rgba(0, 0, 0, 0.3); */ 29 | } 30 | .homepage a:not(.no-decoration) { 31 | background-position: 0 0.83em; 32 | background-repeat: repeat-x; 33 | background-size: 2px 8px; 34 | background-image: linear-gradient(to bottom, rgba(165, 213, 235, 0.3) 33%, rgba(165, 213, 235, 0.3)); 35 | /* text-shadow: 2px 2px white, 2px -2px white, -2px 2px white, -2px -2px white; */ 36 | transition: background-position 50ms linear, background-size 50ms linear; 37 | } 38 | 39 | a:hover { 40 | background-position: 0 0em; 41 | background-size: 2px auto; 42 | } 43 | 44 | div.banner { 45 | min-height: 20rem; 46 | display: grid; 47 | place-items: center; 48 | } 49 | 50 | div.banner h1 { 51 | transform: perspective(187px) rotate3d(0, 2, 0, 0deg); 52 | font-family: "Alegreya", sans-serif; 53 | background: #000000ad; 54 | padding: 0.2em 0.5em; 55 | margin: 0px 10px; 56 | border-radius: 0.4em; 57 | transition: transform 200ms ease-in-out; 58 | color: #ffffffc7; 59 | font-style: normal; 60 | border: none; 61 | backdrop-filter: blur(6px); 62 | /* flex: 1 1 auto; */ 63 | /* display: block; */ 64 | } 65 | div.banner h1 strong { 66 | color: white; 67 | } 68 | 69 | div.banner:hover h1 { 70 | /* transform: perspective(187px) rotate3d(0, 2, 0, 3deg) scale(1.05); */ 71 | } 72 | 73 | #title { 74 | background-image: url("../homepage/swoosh.png"); 75 | 76 | background-size: cover; 77 | image-rendering: pixelated; 78 | } 79 | 80 | img.logo { 81 | position: absolute; 82 | top: 5px; 83 | left: 5px; 84 | z-index: 10; 85 | height: 2rem; 86 | background: #ffffff96; 87 | padding: 3px; 88 | } 89 | 90 | .twocols { 91 | column-count: 2; 92 | color: #fffffff7; 93 | background: linear-gradient(155deg, #7c7e87, #5a594a); 94 | } 95 | 96 | main { 97 | /* background: white; */ 98 | padding: 1em; 99 | max-width: 86rem; 100 | z-index: -1; 101 | margin: 3em auto 0 auto; 102 | } 103 | main > div { 104 | z-index: 4; 105 | background: white; 106 | padding: 2rem; 107 | margin-block-end: 15rem; 108 | border-radius: 1rem; 109 | box-shadow: 0px 6px 7px #1c12120d; 110 | 111 | max-width: 700px; 112 | margin-left: auto; 113 | margin-right: auto; 114 | } 115 | 116 | main > div.wide { 117 | max-width: unset; 118 | } 119 | 120 | main > div:last-of-type { 121 | margin-block-end: 0px; 122 | } 123 | main > div > *:last-child, 124 | main > div > .contain > *:last-child { 125 | margin-block-end: 0px; 126 | margin-bottom: 0em; 127 | } 128 | main thingy { 129 | background: #ff00005e; 130 | width: 300vw; 131 | border-radius: 50%; 132 | height: 60vh; 133 | display: block; 134 | /* position: unset; */ 135 | z-index: -4; 136 | /* transform: translate(10px, -64px); */ 137 | /* transform: rotate(11deg); */ 138 | } 139 | .asdf { 140 | position: absolute; 141 | transform: translate(-); 142 | overflow: hidden; 143 | max-width: 100vw; 144 | } 145 | .contain { 146 | max-width: 700px; 147 | margin-left: auto; 148 | margin-right: auto; 149 | } 150 | 151 | blockquote { 152 | border-left: 0.6em solid #b97777; 153 | padding: 0.5em 1em; 154 | max-width: 30em; 155 | font-style: italic; 156 | background: #f9f9f9; 157 | font-size: 1rem; 158 | margin: 0 auto; 159 | } 160 | 161 | blockquote.banner { 162 | margin-top: -46px; 163 | font-style: unset; 164 | font-size: 1rem; 165 | border-radius: 0.5em; 166 | box-shadow: 0px 3px 17px #0000001a; 167 | } 168 | 169 | .pillars { 170 | display: flex; 171 | flex-direction: row; 172 | justify-content: space-between; 173 | overflow-x: auto; 174 | } 175 | 176 | .pillars > div { 177 | color: white; 178 | padding: 1em; 179 | background: #434366; 180 | min-height: 300px; 181 | flex: 1 1 33%; 182 | margin: 0px 10px; 183 | } 184 | 185 | .scrolly { 186 | /* max-height: 20em; */ 187 | /* overflow-y: auto; */ 188 | } 189 | .pillars > div ul { 190 | padding-left: 0.6rem; 191 | } 192 | .pillars > div li { 193 | list-style: "- "; 194 | margin-bottom: 0.3rem; 195 | margin-right: 0.5rem; 196 | } 197 | .pillars > div li::marker { 198 | color: rgba(255, 255, 255, 0.4); 199 | } 200 | 201 | .subjects { 202 | display: grid; 203 | grid-template-columns: repeat(3, auto); 204 | grid-gap: 1rem; 205 | /* display: flex; */ 206 | /* flex-wrap: wrap; */ 207 | } 208 | 209 | @media (max-width: 1350px) { 210 | .subjects { 211 | grid-template-columns: repeat(2, auto); 212 | } 213 | } 214 | @media (max-width: 850px) { 215 | .subjects { 216 | grid-template-columns: repeat(1, auto); 217 | } 218 | } 219 | 220 | @media (min-width: 1250px) { 221 | .subjectscontainer { 222 | display: flex; 223 | flex-direction: row; 224 | margin-block-start: 15rem; 225 | } 226 | 227 | .subjectscontainer h1 { 228 | flex-shrink: 0; 229 | position: sticky; 230 | top: 100px; 231 | align-self: flex-start; 232 | margin-block-start: 0px; 233 | /* padding-right: 0; */ 234 | margin-right: 1em; 235 | } 236 | } 237 | 238 | .subjects > a { 239 | display: block; 240 | border: 7px solid #c19d1c1f; 241 | min-height: 200px; 242 | min-width: min(90vw, 188px); 243 | padding: 1em; 244 | border-radius: 1em; 245 | transition: transform 100ms ease-in-out; 246 | /* width: 27%; */ 247 | box-shadow: 0px 6px 7px #1c12120d; 248 | } 249 | 250 | .subjects > a:hover { 251 | transform: scale(1.05); 252 | } 253 | 254 | .subjects > a img { 255 | max-width: 100%; 256 | width: 100%; 257 | } 258 | section { 259 | display: flex; 260 | flex-direction: row; 261 | background: linear-gradient(145deg, #a6b8ef, #daeaff); 262 | padding: 1em; 263 | background-repeat: repeat-x; 264 | border-radius: 1em; 265 | margin-bottom: 2em; 266 | } 267 | 268 | .shadow, 269 | section { 270 | box-shadow: 0px 6px 9px #0606060f; 271 | padding: 1rem; 272 | border-radius: 1rem; 273 | } 274 | 275 | @media (max-width: 500px) { 276 | section { 277 | flex-direction: column; 278 | } 279 | } 280 | 281 | section > div { 282 | flex: 1 1 60%; 283 | } 284 | 285 | section > div.content { 286 | margin-right: 1em; 287 | } 288 | section > div.preview { 289 | flex: 0 1 40%; 290 | } 291 | 292 | section > div.preview > img { 293 | width: 100%; 294 | } 295 | 296 | .github-logo { 297 | width: 1em; 298 | } 299 | 300 | .homepage, 301 | .banner { 302 | color: #3c3c3c; 303 | } 304 | -------------------------------------------------------------------------------- /src/installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Software installation" 3 | tags: ["welcome"] 4 | order: 1 5 | layout: "md.jlmd" 6 | --- 7 | 8 | $( 9 | begin 10 | # these special elements will automatically update to read the latest Julia version. See the JavaScript snippet at the bottom of this page to see how it works! 11 | 12 | version = html"I cannot recommend this class enough, it’s awesome. https://t.co/4BsBEygeLd
— James Doss-Gollin (@jdossgollin) December 16, 2020
55 | julia> ]
56 |
57 | (@v$(pkg_version)) pkg>
58 |
59 |
60 | The line turns blue and the prompt changes to `pkg>`, telling you that you are now in _package manager mode_. This mode allows you to do operations on **packages** (also called libraries).
61 |
62 | To install Pluto, run the following (case sensitive) command to *add* (install) the package to your system by downloading it from the internet.
63 | You should only need to do this *once* for each installation of Julia:
64 |
65 |
66 | (@v$(pkg_version)) pkg> add Pluto
67 |
68 |
69 | This might take a couple of minutes, so you can go get yourself a cup of tea!
70 |
71 | 
72 |
73 | You can now close the terminal.
74 |
75 | ## Step 4: Use a modern browser: Mozilla Firefox or Google Chrome
76 | We need a modern browser to view Pluto notebooks with. Firefox and Chrome work best.
77 |
78 |
79 | # Second time: _Running Pluto & opening a notebook_
80 | Repeat the following steps whenever you want to work on a project or homework assignment.
81 |
82 | ## Step 1: Start Pluto
83 |
84 | Start the Julia REPL, like you did during the setup. In the REPL, type:
85 | ```julia
86 | julia> using Pluto
87 |
88 | julia> Pluto.run()
89 | ```
90 |
91 | 
92 |
93 | The terminal tells us to go to `http://localhost:1234/` (or a similar URL). Let's open Firefox or Chrome and type that into the address bar.
94 |
95 | 
96 |
97 | > If you're curious about what a _Pluto notebook_ looks like, have a look at the **Featured Notebooks**. These notebooks are useful for learning some basics of Julia programming.
98 | >
99 | > If you want to hear the story behind Pluto, have a look a the [JuliaCon presentation](https://www.youtube.com/watch?v=IAF8DjrQSSk).
100 |
101 | If nothing happens in the browser the first time, close Julia and try again. And please let us know!
102 |
103 | ## Step 2a: Opening a notebook from the web
104 |
105 | This is the main menu - here you can create new notebooks, or open existing ones. Our homework assignments will always be based on a _template notebook_, available in this GitHub repository. To start from a template notebook on the web, you can _paste the URL into the blue box_ and press ENTER.
106 |
107 | For example, homework 0 is available [here](/hw0/). Go to this page, and on the top right, click on the button that says "Edit or run this notebook". From these instructions, copy the notebook link, and paste it into the box. Press ENTER, and select OK in the confirmation box.
108 |
109 | 
110 |
111 | **The first thing we will want to do is to save the notebook somewhere on our own computer; see below.**
112 |
113 | ## Step 2b: Opening an existing notebook file
114 | When you launch Pluto for the second time, your recent notebooks will appear in the main menu. You can click on them to continue where you left off.
115 |
116 | If you want to run a local notebook file that you have not opened before, then you need to enter its _full path_ into the blue box in the main menu. More on finding full paths in step 3.
117 |
118 | ## Step 3: Saving a notebook
119 | We first need a folder to save our homework in. Open your file explorer and create one.
120 |
121 | Next, we need to know the _absolute path_ of that folder. Here's how you do that in [Windows](https://www.top-password.com/blog/copy-full-path-of-a-folder-file-in-windows/) and [MacOS](https://www.josharcher.uk/code/find-path-to-folder-on-mac/). In Linux, right click and "Copy file path".
122 |
123 | For example, you might have:
124 |
125 | - `C:\\Users\\fons\\Documents\\18S191_assignments\\` on **Windows**.
126 |
127 | - `/Users/fons/Documents/18S191_assignments/` on **MacOS**.
128 |
129 | - `/home/fons/Documents/18S191_assignments/` on **Ubuntu**.
130 |
131 | Now that we know the absolute path, go back to your Pluto notebook, and at the top of the page, click on _"Save notebook..."_.
132 |
133 | 
134 |
135 | This is where you type the **new path+filename for your notebook**:
136 |
137 | 
138 |
139 | Click _Choose_.
140 |
141 | ## Step 4: Sharing a notebook
142 |
143 | After working on your notebook (your code is autosaved when you run it), you will find your notebook file in the folder we created in step 3. This the file that you can share with others, or submit as your homework assignment to Canvas.
144 |
145 |
146 |
161 |
--------------------------------------------------------------------------------
/src/assets/styles/index.css:
--------------------------------------------------------------------------------
1 | /* a minimalist set of CSS resets */
2 |
3 | @import url("https://cdn.jsdelivr.net/npm/normalize.css@8.0.1/normalize.css");
4 | @import url("lecture_header.css");
5 | @import url("newdefault.css");
6 |
7 | /* @import url('https://cdn.jsdelivr.net/gh/fonsp/Pluto.jl@0.18.0/frontend/vollkorn.css'); */
8 | /* @import url('https://fonts.googleapis.com/css2?family=Jaldi:wght@400;700&display=swap'); */
9 | /* @import url('https://fonts.googleapis.com/css2?family=Jaldi:wght@400;700&family=Work+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900&family=Yantramanav:wght@400;500;700;900&display=swap'); */
10 |
11 | *,
12 | *:before,
13 | *:after {
14 | box-sizing: inherit;
15 | }
16 |
17 | :root {
18 | --system-fonts: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji",
19 | "Segoe UI Symbol", system-ui, sans-serif;
20 | --system-fonts-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
21 |
22 | --fg: #000;
23 | --faded-1: #858585;
24 | --faded-2: rgb(161, 161, 161);
25 | --sidebar-accent-1: #c89393;
26 | --search-bg: hsl(78deg 10% 85%);
27 | --search-bg-accent: #f4f4f5;
28 |
29 | --track-bg: hsl(56 50% 94% / 1);
30 | --track-bg-accent: #a3987c;
31 | }
32 |
33 | @media (prefers-color-scheme: dark) {
34 | :root {
35 | --fg: #ddd;
36 | --faded-1: #b3b3b3;
37 | --faded-2: #999999;
38 |
39 | --sidebar-accent-1: #d0a493;
40 | --search-bg: #363b33;
41 | --search-bg-accent: #4d6542;
42 |
43 | --track-bg: #545346;
44 | --track-bg-accent: #dad1b9;
45 | }
46 | }
47 |
48 | /* adjust typography defaults */
49 | body {
50 | margin: 0;
51 | padding: 0;
52 | /* font-family: Noto; */
53 | /* font-family: sans-serif; */
54 | /* font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif; */
55 | width: 100vw;
56 | overflow-x: hidden;
57 | background: hsl(235deg 19% 16%);
58 | color: var(--pluto-output-color);
59 |
60 | /* background: url(bg.svg); */
61 | /* background-color: hsl(231deg 14% 57%); */
62 | /* background-size: cover; */
63 | word-break: break-word;
64 | }
65 |
66 | .pages-markdown p,
67 | .pages-markdown ol {
68 | line-height: 1.5;
69 | }
70 |
71 | .pages-markdown h1,
72 | .pages-markdown h2 {
73 | font-weight: 800;
74 | }
75 |
76 | .pages-markdown h1,
77 | .pages-markdown h2,
78 | .pages-markdown h3,
79 | .pages-markdown h4,
80 | .pages-markdown h5,
81 | .pages-markdown h6 {
82 | color: var(--pluto-output-h-color);
83 | }
84 |
85 | pre {
86 | tab-size: 4;
87 | white-space: pre-wrap;
88 | word-break: break-word;
89 | }
90 |
91 | pre,
92 | code {
93 | font-family: var(--system-fonts-mono);
94 | }
95 |
96 | /* images and videos max out at full width */
97 | img,
98 | video {
99 | height: auto;
100 | max-width: 100%;
101 | }
102 |
103 | a {
104 | font-weight: 500;
105 | text-decoration: none;
106 | }
107 | .pages-markdown a,
108 | .pages-markdown a:visited {
109 | color: #4674bc;
110 | }
111 | a:hover {
112 | text-decoration: underline;
113 | }
114 | h1 a,
115 | h2 a,
116 | h3 a {
117 | font-weight: inherit;
118 | }
119 |
120 | a.arrow::after {
121 | content: " →";
122 | }
123 | card-text > a.arrow {
124 | margin-top: auto;
125 | }
126 |
127 | /* SIDEBAR LOGO */
128 |
129 | a.pluto_home_link img {
130 | height: 1.2em;
131 | width: 1.2em;
132 | }
133 | a.pluto_home_link {
134 | font-size: 1.7em;
135 | font-weight: 800;
136 | color: inherit;
137 | padding: 0.3em;
138 | display: flex;
139 | flex-direction: row;
140 | align-items: center;
141 | gap: 0.5ch;
142 | }
143 |
144 | .sidebar-about .logos {
145 | display: flex;
146 | flex-direction: row;
147 | gap: 1em;
148 | padding: 1em;
149 | align-items: center;
150 | }
151 |
152 | .sidebar-about .logos picture {
153 | flex: 1 1 auto;
154 | min-width: 0;
155 | height: auto;
156 | object-fit: contain;
157 | }
158 |
159 | .sidebar-about .course-numbers {
160 | opacity: 0.6;
161 | }
162 | .sidebar-about .course-numbers > span {
163 | font-family: var(--system-fonts-mono);
164 | font-size: 0.9em;
165 | }
166 | .sidebar-about .course-numbers::before {
167 | /* content: " | "; */
168 | }
169 |
170 | .semester-details,
171 | .authors {
172 | border-radius: var(--border-radius);
173 | padding: var(--child-padding);
174 | }
175 | .semester-details > a {
176 | font-weight: 700;
177 | }
178 |
179 | #pages-sidebar h1 {
180 | font-size: 1.4rem;
181 | margin-block-end: 0px;
182 | margin: 0; /* line-height: 1; */
183 | }
184 |
185 | #pages-sidebar h2 {
186 | font-size: 1rem;
187 | font-weight: 500;
188 | font-style: italic;
189 | opacity: 0.8;
190 | margin-block-start: 0.2em;
191 | }
192 |
193 | .authors {
194 | color: var(--faded-2);
195 | }
196 | .authors {
197 | color: var(--faded-2);
198 | }
199 | #pages-sidebar .authors > a {
200 | color: var(--fg);
201 | }
202 |
203 | .search-result strong {
204 | --bg-color: #73731e94;
205 | background: var(--bg-color);
206 | outline: 0.15em solid var(--bg-color);
207 | border-radius: 0.1em;
208 | }
209 |
210 | #pages-sidebar .search-bar form {
211 | display: flex;
212 | flex-direction: row;
213 | }
214 | #pages-sidebar .search-bar input[type="search"] {
215 | flex: 1 1 auto;
216 | min-width: 0px;
217 | }
218 |
219 | a.search-result,
220 | a.search-result:visited {
221 | color: inherit;
222 | display: block;
223 | text-decoration: none;
224 | background: var(--search-bg);
225 | padding: 0.7rem;
226 | margin: 2rem 1rem 2rem 0rem;
227 | --br: 0.4em;
228 | border-radius: var(--br);
229 | position: relative;
230 | }
231 |
232 | .search-result h3 {
233 | margin-block-start: 0;
234 | }
235 |
236 | .search-result .tags {
237 | opacity: 0.6;
238 | font-family: var(--system-fonts-mono);
239 | }
240 |
241 | a.search-result::before {
242 | content: "";
243 | display: block;
244 | position: absolute;
245 | z-index: -1;
246 | --off: -3px;
247 | top: var(--off);
248 | right: var(--off);
249 | left: var(--off);
250 | bottom: var(--off);
251 | background: var(--search-bg-accent);
252 | transform: rotate(356.9deg) translate(0px, 0px);
253 | border-radius: var(--br);
254 | }
255 |
256 | .student-feedback .card {
257 | box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
258 | margin: 1rem 0rem;
259 | border-radius: 0.4rem;
260 | padding: 0.2rem 1rem;
261 | }
262 |
263 | @media (prefers-color-scheme: dark) {
264 | .student-feedback .card {
265 | background: #4b4b4b;
266 | }
267 | }
268 | .student-feedback .card-container {
269 | padding: 4px 16px;
270 | }
271 | .student-feedback .card-container::after,
272 | .student-feedback .row::after {
273 | content: "";
274 | clear: both;
275 | display: table;
276 | }
277 | .student-feedback .semester {
278 | opacity: 0.6;
279 | }
280 | .student-feedback .feedback {
281 | /* margin-top: 0.5em; */
282 | }
283 |
284 | .student-feedback {
285 | margin-bottom: 4rem;
286 | }
287 |
288 | blockquote.twitter-tweet {
289 | margin: 0rem;
290 | }
291 |
292 | /* modify Pluto's styles to avoid a visual glitch. This will make the header always display fixed at the top. */
293 |
294 | body:not(.asdfsdfa) pluto-editor:not(.asdffdas) header#pluto-nav {
295 | position: fixed;
296 | top: 0;
297 | left: 56px;
298 | right: 56px;
299 | z-index: 1998;
300 | width: auto;
301 | border-radius: 0 0 10px 10px;
302 | }
303 |
304 | /* Make space for the Pluto header */
305 | body.binder:not(.offer_binder) {
306 | padding-top: 60px;
307 | }
308 |
309 | /* Another strategy: leave the header in place but make the export menu hidden when it is not opened. */
310 | /*
311 | header.show_export aside#export {
312 | visibility: initial;
313 | }
314 |
315 | aside#export {
316 | visibility: hidden;
317 | } */
318 |
--------------------------------------------------------------------------------
/src/_includes/layout.jlhtml:
--------------------------------------------------------------------------------
1 | $(begin
2 | import Pluto
3 | "The contents of `` from a Pluto HTML export."
4 | const pluto_head = let
5 | default = Pluto.generate_html(;
6 | pluto_cdn_root=Pluto.PLUTO_VERSION < v"0.19" ? "https://cdn.jsdelivr.net/gh/fonsp/Pluto.jl@9ca70c36/frontend/" : nothing)
7 | m = match(r"Section $(f("chapter", "-")).$(f("section", "-"))
166 |