Skip to content

Commit

Permalink
moved individual script doc location to their subfolders
Browse files Browse the repository at this point in the history
  • Loading branch information
on committed Oct 3, 2025
1 parent 8cb67da commit e9be7b5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ TamperMonkey scripts to improve sites (Fuglane, Innsida etc.)
- On the login page, the username field is automatically focused.

#### Video:
![Search GIF](doc/bas-search-lowres.gif)
![Search GIF](scripts/bas-search/bas-search-lowres.gif)
### Diri.ai - Remove blur

- **Install:** [![](https://img.shields.io/badge/diri.user.js-0.1.1-green.svg)](https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/scripts/diri/diri.user.js)
Expand Down Expand Up @@ -106,7 +106,7 @@ TamperMonkey scripts to improve sites (Fuglane, Innsida etc.)
- **Description:** Copies the issue number if you click it in TopDesk or with the hotkey `ctrl` + `alt` + `c`. It copies plain text and a clickable HTML version. So if the place you paste supports HTML, you can paste a clickable link to the issue.


![Demo GIF](doc/topdesk.gif)
![Demo GIF](scripts/topdesk/topdesk.gif)
### TOPdesk - Highlight Summary

- **Install:** [![](https://img.shields.io/badge/topdesk--highlight--summary.user.js-1.6-green.svg)](https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/scripts/topdesk-highlight-summary/topdesk-highlight-summary.user.js)
Expand All @@ -122,7 +122,7 @@ TamperMonkey scripts to improve sites (Fuglane, Innsida etc.)
git clone git@git.ntnu.no:M365-Drift/MonkeyMagic.git
cd MonkeyMagic
```
2. Pull the latest changes. (Important since the README.md is generated)
2. If there have been made changes in the repository after you cloned it you should pull the latest changes. (Important since the README.md is auto generated)
```bash
git pull
```
Expand All @@ -137,8 +137,8 @@ git pull
## Advanced Contribution

### Auto Update
To enable auto update of your UserScript, you need to add the following lines (change the filename to your filename) to the top of your script. This will make TamperMonkey check for updates every 24 hours.
To enable auto update of your UserScript, you need to add the following lines to the top of your script. Replace `script-folder` and `script-name.user.js` with your actual script folder and filename. This will make TamperMonkey check for updates every 24 hours.
```javascript
// @updateURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/bas-search.user.js
// @downloadURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/bas-search.user.js
// @updateURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/scripts/script-folder/script-name.user.js
// @downloadURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/scripts/script-folder/script-name.user.js
```
12 changes: 8 additions & 4 deletions generate-readme.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,17 @@ foreach ($file in $userJsFiles) {
$scriptList += " - **Description:** $description`n"

$baseName = $file.Name -replace '\.user\.js$', ''
$scriptDir = Split-Path $file.FullName -Parent
$docFile = Join-Path $scriptDir "$baseName.md"

if (Test-Path "doc/$baseName.md") {
if (Test-Path $docFile) {
$scriptList += "`n"
$extraDoc = Get-Content "doc/$baseName.md" -Raw
$extraDoc = Get-Content $docFile -Raw

# Replace relative image links with absolute links
$extraDoc = $extraDoc | % { $_ -replace '\!\[(.+)\]\((?!doc\/)(.+)\)', "![`$1](doc/`$2)" }
# Replace relative image links with absolute links from the script's subfolder
$relativeScriptPath = $scriptDir.Replace((Get-Location).Path + "\", "").Replace("\", "/")
# Replace relative image links (simple filenames with common image extensions)
$extraDoc = $extraDoc -replace '\!\[([^\]]+)\]\(([^/)]+\.(gif|png|jpg|jpeg|webp|svg))\)', "![`$1]($relativeScriptPath/`$2)"

$scriptList += "`n"
$scriptList += $extraDoc
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.

0 comments on commit e9be7b5

Please sign in to comment.