Skip to content

Commit

Permalink
Doc now lists scripts better. (I hope)
Browse files Browse the repository at this point in the history
  • Loading branch information
on committed Aug 23, 2024
1 parent d3b19f7 commit 42dbe82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ReadmeTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TamperMonkey scripts for å gjøre websider bedre. (Fuglane, Innsida osv.)

# How to use
1. Install the TamperMonkey extension for your browser
2. Click on the script you want to install (in the list above)
2. Click on the ![](https://img.shields.io/badge/Install-Link-blue.svg) for the script you want to install (in the list above)
3. TamperMonkey should open and ask you to install the script

# Contribute
Expand Down
24 changes: 6 additions & 18 deletions generate-readme.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,8 @@ $userJsFiles = Get-ChildItem -Path $UserScripts -Filter "*.user.js" | Sort-Objec

$regEx = [regex]'\/\/\s+@(\w+)\s+(.+)'


$scriptList = @()

# Initialize an array to hold the table rows
$tableRows = @()

$tableRows = "`n| Filename | Name | Description | Auto Update |`n"
$tableRows += "| --- | --- | --- | :-: |`n"

# Loop through each file
foreach ($file in $userJsFiles) {
# Read the file content
Expand Down Expand Up @@ -67,19 +60,14 @@ foreach ($file in $userJsFiles) {
$autoUpdateText = ""
}

$scriptList += " ## $name`n`n"
$scriptList += "<table>`n"
$scriptList += " <tr><th>Version</th><td>$version</td></tr>`n"
$scriptList += " ### $name`n`n"
$scriptList += " - **Install:** "
$scriptList += New-MDImage -Subject "$($file.Name)" -Status "$version" -Color blue -Link "https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/$($file.Name)"
if ($author) {
$scriptList += " <tr><th>Author</th><td>$author</td></tr>`n"
$scriptList += "`n - **Author:** $author`n"
}
$scriptList += "<tr><th>Match</th><td>$match</td></tr>`n"
$scriptList += "<tr><th>Description</th><td>$description</td></tr>`n"
$scriptList += "</table>`n`n"


# Add the row to the table
$tableRows += "| [$($file.Name)](https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/$($file.Name)) | $name | $description | $autoUpdateText |`n"
$scriptList += " - **Match:** ``$match```n"
$scriptList += " - **Description:** $description`n"
}

#$tableRows | ForEach-Object { Write-Output $_ }
Expand Down

0 comments on commit 42dbe82

Please sign in to comment.