Skip to content

Commit

Permalink
Convert MediaWiki redirects, add script for that
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroSkill1 authored and neobrain committed Sep 27, 2024
1 parent cddbdd0 commit d4c3a5e
Show file tree
Hide file tree
Showing 301 changed files with 617 additions and 616 deletions.
17 changes: 17 additions & 0 deletions 08_convert_redirects.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
for i in $(grep -rl "REDIRECT" ./content); do
# get frontmatter of page
frontmatter="$(cat "$i" | head -n$(grep '+++' -n "$i" | tail -n 1 | cut -d: -f1) | head -n-1)";
# extract target page from MediaWiki REDIRECT thing,
target_page="$(perl -0777 -pe 's,(?:.|\n)*REDIRECT(?:\s|\n)*(?:\[(?:[\s\S]*?)\])\((.*) "wikilink"\)(?:.|\n)*,\1,g' $i)"

# rewrite page to be placeholder with BookHref for automatic redirect
cat > "$i" << EOL
$frontmatter
BookHref = '../${target_page}'
+++
$target_page
EOL

echo "Processed $i -> $target_page";
done;
3 changes: 2 additions & 1 deletion content/3DSLL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = '3DSLL'
BookHref = '../New_3DS'
+++

1. REDIRECT [New 3DS](New_3DS "wikilink")
New_3DS
3 changes: 2 additions & 1 deletion content/3DSViewer.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = '3DSViewer'
BookHref = '../3DSExplorer'
+++

1. REDIRECT [3DSExplorer](3DSExplorer "wikilink")
3DSExplorer
3 changes: 2 additions & 1 deletion content/3DS_exploits.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = '3DS Exploits'
BookHref = '../3DS_System_Flaws'
+++

1. REDIRECT [3DS System Flaws](3DS_System_Flaws "wikilink")
3DS_System_Flaws
3 changes: 2 additions & 1 deletion content/9.0.0-?.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = '9.0.0 ?'
BookHref = '../9.0.0-20'
+++

1. REDIRECT [9.0.0-20](9.0.0-20 "wikilink")
9.0.0-20
3 changes: 2 additions & 1 deletion content/AES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AES'
BookHref = '../AES_Registers'
+++

1. REDIRECT [AES Registers](AES_Registers "wikilink")
AES_Registers
4 changes: 2 additions & 2 deletions content/AM.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM'
BookHref = '../Application_Manager_Services'
+++

1. REDIRECT [Application Manager
Services](Application_Manager_Services "wikilink")
Application_Manager_Services
3 changes: 2 additions & 1 deletion content/AM:AbortCIAInstall.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:AbortCIAInstall'
BookHref = '../AM:CancelImportProgram'
+++

1. REDIRECT [AM:CancelImportProgram](AM:CancelImportProgram "wikilink")
AM:CancelImportProgram
4 changes: 2 additions & 2 deletions content/AM:CloseCIA.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:CloseCIA'
BookHref = '../AM:EndImportProgramWithoutCommit'
+++

1. REDIRECT
[AM:EndImportProgramWithoutCommit](AM:EndImportProgramWithoutCommit "wikilink")
AM:EndImportProgramWithoutCommit
3 changes: 2 additions & 1 deletion content/AM:CloseCIAFinalizeInstall.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:CloseCIAFinalizeInstall'
BookHref = '../AM:EndImportProgram'
+++

1. REDIRECT [AM:EndImportProgram](AM:EndImportProgram "wikilink")
AM:EndImportProgram
4 changes: 2 additions & 2 deletions content/AM:DeleteAllPendingTitles.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:DeleteAllPendingTitles'
BookHref = '../AM:DeleteAllImportContexts'
+++

1. REDIRECT
[AM:DeleteAllImportContexts](AM:DeleteAllImportContexts "wikilink")
AM:DeleteAllImportContexts
3 changes: 2 additions & 1 deletion content/AM:DeleteApplicationTitle.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:DeleteApplicationTitle'
BookHref = '../AM:DeleteUserProgram'
+++

1. REDIRECT [AM:DeleteUserProgram](AM:DeleteUserProgram "wikilink")
AM:DeleteUserProgram
3 changes: 2 additions & 1 deletion content/AM:DeleteContents.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:DeleteContents'
BookHref = '../AM:DeleteDLCContents'
+++

1. REDIRECT [AM:DeleteDLCContents](AM:DeleteDLCContents "wikilink")
AM:DeleteDLCContents
4 changes: 2 additions & 2 deletions content/AM:DeletePendingSystemTitles.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:DeletePendingSystemTitles'
BookHref = '../AM:DeleteAllPendingTitles'
+++

1. REDIRECT
[AM:DeleteAllPendingTitles](AM:DeleteAllPendingTitles "wikilink")
AM:DeleteAllPendingTitles
4 changes: 2 additions & 2 deletions content/AM:DeletePendingTitle.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:DeletePendingTitle'
BookHref = '../AM:DeleteImportTitleContext'
+++

