Conversation
✅ Spell Check PassedNo spelling issues found in this PR! 🎉 |
|
👍 All image files/references (if any) are in webp format, in line with our policy. |
✅ Spell Check PassedNo spelling issues found in this PR! 🎉 |
There was a problem hiding this comment.
Pull request overview
Adds an APA-reference lookup workflow and updates glossary generation to use it when producing glossary entry files.
Changes:
- Added
content/glossary/apa_lookup.jsonas a citation-key → APA-formatted reference lookup. - Refactored
content/glossary/_create_glossaries.pyto pull glossary data from a Google Sheets CSV export and format references via the APA lookup. - Added a Node.js utility (
bibtex_to_apa/) and CI workflow steps to generate/update the APA lookup during data processing.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| content/glossary/apa_lookup.json | New citation-key → APA reference mapping used during glossary generation. |
| content/glossary/_create_glossaries.py | New glossary generation pipeline that reads a sheet export and formats references using the APA lookup. |
| bibtex_to_apa/package.json | Adds dependencies for converting BibTeX to APA via citation-js. |
| bibtex_to_apa/package-lock.json | Lockfile for the bibtex→APA conversion tool dependencies. |
| bibtex_to_apa/bibtex_to_apa.js | Node script to fetch BibTeX and emit apa_lookup.json. |
| .github/workflows/data-processing.yml | Installs Node deps and runs the bibtex→APA generation step in CI. |
Files not reviewed (1)
- bibtex_to_apa/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bibtex_to_apa/bibtex_to_apa.js
Outdated
| console.log(`Usage: node bibtex-to-apa.js [-i INPUT] [-o OUTPUT] [--no-url] | ||
| Options: | ||
| -i, --input Input BibTeX (URL or file). Default: Google Doc | ||
| -o, --output Output JSON file. Default: apa_lookup.json | ||
| --no-url Don't append URLs to references`); |
There was a problem hiding this comment.
The help/usage text references node bibtex-to-apa.js, but the actual script filename in this repo is bibtex_to_apa.js. This mismatch makes the CLI guidance incorrect; update the usage string (or rename the script to match the documented name).
|
|
||
| # Load APA lookup | ||
| try: | ||
| with open('apa_lookup.json', 'r') as f: |
There was a problem hiding this comment.
apa_lookup.json is opened via a relative path, so running this script from the repo root (as the workflow does with python3 content/glossary/_create_glossaries.py) will not find the file and references won’t be formatted. Use os.path.join(script_dir, 'apa_lookup.json') (and consider specifying encoding='utf-8').
| with open('apa_lookup.json', 'r') as f: | |
| with open(os.path.join(script_dir, 'apa_lookup.json'), 'r', encoding='utf-8') as f: |
| with: | ||
| node-version: '18' | ||
| cache: 'npm' | ||
|
|
There was a problem hiding this comment.
actions/setup-node caching is configured with cache: 'npm' but without cache-dependency-path, so it will default to a root package-lock.json and likely miss caching for bibtex_to_apa/. Set cache-dependency-path: bibtex_to_apa/package-lock.json (and include any other lockfiles you want cached).
| cache-dependency-path: bibtex_to_apa/package-lock.json |
| continue-on-error: true # Continue even if this step fails | ||
| run: | | ||
| cd bibtex_to_apa | ||
| node bibtex-to-apa.js -o '../content/glossary/apa_lookup.json' |
There was a problem hiding this comment.
This step calls node bibtex-to-apa.js, but the committed script file is bibtex_to_apa/bibtex_to_apa.js. As written, the command will fail (and then be silently ignored due to continue-on-error). Update the command to use the correct filename (or rename the script to match).
| node bibtex-to-apa.js -o '../content/glossary/apa_lookup.json' | |
| node bibtex_to_apa.js -o '../content/glossary/apa_lookup.json' |
| if column in row.index and pd.notna(row[column]): | ||
| return str(row[column]).strip() | ||
| return default | ||
| except: |
There was a problem hiding this comment.
Except block directly handles BaseException.
| except: | |
| except Exception: |
…ect/forrtproject.github.io into ks-refactor-glossary-generator
✅ Spell Check PassedNo spelling issues found in this PR! 🎉 |
1 similar comment
✅ Spell Check PassedNo spelling issues found in this PR! 🎉 |
✅ Spell Check PassedNo spelling issues found in this PR! 🎉 |
✅ Spell Check PassedNo spelling issues found in this PR! 🎉 |
Description
Fixes # (issue)
Type of Change
How Has This Been Tested?
Checklist for Content Editors and Non-Developers
Checklist for Developers:
Additional Notes