Skip to content

Commit 36552c7

Browse files
authored
Merge pull request #40 from code4mathorg/StevenClontz/jmm2025-update
JMM 2025 updates
2 parents a417097 + 0173c25 commit 36552c7

File tree

4 files changed

+82
-55
lines changed

4 files changed

+82
-55
lines changed

source/ch-coding.ptx

Lines changed: 23 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
<section xml:id="sec-codespaces">
55
<title>Codespaces</title>
66
<p>
7-
While the quick <c>GitHub.dev</c> interface is great
8-
for quick edits, many projects require the ability
7+
While the quick <c>GitHub.dev</c> interface we used
8+
to get started in <xref ref="ch-first-repo"/> is great
9+
for quick uploads or edits, many projects require the ability
910
to run applications and execute code as you would on
1011
your personal computer. Fortunately, GitHub offers a
1112
service to run such programs on their servers.
@@ -240,50 +241,6 @@ Array.from({ length: 10 }, _ => {
240241
<caption>Sample Javascript code</caption>
241242
</listing>
242243
</section>
243-
<section xml:id="sec-github-pages-codespace">
244-
<title>Previewing GitHub Pages</title>
245-
<p>
246-
Another useful application of Codespaces is the ability
247-
to preview your GitHub Pages site created in
248-
<xref ref="sec-using-a-template"/>. Return to that repository
249-
on <c>GitHub.com</c> and create a new Codespace
250-
(<xref ref="note-create-codespace"/>).
251-
</p>
252-
<p>
253-
To spin up your live preview, open a terminal by using the
254-
shortcut noted in <xref ref="remark-terminal-shortcut"/>. To make
255-
sure the necessary software has been installed, type <c>bundle</c>
256-
and hit <kbd>Enter</kbd>. Then, you can enter <c>jekyll serve</c>
257-
to start the preview server.
258-
</p>
259-
<p>
260-
You'll see some output, and eventually
261-
<c>Server address: http://127.0.0.1:4000</c>. At that time an
262-
alert will appear that says <q>Your application on port 4000
263-
is available</q>. You can use its <q>Open in browser</q> button,
264-
or hover over the <c>http://127.0.0.1:4000</c> link to be given
265-
the same option.
266-
</p>
267-
<p>
268-
This should open a URL such as
269-
<c>random-words-123randomletters789-4000.app.github.dev</c>,
270-
which will show a live preview of your GitHub Pages site in a new
271-
tab. As soon as you make edits in your Codespace tab, you can
272-
return to this tab to (within a second or two) see how your edits
273-
will update your live site. Note that this URL is private to you,
274-
and your public site won't be updated until you Commit &amp; Sync
275-
your changes
276-
(<xref ref="note-commit-sync"/>).
277-
</p>
278-
<p>
279-
Personally, I use <c>GitHub.dev</c> (or even just the
280-
<c>GitHub.com</c> edit button) rather than a full
281-
Codespace when adding a quick post or making a quick edit on
282-
many of my GitHub Pages websites. But the Codespace option is very
283-
handy for when bigger changes are necessary, and you want to make
284-
sure everything looks just right before pushing it live to the public.
285-
</p>
286-
</section>
287244
<section xml:id="sec-codespace-management">
288245
<title>Managing Your Codespaces</title>
289246
<p>
@@ -297,9 +254,9 @@ there is the option to pay for additional resources.
297254
As a mathematician
298255
who almost exclusively uses GitHub Codespaces for doing the kinds
299256
of work described in this handbook (and does so for much longer
300-
periods of time than a tpyical mathematician),
257+
periods of time than a typical mathematician),
301258
I've only surpassed GitHub's free quota on the rare occassion
302-
(and when I do, I've paid only \$2-\$6 per month).
259+
(and when I do, I've paid only <m>\$2</m>-<m>\$6</m> per month).
303260
I accomplish this by halting
304261
my Codespaces when I'm not actively working on them.
305262
</p>
@@ -343,9 +300,11 @@ Here is what these environments look like.
343300
<section xml:id="sec-powering-up-your-codespce">
344301
<title>Powering up your Codespce</title>
345302
<p>
346-
By default, your codespace will use a
347-
2-core processor, 8GB of RAM, and 32GB of storage, with a quota of
348-
40 usage hours per month. This is fine for many tasks,
303+
As of January 2025, a default codespace will use a
304+
2-core processor and 8GB of RAM, with a quota of
305+
60 usage hours and 15GB storage per month. (This is increased
306+
to 90 usage hours and 20GB storage for Pro/Education users.)
307+
This is fine for many tasks,
349308
but if you're doing data analysis (<xref ref="ch-jupyter"/>) or
350309
formalized mathematics (<xref ref="sec-lean"/>) you may want some
351310
more resources at your disposal.
@@ -374,5 +333,18 @@ the virtual machine that should be provisioned when creating a Codespace,
374333
allowing for the automatic installation of appropriate software/libraries/dependencies
375334
necessary for the use of a given repository.
376335
</p>
336+
<remark>
337+
<p>
338+
Setting up a custom <c>.devcontainer</c> is a slick way to
339+
ensure you and your collaborators/students are running exactly
340+
the same software (including versions, dependencies, etc.)!
341+
No more <q>It works on my machine</q> while <q>I can't get it
342+
to work on my machine</q>!
343+
</p>
344+
<p>
345+
See <url href="https://code.visualstudio.com/docs/devcontainers/create-dev-container#_create-a-devcontainerjson-file">VisualStudio.com/docs/devcontainers</url>
346+
to learn more.
347+
</p>
348+
</remark>
377349
</section>
378350
</chapter>

source/ch-first-repo.ptx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,15 @@ on each commit to see exactly what has changed from the previous commit across
227227
all files.
228228
</p>
229229
</section>
230+
<section>
231+
<title>Next steps</title>
232+
<p>
233+
Now that you've gotten the hang of the basics of
234+
committing and pushing changes to a repository,
235+
you can move on to using Codespaces to write
236+
and execute programs and code (<xref ref="ch-coding"/>)
237+
or setting up a webpage hosted by GitHub
238+
(<xref ref="ch-github-pages"/>).
239+
</p>
240+
</section>
230241
</chapter>

source/ch-website.ptx

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ without using HTML.)
1919
</p>
2020
<p>
2121
Use <c>GitHub.dev</c> (<xref ref="opening-github-dev"/>)
22-
to create three files in the root of your project.
22+
to create three files in the root of a new or existing repository.
2323
<ul>
2424
<li>
2525
<p>
@@ -243,8 +243,8 @@ edits. After a while (<xref ref="actions-progress" />) you should
243243
be able to refresh your website and see your updated title, name, etc.
244244
(In <xref ref="sec-github-pages-codespace"/>, we will learn how to
245245
preview our edits more quickly, and without needing to push them to a
246-
live website, but at the expense of a more complicated
247-
editing environment.) You can repeat this process after each of the
246+
live website, provided we're comfortable using a Codespace as explored in
247+
<xref ref="ch-coding"/>.) You can repeat this process after each of the
248248
edits described below to see your results reflected on the live website.
249249
</p>
250250
</subsection>
@@ -338,4 +338,48 @@ tags:
338338
</listing>
339339
</subsection>
340340
</section>
341+
<section xml:id="sec-github-pages-codespace">
342+
<title>Previewing GitHub Pages</title>
343+
<p>
344+
Another useful application of Codespaces is the ability
345+
to preview your GitHub Pages site created in
346+
<xref ref="sec-using-a-template"/>. Return to that repository
347+
on <c>GitHub.com</c> and create a new Codespace
348+
(<xref ref="note-create-codespace"/>).
349+
</p>
350+
<p>
351+
To spin up your live preview, open a terminal by using the
352+
shortcut noted in <xref ref="remark-terminal-shortcut"/>. To make
353+
sure the necessary software has been installed, type <c>bundle</c>
354+
and hit <kbd>Enter</kbd>. Then, you can enter <c>jekyll serve</c>
355+
to start the preview server.
356+
</p>
357+
<p>
358+
You'll see some output, and eventually
359+
<c>Server address: http://127.0.0.1:4000</c>. At that time an
360+
alert will appear that says <q>Your application on port 4000
361+
is available</q>. You can use its <q>Open in browser</q> button,
362+
or hover over the <c>http://127.0.0.1:4000</c> link to be given
363+
the same option.
364+
</p>
365+
<p>
366+
This should open a URL such as
367+
<c>random-words-123randomletters789-4000.app.github.dev</c>,
368+
which will show a live preview of your GitHub Pages site in a new
369+
tab. As soon as you make edits in your Codespace tab, you can
370+
return to this tab to (within a second or two) see how your edits
371+
will update your live site. Note that this URL is private to you,
372+
and your public site won't be updated until you Commit &amp; Sync
373+
your changes
374+
(<xref ref="note-commit-sync"/>).
375+
</p>
376+
<p>
377+
Personally, I use <c>GitHub.dev</c> (or even just the
378+
<c>GitHub.com</c> edit button) rather than a full
379+
Codespace when adding a quick post or making a quick edit on
380+
many of my GitHub Pages websites. But the Codespace option is very
381+
handy for when bigger changes are necessary, and you want to make
382+
sure everything looks just right before pushing it live to the public.
383+
</p>
384+
</section>
341385
</chapter>

source/main.ptx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
<xi:include href="ch-git-github.ptx"/>
2121
<xi:include href="ch-first-repo.ptx"/>
22-
<xi:include href="ch-website.ptx"/>
2322
<xi:include href="ch-coding.ptx"/>
23+
<xi:include href="ch-website.ptx"/>
2424
<xi:include href="ch-collaboration.ptx"/>
2525
<xi:include href="ch-jupyter.ptx"/>
2626
<xi:include href="ch-projects.ptx"/>

0 commit comments

Comments
 (0)