1. REDIRECT
[AM:DeleteImportTitleContext](AM:DeleteImportTitleContext "wikilink")
AM:DeleteImportTitleContext
4 changes: 2 additions & 2 deletions content/AM:DeletePendingTitles.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:DeletePendingTitles'
BookHref = '../AM:DeleteAllImportContextsFiltered'
+++

1. REDIRECT
[AM:DeleteAllImportContextsFiltered](AM:DeleteAllImportContextsFiltered "wikilink")
AM:DeleteAllImportContextsFiltered
3 changes: 2 additions & 1 deletion content/AM:DeleteTitle.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:DeleteTitle'
BookHref = '../AM:DeleteProgram'
+++

1. REDIRECT [AM:DeleteProgram](AM:DeleteProgram "wikilink")
AM:DeleteProgram
3 changes: 2 additions & 1 deletion content/AM:ExportDSiWare.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:ExportDSiWare'
BookHref = '../AM:ExportTwlBackup'
+++

1. REDIRECT [AM:ExportTwlBackup](AM:ExportTwlBackup "wikilink")
AM:ExportTwlBackup
4 changes: 2 additions & 2 deletions content/AM:FinalizeInstallCIA.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:FinalizeInstallCIA'
BookHref = '../AM:FinalizeTitlesInstall'
+++

1. REDIRECT
[AM:FinalizeTitlesInstall](AM:FinalizeTitlesInstall "wikilink")
AM:FinalizeTitlesInstall
3 changes: 2 additions & 1 deletion content/AM:FinalizePendingTitles.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:FinalizePendingTitles'
BookHref = '../AM:DoCleanup'
+++

1. REDIRECT [AM:DoCleanup](AM:DoCleanup "wikilink")
AM:DoCleanup
4 changes: 2 additions & 2 deletions content/AM:FinalizeTitlesInstall.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:FinalizeTitlesInstall'
BookHref = '../AM:CommitImportPrograms'
+++

1. REDIRECT
[AM:CommitImportPrograms](AM:CommitImportPrograms "wikilink")
AM:CommitImportPrograms
3 changes: 2 additions & 1 deletion content/AM:FindContentInfos.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:FindContentInfos'
BookHref = '../AM:FindDLCContentInfos'
+++

1. REDIRECT [AM:FindDLCContentInfos](AM:FindDLCContentInfos "wikilink")
AM:FindDLCContentInfos
4 changes: 2 additions & 2 deletions content/AM:FinishInstallToMedia.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:FinishInstallToMedia'
BookHref = '../AM:FinalizePendingTitles'
+++

1. REDIRECT
[AM:FinalizePendingTitles](AM:FinalizePendingTitles "wikilink")
AM:FinalizePendingTitles
4 changes: 2 additions & 2 deletions content/AM:GetCiaCoreVersion.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:GetCiaCoreVersion'
BookHref = '../AM:GetCoreVersionFromCia'
+++

1. REDIRECT
[AM:GetCoreVersionFromCia](AM:GetCoreVersionFromCia "wikilink")
AM:GetCoreVersionFromCia
4 changes: 2 additions & 2 deletions content/AM:GetCiaDependencies.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:GetCiaDependencies'
BookHref = '../AM:GetDependencyListFromCia'
+++

1. REDIRECT
[AM:GetDependencyListFromCia](AM:GetDependencyListFromCia "wikilink")
AM:GetDependencyListFromCia
4 changes: 2 additions & 2 deletions content/AM:GetCiaFileInfo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:GetCiaFileInfo'
BookHref = '../AM:GetProgramInfoFromCia'
+++

1. REDIRECT
[AM:GetProgramInfoFromCia](AM:GetProgramInfoFromCia "wikilink")
AM:GetProgramInfoFromCia
4 changes: 2 additions & 2 deletions content/AM:GetCiaIcon.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:GetCiaIcon'
BookHref = '../AM:GetSystemMenuDataFromCia'
+++

1. REDIRECT
[AM:GetSystemMenuDataFromCia](AM:GetSystemMenuDataFromCia "wikilink")
AM:GetSystemMenuDataFromCia
4 changes: 2 additions & 2 deletions content/AM:GetCiaMetaOffset.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:GetCiaMetaOffset'
BookHref = '../AM:GetTransferSizeFromCia'
+++

1. REDIRECT
[AM:GetTransferSizeFromCia](AM:GetTransferSizeFromCia "wikilink")
AM:GetTransferSizeFromCia
3 changes: 2 additions & 1 deletion content/AM:GetCiaMetaSection.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:GetCiaMetaSection'
BookHref = '../AM:GetMetaDataFromCia'
+++

1. REDIRECT [AM:GetMetaDataFromCia](AM:GetMetaDataFromCia "wikilink")
AM:GetMetaDataFromCia
3 changes: 2 additions & 1 deletion content/AM:GetCiaMetaSize.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:GetCiaMetaSize'
BookHref = '../AM:GetMetaSizeFromCia'
+++

1. REDIRECT [AM:GetMetaSizeFromCia](AM:GetMetaSizeFromCia "wikilink")
AM:GetMetaSizeFromCia
4 changes: 2 additions & 2 deletions content/AM:GetCiaRequiredSpace.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:GetCiaRequiredSpace'
BookHref = '../AM:GetRequiredSizeFromCia'
+++

1. REDIRECT
[AM:GetRequiredSizeFromCia](AM:GetRequiredSizeFromCia "wikilink")
AM:GetRequiredSizeFromCia
3 changes: 2 additions & 1 deletion content/AM:GetDSiWareExportSize.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:GetDSiWareExportSize'
BookHref = '../AM:CalcTwlBackupSize'
+++

1. REDIRECT [AM:CalcTwlBackupSize](AM:CalcTwlBackupSize "wikilink")
AM:CalcTwlBackupSize
3 changes: 2 additions & 1 deletion content/AM:GetDataTitleInfos.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:GetDataTitleInfos'
BookHref = '../AM:GetDLCTitleInfos'
+++

1. REDIRECT [AM:GetDLCTitleInfos](AM:GetDLCTitleInfos "wikilink")
AM:GetDLCTitleInfos
4 changes: 2 additions & 2 deletions content/AM:GetItemRights.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:GetItemRights'
BookHref = '../AM:GetDLCOrLicenseItemRights'
+++

1. REDIRECT
[AM:GetDLCOrLicenseItemRights](AM:GetDLCOrLicenseItemRights "wikilink")
AM:GetDLCOrLicenseItemRights
4 changes: 2 additions & 2 deletions content/AM:GetNumContentInfos.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:GetNumContentInfos'
BookHref = '../AM:GetDLCContentInfoCount'
+++

1. REDIRECT
[AM:GetDLCContentInfoCount](AM:GetDLCContentInfoCount "wikilink")
AM:GetDLCContentInfoCount
4 changes: 2 additions & 2 deletions content/AM:GetNumDataTitleTickets.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:GetNumDataTitleTickets'
BookHref = '../AM:GetDLCOrLicenseNumTickets'
+++

1. REDIRECT
[AM:GetDLCOrLicenseNumTickets](AM:GetDLCOrLicenseNumTickets "wikilink")
AM:GetDLCOrLicenseNumTickets
4 changes: 2 additions & 2 deletions content/AM:GetNumExistingContentInfosSystem.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:GetNumExistingContentInfosSystem'
BookHref = '../AM:GetNumExistingContentInfos'
+++

1. REDIRECT
[AM:GetNumExistingContentInfos](AM:GetNumExistingContentInfos "wikilink")
AM:GetNumExistingContentInfos
4 changes: 2 additions & 2 deletions content/AM:GetPendingTitleCount.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:GetPendingTitleCount'
BookHref = '../AM:GetNumImportTitleContextsFiltered'
+++

1. REDIRECT
[AM:GetNumImportTitleContextsFiltered](AM:GetNumImportTitleContextsFiltered "wikilink")
AM:GetNumImportTitleContextsFiltered
4 changes: 2 additions & 2 deletions content/AM:GetPendingTitleInfo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:GetPendingTitleInfo'
BookHref = '../AM:GetImportTitleContexts'
+++

1. REDIRECT
[AM:GetImportTitleContexts](AM:GetImportTitleContexts "wikilink")
AM:GetImportTitleContexts
4 changes: 2 additions & 2 deletions content/AM:GetPendingTitleList.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:GetPendingTitleList'
BookHref = '../AM:GetImportTitleContextListFiltered'
+++

1. REDIRECT
[AM:GetImportTitleContextListFiltered](AM:GetImportTitleContextListFiltered "wikilink")
AM:GetImportTitleContextListFiltered
4 changes: 2 additions & 2 deletions content/AM:GetTWLPartitionInfo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'AM:GetTWLPartitionInfo'
BookHref = '../AM:GetTwlArchiveResourceInfo'
+++

1. REDIRECT
[AM:GetTwlArchiveResourceInfo](AM:GetTwlArchiveResourceInfo "wikilink")
AM:GetTwlArchiveResourceInfo
3 changes: 2 additions & 1 deletion content/AM:GetTicketCount.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:GetTicketCount'
BookHref = '../AM:GetNumTickets'
+++

1. REDIRECT [AM:GetNumTickets](AM:GetNumTickets "wikilink")
AM:GetNumTickets
3 changes: 2 additions & 1 deletion content/AM:GetTitleCount.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:GetTitleCount'
BookHref = '../AM:GetNumPrograms'
+++

1. REDIRECT [AM:GetNumPrograms](AM:GetNumPrograms "wikilink")
AM:GetNumPrograms
3 changes: 2 additions & 1 deletion content/AM:GetTitleExtDataId.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:GetTitleExtDataId'
BookHref = '../AM:GetStorageId'
+++

1. REDIRECT [AM:GetStorageId](AM:GetStorageId "wikilink")
AM:GetStorageId
3 changes: 2 additions & 1 deletion content/AM:GetTitleInfo.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = 'AM:GetTitleInfo'
BookHref = '../AM:GetProgramInfos'
+++

1. REDIRECT [AM:GetProgramInfos](AM:GetProgramInfos "wikilink")
AM:GetProgramInfos
Loading

0 comments on commit d4c3a5e

Please sign in to comment.