Skip to content

Conversation

@andrewnicols
Copy link
Member

The commit adds a new migratedPages.js module which includes a list of
legacy page to new page mappings.

When a legacy link in the Wikimedia internal link format is encountered,
it is checked against this list of migrated pages, and an updated page
URL is generated.

This value is notified to the Docusaurus CLI console, and the updated
link is used in the generated documentation.

@andrewnicols andrewnicols self-assigned this Apr 11, 2022
@andrewnicols andrewnicols added enhancement New feature or request migration Migration of a document from the legacy site labels Apr 11, 2022
@andrewnicols andrewnicols added this to the Migration day milestone Apr 11, 2022
@andrewnicols andrewnicols requested a review from sarjona April 11, 2022 14:24
@andrewnicols andrewnicols force-pushed the warnAboutMigratedPages branch from 6bafa9d to 212bf80 Compare April 11, 2022 15:30
@andrewnicols
Copy link
Member Author

To see this in use, add the id of a page from the old docs to the list of docs in migratedPages.js. See anywhere it's listed and the replacement.

@andrewnicols
Copy link
Member Author

Example output in the Docusaurus runner:

---
- Use of legacy docs link found for migrated doc
- File:  	 /Users/nicols/git/moodlehq/dinodevdocs/docs/guides/moodleapp/coding-style.md
- Found: 	 [[Coding style]]
- Replacement: 	 [/general/development/policies/codingstyle](Coding style)
---

---
- Use of legacy docs link found for migrated doc
- File:  	 /Users/nicols/git/moodlehq/dinodevdocs/general/development/process.md
- Found: 	 [[Tracker tips|Tips for searching tracker]]
- Replacement: 	 [../../process.md](Tips for searching tracker)
---

---
- Use of legacy docs link found for migrated doc
- File:  	 /Users/nicols/git/moodlehq/dinodevdocs/general/development/process.md
- Found: 	 [[Process#Stable_maintenance_cycles|minor release]]
- Replacement: 	 [#Stable-maintenance-cycles](minor release)
---

Copy link
Member

@sarjona sarjona left a comment

Choose a reason for hiding this comment

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

Hi Andrew! Thanks a lot for working on this. The patch is working as expected but, as you'll see, the replacement format is not the expected. It should be [Description](URL)

The commit adds a new migratedPages.js module which includes a list of
legacy page to new page mappings.

When a legacy link in the Wikimedia internal link format is encountered,
it is checked against this list of migrated pages, and an updated page
URL is generated.

This value is notified to the Docusaurus CLI console, and the updated
link is used in the generated documentation.
@andrewnicols andrewnicols force-pushed the warnAboutMigratedPages branch from 212bf80 to 5aa2f0d Compare April 12, 2022 06:33
@andrewnicols
Copy link
Member Author

Thanks Sara,

I keep making that stupid mistake. Fixed now.

Copy link
Member

@sarjona sarjona left a comment

Choose a reason for hiding this comment

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

Thanks Andrew! And here we go, one more feature in our road to migrate dev docs! <3

@sarjona sarjona merged commit a9792af into main Apr 12, 2022
@sarjona sarjona deleted the warnAboutMigratedPages branch April 12, 2022 06:37
github-merge-queue bot pushed a commit that referenced this pull request Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request migration Migration of a document from the legacy site

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants