Skip to content

Commit b70668f

Browse files
authored
Merge pull request #9 from VectorInstitute/create_schema
Create schema, add script to convert README to docs md
2 parents 047706a + c5447ac commit b70668f

File tree

10 files changed

+775
-314
lines changed

10 files changed

+775
-314
lines changed

.github/workflows/sync_readme.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: sync-readme
2+
permissions:
3+
contents: write
4+
pull-requests: write
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- 'README.md'
12+
- 'scripts/sync_readme_to_docs.py'
13+
- '.github/workflows/sync_readme.yml'
14+
pull_request:
15+
branches:
16+
- main
17+
paths:
18+
- 'README.md'
19+
- 'scripts/sync_readme_to_docs.py'
20+
- '.github/workflows/sync_readme.yml'
21+
workflow_dispatch: # Allow manual triggering
22+
23+
jobs:
24+
sync-readme:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout code
28+
uses: actions/[email protected]
29+
30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v5
32+
with:
33+
version: "0.6.13"
34+
enable-cache: true
35+
36+
- name: Set up Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: '3.12'
40+
41+
- name: Install dependencies
42+
run: uv sync --dev --group docs
43+
44+
- name: Run sync script
45+
run: python scripts/sync_readme_to_docs.py
46+
47+
- name: Check for changes
48+
id: git-check
49+
run: |
50+
git diff --quiet docs/index.md || echo "changes=true" >> $GITHUB_OUTPUT
51+
52+
- name: Setup Git
53+
if: steps.git-check.outputs.changes == 'true' && github.event_name == 'push'
54+
run: |
55+
git config user.name github-actions[bot]
56+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
57+
58+
- name: Commit changes
59+
if: steps.git-check.outputs.changes == 'true' && github.event_name == 'push'
60+
run: |
61+
git add docs/index.md
62+
git commit -m "docs: sync README.md reference implementations to docs/index.md
63+
64+
Automated update triggered by changes to README.md
65+
66+
[skip ci]"
67+
git push
68+
69+
- name: Comment on PR
70+
if: steps.git-check.outputs.changes == 'true' && github.event_name == 'pull_request'
71+
uses: actions/github-script@v7
72+
with:
73+
github-token: ${{ secrets.GITHUB_TOKEN }}
74+
script: |
75+
github.rest.issues.createComment({
76+
issue_number: context.issue.number,
77+
owner: context.repo.owner,
78+
repo: context.repo.repo,
79+
body: '✅ The reference implementations table has been updated in the PR preview. Changes will be automatically committed to docs/index.md when merged.'
80+
})
81+
82+
- name: Build docs for preview
83+
if: github.event_name == 'pull_request'
84+
run: uv run mkdocs build --clean
85+
86+
- name: Upload preview artifact
87+
if: github.event_name == 'pull_request'
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: docs-preview
91+
path: site/
92+
retention-days: 1

.typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ extend-ignore-re = [
99
Tak = "Tak"
1010
Yau = "Yau"
1111
DOTA = "DOTA"
12+
EHR = "EHR"

CONTRIBUTING.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,43 @@ Thank you for your interest in contributing to the Vector Institute Reference Im
44

55
## Adding a New Implementation
66

7-
If you are a Vector researcher or engineer and would like to add your implementation to this catalog, please follow these steps:
7+
The catalog is automatically synchronized between the README.md and the documentation site. If you are a Vector researcher or engineer and would like to add your implementation to this catalog, please follow these steps:
88

9-
1. Create a new entry in the appropriate year section of the `docs/index.md` file, following the existing format.
9+
1. **Add your implementation to the table in README.md** following the existing format
1010
2. Make sure to include:
1111
- Repository link
1212
- Short description
1313
- Tags for relevant technologies/algorithms
1414
- Information about datasets used
15+
- Year of publication
16+
17+
The documentation site (docs/index.md) will be automatically updated when your changes to README.md are merged.
18+
19+
## Automatic Synchronization
20+
21+
When you update README.md, a GitHub Actions workflow (`sync-readme.yml`) automatically:
22+
23+
1. Extracts the reference implementation table from README.md
24+
2. Updates the cards in docs/index.md to match
25+
3. Commits the changes to the repository
26+
27+
This ensures the documentation website always stays in sync with the README.md content.
28+
29+
## Manual Synchronization
30+
31+
If needed, you can manually run the synchronization script:
32+
33+
```bash
34+
python scripts/sync_readme_to_docs.py
35+
```
1536

1637
## Submitting Changes
1738

1839
To submit changes to this catalog:
1940

2041
1. Fork the repository
2142
2. Create a feature branch
22-
3. Make your changes
43+
3. Make your changes to README.md
2344
4. Submit a pull request
2445

2546
When submitting a PR, please fill out the PR template. If the PR fixes an issue, don't forget to link the PR to the issue!
@@ -32,6 +53,20 @@ We have templates available for:
3253

3354
Please use these templates when opening new issues to ensure all necessary information is provided.
3455

56+
## Building Documentation Locally
57+
58+
To build and preview the documentation locally:
59+
60+
```bash
61+
# Install dependencies using uv
62+
uv sync --group docs
63+
64+
# Serve the documentation
65+
uv run mkdocs serve
66+
```
67+
68+
Then visit http://localhost:8000 in your browser.
69+
3570
## Additional Information
3671

3772
For questions about contributing to the Reference Implementation Catalog, please reach out to the AI Engineering team at Vector Institute.

0 commit comments

Comments
 (0)