Skip to content

Commit 04876e2

Browse files
Adding view source
1 parent 8731753 commit 04876e2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

psturtle.com/CHANGELOG.html.ps1

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
param(
22
[uri]
3-
$RepositoryUrl = "https://github.com/PowerShellWeb/Turtle"
3+
$RepositoryUrl = "https://github.com/PowerShellWeb/Turtle",
4+
5+
[string]
6+
$ChangeLogPath = '../CHANGELOG.md'
47
)
58
if ($PSScriptRoot) { Push-Location $PSScriptRoot}
6-
(Get-ChildItem -Path ../CHANGELOG.md |
9+
"<style>"
10+
".viewSource {float: right;}"
11+
"</style>"
12+
"<details class='viewSource'>"
13+
"<summary>View Source</summary>"
14+
"<pre><code class='language-PowerShell'>"
15+
[Web.HttpUtility]::HtmlEncode($MyInvocation.MyCommand.ScriptBlock)
16+
"</code></pre>"
17+
"</details>"
18+
(Get-ChildItem -Path $ChangeLogPath |
719
ConvertFrom-Markdown |
820
Select-Object -ExpandProperty HTML) -replace '(?<=[\(\,)]\s{0,})\#\d+', {
921
$match = $_

0 commit comments

Comments
 (0)