$(x["name"])
9 |$(x["text"])
10 |├── src ├── assets │ ├── styles │ │ ├── sidebar.css │ │ ├── newdefault.css │ │ ├── lecture_header.css │ │ ├── homepage.css │ │ ├── layout.css │ │ └── index.css │ ├── favicon.ico │ ├── homepage │ │ ├── swoosh.png │ │ ├── bg.afdesign │ │ └── bg.svg │ ├── scripts │ │ ├── get_highlights.jl │ │ ├── sidebar.js │ │ ├── get_subjects.jl │ │ └── search.js │ ├── favicon.svg │ ├── julia-logo-color.svg │ └── julia-logo-dark.svg ├── index.jlmd ├── netlify.toml ├── _includes │ ├── md.jlmd │ ├── welcome.jlmd │ └── layout.jlhtml ├── _data │ ├── tracks.jl │ ├── sidebar.jl │ ├── course_info.jl │ └── homepage.jl ├── mod3_publish_website │ ├── setup_server.md │ ├── precompute_output.md │ └── deploy_static.md ├── logistics.md ├── search.md ├── cheatsheets.md ├── mod1_setup_website │ ├── working_locally.md │ ├── getting_started.md │ └── basic_info.md ├── mod2_add_material │ ├── add_markdown.md │ └── add_pluto.jl ├── installation.md └── homework │ └── hw1.jl ├── .gitattributes ├── Procfile ├── .gitignore ├── extra_outputs └── index.html ├── .vscode ├── tasks.json ├── extensions.json └── settings.json ├── README.md ├── pluto-deployment-environment ├── PlutoDeployment.toml ├── Project.toml └── Manifest.toml ├── generate.jl ├── .github └── workflows │ ├── pr_comment.yml │ ├── preview_cleanup.yml │ ├── KeepCacheFresh.yml │ └── ExportNotebooks.yml ├── tools └── update_notebook_packages.jl ├── LICENSE.md ├── Dockerfile ├── develop.jl ├── Website maintenance.md └── PlutoPages.jl /src/assets/styles/sidebar.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | page/* linguist-vendored 2 | * text=auto -------------------------------------------------------------------------------- /src/index.jlmd: -------------------------------------------------------------------------------- 1 | --- 2 | tags: ["homepage"] 3 | layout: "welcome.jlmd" 4 | --- 5 | -------------------------------------------------------------------------------- /src/netlify.toml: -------------------------------------------------------------------------------- 1 | [[headers]] 2 | for = "/*" 3 | [headers.values] 4 | Access-Control-Allow-Origin = "*" 5 | -------------------------------------------------------------------------------- /src/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JuliaPluto/computational-thinking-template/HEAD/src/assets/favicon.ico -------------------------------------------------------------------------------- /src/assets/homepage/swoosh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JuliaPluto/computational-thinking-template/HEAD/src/assets/homepage/swoosh.png -------------------------------------------------------------------------------- /src/assets/homepage/bg.afdesign: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JuliaPluto/computational-thinking-template/HEAD/src/assets/homepage/bg.afdesign -------------------------------------------------------------------------------- /src/_includes/md.jlmd: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "layout.jlhtml" 3 | --- 4 | 5 |
4 | Go to template website :balloon: 5 | template includes instructions for how to start editing to shape to your own needs :rocket: 6 |
7 | 8 | This repository is a template to build a website like the [Computational thinking course](https://computationalthinking.mit.edu/) tought at MIT. 9 | 10 | **Note**: This is an early experiment and very WIP; use at your own risk. 11 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. 3 | // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp 4 | 5 | // List of extensions which should be recommended for users of this workspace. 6 | "recommendations": [ 7 | "esbenp.prettier-vscode", 8 | "julialang.language-julia", 9 | ], 10 | // List of extensions recommended by VS Code that should not be recommended for users of this workspace. 11 | "unwantedRecommendations": [ 12 | 13 | ] 14 | } -------------------------------------------------------------------------------- /src/_data/course_info.jl: -------------------------------------------------------------------------------- 1 | Dict( 2 | "course_name" => "Name of your course", 3 | "course_subtitle" => "a short catchy phrase about your course", 4 | "code" => "code of your course", 5 | "semester" => "Fall 20XX", 6 | "authors" => [ 7 | "First author name" => "first author homepage link", 8 | "Second author name" => "second author homepage link" 9 | ], 10 | "institution" => "Your university (or similar) name", 11 | "institution_logo" => "name of your institution logo file, e.g. `logo.svg`. Place this under `assets`", 12 | "repo" => "link to the repository of the source code" 13 | ) -------------------------------------------------------------------------------- /pluto-deployment-environment/PlutoDeployment.toml: -------------------------------------------------------------------------------- 1 | [Export] 2 | baked_state = false 3 | baked_notebookfile = false 4 | offer_binder = true 5 | ignore_cache = [ 6 | "index.jl", 7 | ] 8 | create_index = false 9 | exclude = [ 10 | # these are in the repo but not used on the website 11 | "tools/*", 12 | "PlutoPages.jl", 13 | ] 14 | 15 | [SliderServer] 16 | port = 8080 17 | host = "0.0.0.0" 18 | exclude=[ 19 | # these are in the repo but not used on the website 20 | "tools/*", 21 | "PlutoPages.jl", 22 | 23 | # notebooks not interactive 24 | 25 | # don't run homeworks 26 | "*/hw*.jl", 27 | ] 28 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "*.jlmd": "markdown", 4 | "*.jlhtml": "html", 5 | }, 6 | 7 | "prettier.printWidth": 160, 8 | "prettier.tabWidth": 4, 9 | "prettier.semi": false, 10 | "prettier.quoteProps": "consistent", 11 | "prettier.singleQuote": false, 12 | 13 | "editor.formatOnSave": false, 14 | "[javascript]": { 15 | "editor.defaultFormatter": "esbenp.prettier-vscode", 16 | "editor.formatOnSave": true 17 | }, 18 | "[css]": { 19 | "editor.defaultFormatter": "esbenp.prettier-vscode", 20 | "editor.formatOnSave": true 21 | } 22 | } -------------------------------------------------------------------------------- /src/_includes/welcome.jlmd: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "layout.jlhtml" 3 | --- 4 | 5 | 6 | 7 |""")) 12 | 13 |$(metadata["homepage"]["disclaimer"])
$(x["text"])
10 |
50 | julia> ]
51 |
52 | (@v$(pkg_version)) pkg>
53 |
54 |
55 | 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).
56 |
57 | To install Pluto, run the following (case sensitive) command to *add* (install) the package to your system by downloading it from the internet.
58 | You should only need to do this *once* for each installation of Julia:
59 |
60 |
61 | (@v$(pkg_version)) pkg> add Pluto
62 |
63 |
64 | This might take a couple of minutes, so you can go get yourself a cup of tea!
65 |
66 | 
67 |
68 | You can now close the terminal.
69 |
70 | ## Step 4: Use a modern browser: Mozilla Firefox or Google Chrome
71 | We need a modern browser to view Pluto notebooks with. Firefox and Chrome work best.
72 |
73 |
74 | # Second time: _Running Pluto & opening a notebook_
75 | Repeat the following steps whenever you want to work on a project or homework assignment.
76 |
77 | ## Step 1: Start Pluto
78 |
79 | Start the Julia REPL, like you did during the setup. In the REPL, type:
80 | ```julia
81 | julia> using Pluto
82 |
83 | julia> Pluto.run()
84 | ```
85 |
86 | 
87 |
88 | 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.
89 |
90 | 
91 |
92 | > 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.
93 | >
94 | > If you want to hear the story behind Pluto, have a look a the [JuliaCon presentation](https://www.youtube.com/watch?v=IAF8DjrQSSk).
95 |
96 | If nothing happens in the browser the first time, close Julia and try again. And please let us know!
97 |
98 | ## Step 2a: Opening a notebook from the web
99 |
100 | 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.
101 |
102 | 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.
103 |
104 | 
105 |
106 | **The first thing we will want to do is to save the notebook somewhere on our own computer; see below.**
107 |
108 | ## Step 2b: Opening an existing notebook file
109 | 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.
110 |
111 | 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.
112 |
113 | ## Step 3: Saving a notebook
114 | We first need a folder to save our homework in. Open your file explorer and create one.
115 |
116 | 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/), [MacOS](https://www.josharcher.uk/code/find-path-to-folder-on-mac/) and [Ubuntu]().
117 |
118 | For example, you might have:
119 |
120 | - `C:\\Users\\fons\\Documents\\18S191_assignments\\` on Windows
121 |
122 | - `/Users/fons/Documents/18S191_assignments/` on MacOS
123 |
124 | - `/home/fons/Documents/18S191_assignments/` on Ubuntu
125 |
126 | Now that we know the absolute path, go back to your Pluto notebook, and at the top of the page, click on _"Save notebook..."_.
127 |
128 | 
129 |
130 | This is where you type the **new path+filename for your notebook**:
131 |
132 | 
133 |
134 | Click _Choose_.
135 |
136 | ## Step 4: Sharing a notebook
137 |
138 | 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.
139 |
140 |
141 |
156 |
--------------------------------------------------------------------------------
/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"Homework $(f("homework_number", ""))
""") 171 | elseif !isempty(f("chapter", "")) && !isempty(f("section", "")) 172 | @htl("""Section $(f("chapter", "-")).$(f("section", "-"))
""") 173 | else 174 | nothing 175 | end) 176 |