Skip to content

Commit 38ce8f2

Browse files
committed
Add checkpoints to commit and push using custom plugin
1 parent 142d64a commit 38ce8f2

File tree

3 files changed

+61
-8
lines changed

3 files changed

+61
-8
lines changed

modules/05-sharing-and-publishing/index.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ We'll publish the website and PDF for free on GitHub, and enable automatic gener
4949
DOIs for our published product.
5050
:::
5151

52-
:::{note} TODOs
53-
:class: dropdown
54-
55-
* Add checkpoints to commit and push
56-
:::
57-
5852

5953
## What is MyST?
6054

@@ -162,6 +156,8 @@ process.
162156
::::::{hint} Joining late? You may need to clone the workshop repository
163157
:class: dropdown
164158

159+
Foo!
160+
165161
If you're joining late, you may have missed a prior instruction to clone the workshop
166162
website and set up GitHub authentication.
167163

@@ -440,7 +436,7 @@ site:
440436

441437
#### 🧪 Rebuild your site
442438

443-
**Save and rebuild your site.**
439+
Save and rebuild your site.
444440

445441
:::{important} 👀 You should notice...
446442
:class: simple
@@ -492,7 +488,7 @@ site:
492488

493489
#### 🧪 Rebuild your site
494490

495-
**Save and rebuild your site.**
491+
Save and rebuild your site.
496492

497493
:::{important} 👀 You should notice...
498494
:class: simple
@@ -502,6 +498,9 @@ site:
502498
chose for your logo text) instead of "Made with MyST".
503499
:::
504500

501+
:::{gitCommitCheckpoint} Initialize MyST site
502+
:::
503+
505504

506505
#### 🧠 What do we know now?
507506

@@ -682,13 +681,20 @@ Double-click `paper.pdf` in the JupyterLab file browser.
682681
There is a title page, a blank table of contents, and then your content on the 3rd page.
683682
:::
684683
684+
:::{gitCommitCheckpoint} Add PDF export
685+
:::
686+
687+
:::{note} Other PDF templates
688+
:class: dropdown
689+
685690
This document was rendered with the `"plain_typst_book"` template.
686691
Other PDF template options are available!
687692
688693
Try running `myst templates list --typst` to see a list of available templates.
689694
690695
More information is available on the
691696
[official MyST PDF-building documentation](https://mystmd.org/guide/creating-pdf-documents).
697+
:::
692698
693699
694700
#### 🧠 What do we know now?
@@ -767,6 +773,9 @@ browser.
767773
Select View > Show hidden files** from the menu.
768774
:::
769775

776+
:::{gitCommitCheckpoint} Set up publish with GitHub Actions
777+
:::
778+
770779

771780
#### 🧪 View the action results
772781

@@ -989,6 +998,9 @@ myst build --cff
989998
```
990999
:::
9911000

1001+
:::{gitCommitCheckpoint} Add CITATION.cff for Zenodo DOI
1002+
:::
1003+
9921004
As your project grows and changes, you can regenerate this file by repeating
9931005
that command.
9941006

myst.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ project:
77
# authors: []
88
license: "MIT"
99
github: "https://github.com/geojupyter/workshop-open-source-geospatial"
10+
plugins:
11+
- "plugin-custom-directives.mjs"
1012
error_rules:
1113
- rule: "doi-link-valid"
1214
severity: "warn"

plugin-custom-directives.mjs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
const gitCommitDirective = {
2+
name: "gitCommitCheckpoint",
3+
doc: "Renders a consistent callout when the learner should do a Git commit.",
4+
arg: {
5+
type: String,
6+
doc: "Commit message",
7+
},
8+
run(data) {
9+
return [{
10+
type: "block",
11+
children: [{
12+
type: "admonition",
13+
kind: "important",
14+
icon: false,
15+
children: [
16+
{
17+
type: "admonitionTitle",
18+
children: [{
19+
type: "text",
20+
value: "💾 Commit & push to GitHub",
21+
}],
22+
},
23+
{
24+
type: "code",
25+
lang: "bash",
26+
value: `git add .\ngit commit -m "${data.arg}"\ngit push -u origin main`,
27+
},
28+
],
29+
}],
30+
}]
31+
},
32+
};
33+
34+
const plugin = {
35+
name: "Our custom functionality",
36+
doc: "Custom functionality for this workshop website",
37+
directives: [gitCommitDirective],
38+
}
39+
export default plugin;

0 commit comments

Comments
 (0)