Skip to content

Glossary generator with apa lookup#595

Draft
kaysiz wants to merge 11 commits intomasterfrom
ks-refactor-glossary-generator
Draft

Glossary generator with apa lookup#595
kaysiz wants to merge 11 commits intomasterfrom
ks-refactor-glossary-generator

Conversation

@kaysiz
Copy link
Collaborator

@kaysiz kaysiz commented Jan 26, 2026

Description

Fixes # (issue)

Type of Change

  • Documentation/Contents/grammar update
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Tested Locally
  • Manual review / previewed on staging.forrt.org content/webpage changes
  • Not Tested yet

Checklist for Content Editors and Non-Developers

  • The content is clear, accurate, and follows community guidelines.
  • All updated content has been previewed on the staging site.
  • All links, references, and formatting have been checked for correctness.
  • The change aligns with the overall style and communication goals.
  • No broken links in text/content

Checklist for Developers:

  • I have attempted to stay aligned to related code in this repository rather than reinventing the wheel.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

Additional Notes

@github-actions github-actions bot added content related Relevant to website content cicd Relevant to GitHub workflows labels Jan 26, 2026
@github-actions
Copy link
Contributor

✅ Spell Check Passed

No spelling issues found in this PR! 🎉

@github-actions
Copy link
Contributor

👍 All image files/references (if any) are in webp format, in line with our policy.

@kaysiz kaysiz requested a review from LukasWallrich January 27, 2026 08:47
@kaysiz kaysiz self-assigned this Jan 27, 2026
@github-actions
Copy link
Contributor

✅ Spell Check Passed

No spelling issues found in this PR! 🎉

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json as a citation-key → APA-formatted reference lookup.
  • Refactored content/glossary/_create_glossaries.py to 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.

Comment on lines 76 to 80
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`);
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.

# Load APA lookup
try:
with open('apa_lookup.json', 'r') as f:
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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').

Suggested change
with open('apa_lookup.json', 'r') as f:
with open(os.path.join(script_dir, 'apa_lookup.json'), 'r', encoding='utf-8') as f:

Copilot uses AI. Check for mistakes.
with:
node-version: '18'
cache: 'npm'

Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
cache-dependency-path: bibtex_to_apa/package-lock.json

Copilot uses AI. Check for mistakes.
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'
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
node bibtex-to-apa.js -o '../content/glossary/apa_lookup.json'
node bibtex_to_apa.js -o '../content/glossary/apa_lookup.json'

Copilot uses AI. Check for mistakes.
if column in row.index and pd.notna(row[column]):
return str(row[column]).strip()
return default
except:
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except block directly handles BaseException.

Suggested change
except:
except Exception:

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

✅ Spell Check Passed

No spelling issues found in this PR! 🎉

1 similar comment
@github-actions
Copy link
Contributor

✅ Spell Check Passed

No spelling issues found in this PR! 🎉

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

✅ Spell Check Passed

No spelling issues found in this PR! 🎉

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

✅ Spell Check Passed

No spelling issues found in this PR! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cicd Relevant to GitHub workflows content related Relevant to website content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant