Skip to content

Commit b108629

Browse files
authored
Move tutorial to Jekyll website (#613)
Resolves #577 Moves template tutorial under website `docs/pages` directory and updates internal links to point to new location. To get GFM admonitions to render on Jekyll site also adds [jekyll-gdm-admonitions](https://github.com/Helveg/jekyll-gfm-admonitions) plugin as a new dependency on site config and Gemfile. As an alternative we could use the [built-in support for callouts / admonitions in the Just the Docs theme](https://just-the-docs.com/docs/ui-components/callouts/). This would then no longer render on GitHub though. I have currently updated the link on main README to still be version on GitHub rather than rendered website - not sure if we want to change this or not. The additional attributes on `<details>` / `<summary>` tags are taken from [this blog post](https://rolandtanglao.com/2024/11/02/p1-collapsible-sections-details-html-tag-test/).
1 parent b7f676e commit b108629

7 files changed

Lines changed: 24 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Python packages with our recommended tooling set up and ready to go.
2323
## Using our Python package template
2424

2525
Some quick instructions for using our template are below.
26-
We also have a longer [tutorial](./tutorial.md) that has been presented in workshops for researchers at UCL.
26+
We also have a longer [tutorial](./docs/pages/tutorial.md) that has been presented in workshops for researchers at UCL.
2727
Slides from presentations we have given on the project are available in the
2828
[`python-tooling-presentations` repository](https://github.com/ucl-arc/python-tooling-presentations).
2929

docs/Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ gem 'jekyll', '~>4'
44

55
group :jekyll_plugins do
66
gem 'just-the-docs','~>0'
7+
gem 'jekyll-gfm-admonitions', '~>1.2'
78
end

docs/Gemfile.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ GEM
77
bigdecimal (3.1.9)
88
colorator (1.1.0)
99
concurrent-ruby (1.3.5)
10+
cssminify (1.0.2)
1011
csv (3.3.4)
1112
em-websocket (0.5.3)
1213
eventmachine (>= 0.12.9)
@@ -64,6 +65,10 @@ GEM
6465
safe_yaml (~> 1.0)
6566
terminal-table (>= 1.8, < 4.0)
6667
webrick (~> 1.7)
68+
jekyll-gfm-admonitions (1.2.0)
69+
cssminify (~> 1.0)
70+
jekyll (>= 3.0, < 5.0)
71+
octicons (~> 19.8)
6772
jekyll-include-cache (0.2.1)
6873
jekyll (>= 3.7, < 5.0)
6974
jekyll-sass-converter (3.1.0)
@@ -87,6 +92,7 @@ GEM
8792
rb-fsevent (~> 0.10, >= 0.10.3)
8893
rb-inotify (~> 0.9, >= 0.9.10)
8994
mercenary (0.4.0)
95+
octicons (19.21.2)
9096
pathutil (0.16.2)
9197
forwardable-extended (~> 2.6)
9298
public_suffix (6.0.2)
@@ -166,6 +172,7 @@ PLATFORMS
166172

167173
DEPENDENCIES
168174
jekyll (~> 4)
175+
jekyll-gfm-admonitions (~> 1.2)
169176
just-the-docs (~> 0)
170177

171178
BUNDLED WITH

docs/_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ aux_links:
1313
aux_links_new_tab: true
1414

1515
logo: "https://raw.githubusercontent.com/UCL-ARC/python-tooling/main/images/logo.svg"
16+
17+
plugins:
18+
- jekyll-gfm-admonitions

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ other packages.
3333
If you just want to get started with our recommendations, we have
3434
[our own Python package template](https://github.com/UCL-ARC/python-tooling#using-this-template)
3535
that lives in the same repository as these pages.
36+
A [tutorial]({% link pages/tutorial.md %}) explaining how to use the template is also available.
3637

3738
Otherwise, each page on this site highlights recommended packages or services
3839
for each area. These should not be taken as set in stone for every project, but

docs/pages/templates.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Templates
33
layout: default
4-
nav_order: 2
4+
nav_order: 3
55
---
66

77
## Package templates
@@ -12,7 +12,7 @@ The [UCL-ARC/python-tooling](https://github.com/UCL-ARC/python-tooling)
1212
repository contains our recommended package template for new ARC projects. It
1313
pre-configures the recommended tools listed in the other pages of this site. If
1414
you are working on a new project, our template should be a good starting point!
15-
We have a [tutorial](https://github.com/UCL-ARC/python-tooling/blob/main/tutorial.md)
15+
We have a [tutorial]({% link pages/tutorial.md %})
1616
available with detailed instructions for creating a package using the template
1717
and how to use the newly created package with some of the tools included.
1818

tutorial.md renamed to docs/pages/tutorial.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Tutorial: creating a package using our template
1+
---
2+
title: Template tutorial
3+
layout: default
4+
nav_order: 2
5+
---
6+
7+
## Tutorial: creating a package using our template
28

39
In this tutorial, we will go through the steps to set up a Python package using the `UCL-ARC/python-tooling` 🍪 cookiecutter template.
410
We'll also show you how to use your new package with some of the tools included.
@@ -10,7 +16,7 @@ We'll also show you how to use your new package with some of the tools included.
1016
1117
## ⚙️ Prerequisites for using the template
1218

13-
<details><summary>Click to expand… </summary> <!-- markdownlint-disable-line MD033 -->
19+
<details markdown="1"><summary markdown="span">Click to expand… </summary> <!-- markdownlint-disable-line MD033 -->
1420

1521
To use the template you'll need the following software:
1622

@@ -298,7 +304,7 @@ uv sync --all-groups
298304

299305
from the root of the project repository. Note that `uv>=0.6.7` is required to use the `--group` option.
300306

301-
<details><summary>Using venv as an alternative to uv </summary> <!-- markdownlint-disable-line MD033 -->
307+
<details markdown="1"><summary markdown="span">Using venv as an alternative to uv </summary> <!-- markdownlint-disable-line MD033 -->
302308

303309
Alternatively, you can use the [`venv` module](https://docs.python.org/3/library/venv.html), which is slower and has fewer features, when compared to `uv`, but is built-in to the Python standard library. `venv` has the advantage of being available in any Python (3.3+) environment, but unlike `uv` will not by itself allow you to use a different Python version from the system level install. A common pattern is to store the virtual environment files in a directory `.venv` within the root directory of the project repository. This can be achieved by running
304310

0 commit comments

Comments
 (0)