Skip to content

Commit 601e484

Browse files
committed
Merge branch 'master' into v1
2 parents e4c9d19 + 34d796a commit 601e484

File tree

14 files changed

+165
-130
lines changed

14 files changed

+165
-130
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,17 @@ jobs:
1414
- name: Download source
1515
uses: actions/checkout@v4
1616
- name: Install Python
17-
uses: actions/setup-python@v4
17+
uses: actions/setup-python@v5
1818
with:
1919
python-version: '3.11'
2020
- name: Install dependencies
21-
run: pip install --no-deps -r docs/requirements.txt
21+
run: pip install --no-deps -r requirements/requirements-docs.txt
2222
- name: Fetch branch
2323
run: git fetch origin v1:v1
2424
- name: Build site
25-
run: mkdocs build
26-
working-directory: docs
25+
run: mkdocs build -f docs/mkdocs.yml --strict
2726
- name: Upload to GitHub Pages
28-
uses: actions/upload-pages-artifact@v2
27+
uses: actions/upload-pages-artifact@v3
2928
with:
3029
path: site
3130
deploy:
@@ -38,7 +37,7 @@ jobs:
3837
steps:
3938
- name: Deploy to GitHub Pages
4039
id: deployment
41-
uses: actions/deploy-pages@v2
40+
uses: actions/deploy-pages@v4
4241
environment:
4342
name: github-pages
4443
url: ${{ steps.deployment.outputs.page_url }}

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,16 @@ jobs:
2727
exclude:
2828
- os: windows-latest
2929
config: {shards: '0.12.0', crystal: '0.35.1'}
30+
- os: macos-latest
31+
config: {shards: '0.12.0', crystal: '0.35.1'}
3032

3133
name: crystal ${{ matrix.config.crystal }} + shards ${{ matrix.config.shards }} (${{ matrix.os }})
3234
runs-on: ${{ matrix.os }}
3335
defaults:
3436
run:
3537
shell: bash
3638
steps:
37-
- uses: actions/checkout@v3
39+
- uses: actions/checkout@v4
3840
- run: npm install --only=prod
3941
- uses: ./
4042
with: ${{ matrix.config }}

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
exclude:
2828
- os: windows-latest
2929
config: {shards: '0.12.0', crystal: '0.35.1'}
30+
- os: macos-latest
31+
config: {shards: '0.12.0', crystal: '0.35.1'}
3032

3133
name: crystal ${{ matrix.config.crystal }} + shards ${{ matrix.config.shards }} (${{ matrix.os }})
3234
runs-on: ${{ matrix.os }}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ steps:
1919
2020
```yaml
2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323
- uses: crystal-lang/install-crystal@v1
2424
with:
25-
crystal: 1.2
25+
crystal: 1.11
2626
- run: shards install
2727
- run: crystal spec
2828
```
@@ -41,7 +41,7 @@ steps:
4141
- uses: crystal-lang/install-crystal@v1
4242
with:
4343
crystal: ${{matrix.crystal}}
44-
- uses: actions/checkout@v3
44+
- uses: actions/checkout@v4
4545
- run: shards install
4646
- run: crystal spec
4747
- run: crystal tool format && git diff --exit-code

docs/configurator.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
{%- endif %}
8686
steps:
8787
- name: Download source
88-
uses: actions/checkout@v3
88+
uses: actions/checkout@v4
8989
- name: Install Crystal
9090
uses: crystal-lang/install-crystal@v1
9191
{%- if crystal_nightly or crystal_ver %}
@@ -94,7 +94,7 @@ jobs:
9494
{%- endif %}
9595
{%- if cache_shards %}
9696
- name: Cache shards
97-
uses: actions/cache@v3
97+
uses: actions/cache@v4
9898
with:
9999
{%- if is_app %}
100100
path: lib
@@ -159,10 +159,10 @@ var fixedRef = document.getElementById('fixed-ref');
159159

160160
function fixedRefChange() {
161161
var codes = document.querySelectorAll('.configurator .hljs-string');
162-
var rev = fixedRef.checked ? '{{ latest_rev }}' : 'v1';
162+
var rev = fixedRef.checked ? '{{ latest_rev }} # {{ latest_tag }}' : 'v1';
163163
for (var i = 0; i < codes.length; ++i) {
164164
if (codes[i].innerHTML.includes('install-crystal')) {
165-
codes[i].innerHTML = codes[i].innerHTML.replace(/@\w+/g, '@' + rev);
165+
codes[i].innerHTML = codes[i].innerHTML.replace(/@\w+.*/g, '@' + rev);
166166
}
167167
}
168168
}

docs/gen_pages.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
import subprocess
2+
13
import mkdocs_gen_files
4+
import jinja2
5+
26

37
with mkdocs_gen_files.open("assets/style.css", "a") as f:
48
f.write(
@@ -10,3 +14,12 @@
1014
)
1115
+ " {\n display: none;\n}\n"
1216
)
17+
18+
with mkdocs_gen_files.open("configurator.md", "r") as f:
19+
content = f.read()
20+
content = jinja2.Template(content).render(
21+
latest_rev=subprocess.check_output("git rev-parse v1".split(), encoding="utf-8").strip(),
22+
latest_tag=subprocess.check_output("git describe --exact-match v1".split(), encoding="utf-8").strip(),
23+
)
24+
with mkdocs_gen_files.open("configurator.md", "w") as f:
25+
f.write(content)

docs/main.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/mkdocs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ theme:
1414
scheme: preference
1515
primary: black
1616
accent: purple
17+
features:
18+
- content.action.edit
1719

1820
extra_css:
1921
- assets/style.css
@@ -23,7 +25,6 @@ extra_javascript:
2325

2426
plugins:
2527
- search
26-
- macros
2728
- same-dir
2829
- gen-files:
2930
scripts:
@@ -37,6 +38,9 @@ markdown_extensions:
3738
- pymdownx.details
3839
- pymdownx.snippets:
3940
check_paths: true
41+
restrict_base_path: false
42+
base_path:
43+
- !relative $docs_dir
4044
- admonition
4145
- def_list
4246
- toc:

docs/requirements.in

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/requirements.txt

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)