Skip to content

Add Preach My Gospel (PMG) auto-linking#2

Merged
coderkearns merged 1 commit intomasterfrom
copilot/add-preach-my-gospel-links
Mar 23, 2026
Merged

Add Preach My Gospel (PMG) auto-linking#2
coderkearns merged 1 commit intomasterfrom
copilot/add-preach-my-gospel-links

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

Adds detection and linking for Preach My Gospel references in notes, supporting all common shorthand formats: PMG 18, Preach My Gospel 18, PMG page 18, PMG pg. 18, PMG #18.

Changes

  • books.ts — Two new optional fields on ScriptureBook:

    • urlBase — overrides the default BASE_URL/volume/slug construction (needed since PMG lives under /study/manual/, not /study/scriptures/)
    • chapterPrefix — prepended to the chapter number in the URL path (e.g. "chapter-".../chapter-18)
    • New PMG entry with names ['Preach My Gospel', 'PMG']
  • parser.ts — Regex extended with an optional non-capturing group before the chapter number:

    (?:(?:page|pg\.)\s+|#\s*)?
    

    Handles page N, pg. N, and #N variants without affecting existing capture groups.

  • urlBuilder.tsbuildUrl now uses book.urlBase/book.chapterPrefix when present, falling back to existing behavior for all standard scripture books.

PMG references resolve to:

https://www.churchofjesuschrist.org/study/manual/preach-my-gospel-.../chapter-{n}?lang=eng

@coderkearns coderkearns marked this pull request as ready for review March 23, 2026 04:09
@coderkearns coderkearns merged commit 333c055 into master Mar 23, 2026
4 checks passed
@coderkearns coderkearns deleted the copilot/add-preach-my-gospel-links branch March 23, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants