Skip to content

Conversation

@adegeo
Copy link
Contributor

@adegeo adegeo commented Aug 3, 2021

This is going into the working branch. This used a find replace powershell script I wrote to pipe files for processing. This was only processed in the essentials folder, so the replacement relative path is correct.

Find the include references

dir *.md | select-string "include[]" -SimpleMatch | select line -Unique

Line
----
[!include[](~/essentials/includes/get-started.md)]
[!include[](~/essentials/includes/sensor-speed.md)]
[!include[](~/essentials/includes/xamarin-show-essentials.md)]
[!include[](~/essentials/includes/tip-file-result.md)]
[!include[](~/essentials/includes/android-permissions.md)]
[!include[](~/essentials/includes/ios-PresentationSourceBounds.md)]

I then used the docs extension in VSCode to generate the format for the includes (which uses relative pathing):

[!INCLUDE [get-started](includes/get-started.md)]
[!INCLUDE [sensor-speed](includes/sensor-speed.md)]
[!INCLUDE [xamarin-show-essentials](includes/xamarin-show-essentials.md)]
[!INCLUDE [tip-file-result](includes/tip-file-result.md)]
[!INCLUDE [android-permissions](includes/android-permissions.md)]
[!INCLUDE [ios-PresentationSourceBounds](includes/ios-PresentationSourceBounds.md)]

Find/Replace

dir *.md | Replace-TextInFile -Pattern "[!include[](~/essentials/includes/get-started.md)]" -Replacement "[!INCLUDE [get-started](includes/get-started.md)]" -Simple
dir *.md | Replace-TextInFile -Pattern "[!include[](~/essentials/includes/sensor-speed.md)]" -Replacement "[!INCLUDE [sensor-speed](includes/sensor-speed.md)]" -Simple
dir *.md | Replace-TextInFile -Pattern "[!include[](~/essentials/includes/xamarin-show-essentials.md)]" -Replacement "[!INCLUDE [xamarin-show-essentials](includes/xamarin-show-essentials.md)]" -Simple
dir *.md | Replace-TextInFile -Pattern "[!include[](~/essentials/includes/tip-file-result.md)]" -Replacement "[!INCLUDE [tip-file-result](includes/tip-file-result.md)]" -Simple
dir *.md | Replace-TextInFile -Pattern "[!include[](~/essentials/includes/android-permissions.md)]" -Replacement "[!INCLUDE [android-permissions](includes/android-permissions.md)]" -Simple
dir *.md | Replace-TextInFile -Pattern "[!include[](~/essentials/includes/ios-PresentationSourceBounds.md)]" -Replacement "[!INCLUDE [ios-PresentationSourceBounds](includes/ios-PresentationSourceBounds.md)]" -Simple

@adegeo adegeo merged commit 924e691 into adegeo-essentials-ported Aug 3, 2021
@adegeo adegeo deleted the adegeo-essentials-1 branch August 3, 2021 17:31
@adegeo adegeo changed the title [Essentials] Find/replace includes to latest format and relative file [essentials] Find/replace includes to latest format and relative file Aug 3, 2021
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.

3 participants