From 625fe615395cb09eafa93dfc9c26fede9fa6fa93 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 3 Oct 2025 08:29:59 +0000 Subject: [PATCH] Generated Readme --- README.md | 53 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e790e80..dd499b5 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,8 @@ TamperMonkey scripts to improve sites (Fuglane, Innsida etc.) # Contribute -## Basic Contribution + +## Getting Started 1. Clone the repository ```bash git clone git@git.ntnu.no:M365-Drift/MonkeyMagic.git @@ -126,19 +127,45 @@ cd MonkeyMagic ```bash git pull ``` -3. Add your script to the repository -```bash - git add myscript.user.js - git commit -m "Added my script" - git push - ``` -4. A Github Action will be automatically triggered and generate a new README.md file. -## Advanced Contribution +## Creating Your UserScript + +### Hello World Example +Here's a simple hello world UserScript to get you started: -### Auto Update -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/scripts/script-folder/script-name.user.js -// @downloadURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/scripts/script-folder/script-name.user.js +// ==UserScript== +// @name Hello World Example +// @namespace https://git.ntnu.no/M365-Drift/MonkeyMagic/ +// @version 1.0.0 +// @description A simple hello world example +// @author Your Name (your.email@ntnu.no) +// @match https://example.com/* +// @updateURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/scripts/hello-world/hello-world.user.js +// @downloadURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/scripts/hello-world/hello-world.user.js +// @grant none +// ==/UserScript== + +(function() { + 'use strict'; + console.log('Hello World from MonkeyMagic!'); + alert('Hello World!'); +})(); +``` + +### Important Guidelines +- **Namespace**: Always use `https://git.ntnu.no/M365-Drift/MonkeyMagic/` as your namespace +- **Folder Structure**: Create a subfolder under `scripts/` for your script (e.g., `scripts/hello-world/`) +- **Auto Update**: Include `@updateURL` and `@downloadURL` pointing to your script's location in the repository. This enables automatic updates every 24 hours in TamperMonkey. + +### Adding Your Script +1. Create a new folder under `scripts/` with your script name +2. Place your `.user.js` file in that folder +3. Add any documentation or media files to the same folder +4. Commit and push your changes: +```bash + git add scripts/your-script-name/ + git commit -m "Added your-script-name userscript" + git push ``` +5. A GitHub Action will automatically update the README.md file with your script information.