Skip to content

Commit fa37792

Browse files
committed
Update path
1 parent 84ba1b6 commit fa37792

6 files changed

Lines changed: 68 additions & 595 deletions

File tree

Website/docs/advanced-features.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
<body>
205205
<div class="container">
206206
<nav class="nav-header">
207-
<a href="index.html">
207+
<a href="../../index.html">
208208
<svg class="icon" viewBox="0 0 24 24">
209209
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>
210210
<polyline points="9 22 9 12 15 12 15 22"/>
@@ -525,13 +525,13 @@ <h3>Diagnostic Tools</h3>
525525
</div>
526526

527527
<div class="nav-buttons">
528-
<a href="script-management.html" class="nav-btn secondary">
528+
<a href="gm-apis.html" class="nav-btn secondary">
529529
<svg class="icon" viewBox="0 0 24 24">
530530
<polyline points="15 18 9 12 15 6"/>
531531
</svg>
532-
Script Management
532+
GM APIs Reference
533533
</a>
534-
<a href="index.html" class="nav-btn">
534+
<a href="../../index.html" class="nav-btn">
535535
Documentation Home
536536
<svg class="icon" viewBox="0 0 24 24">
537537
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>

Website/docs/editor.html

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226
<body>
227227
<div class="container">
228228
<nav class="nav-header">
229-
<a href="index.html">
229+
<a href="../../index.html">
230230
<svg class="icon" viewBox="0 0 24 24">
231231
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>
232232
<polyline points="9 22 9 12 15 12 15 22"/>
@@ -246,6 +246,59 @@ <h1>
246246
</h1>
247247
<p>Learn to write powerful userscripts with practical examples, from basic DOM manipulation to advanced techniques using Greasemonkey APIs.</p>
248248
</header>
249+
250+
<h2>Userscript Metadata</h2>
251+
<p>
252+
Userscripts often start with a metadata block that describes the script and how it should run.
253+
<strong>You don’t have to add this manually</strong>—CodeTweak can generate and maintain it for you based on the sidebar settings.
254+
If you do add or edit a metadata block in the code editor, CodeTweak will sync those values with the sidebar and keep them up to date.
255+
</p>
256+
257+
<div class="feature-card">
258+
<h3>What the Metadata Block Contains</h3>
259+
<p>Common fields you’ll see and what they do:</p>
260+
<ul>
261+
<li><strong>@name</strong> — Display name of your script</li>
262+
<li><strong>@namespace</strong> — Unique namespace to avoid conflicts (optional)</li>
263+
<li><strong>@version</strong> — Script version (semantic versioning recommended)</li>
264+
<li><strong>@description</strong> — Short description of what your script does</li>
265+
<li><strong>@author</strong> — Your name or handle</li>
266+
<li><strong>@match</strong>/<strong>@include</strong> — URL patterns where your script runs</li>
267+
<li><strong>@run-at</strong> — When the script executes (e.g., document-start, document-idle)</li>
268+
<li><strong>@grant</strong> — Permissions/APIs your script needs (e.g., GM_getValue, GM_setValue)</li>
269+
<li><strong>@require</strong> — External scripts to load before your script (optional)</li>
270+
<li><strong>@resource</strong> — Named assets your script can access (optional)</li>
271+
<li><strong>@icon</strong> — Icon URL for your script (optional)</li>
272+
<li><strong>@license</strong> — License identifier (optional)</li>
273+
</ul>
274+
275+
<h4>Example</h4>
276+
<pre><code class="language-javascript">// ==UserScript==
277+
// @name Example Script
278+
// @namespace https://codetweak.local
279+
// @version 1.0.0
280+
// @description Demonstrates a typical metadata header
281+
// @author You
282+
// @match *://example.com/*
283+
// @run-at document-idle
284+
// @grant GM_getValue
285+
// @grant GM_setValue
286+
// @require https://cdn.example.com/some-lib.min.js
287+
// @resource logo https://example.com/logo.png
288+
// ==/UserScript==
289+
</code></pre>
290+
291+
<div class="alert alert-info">
292+
<svg class="icon" viewBox="0 0 24 24">
293+
<circle cx="12" cy="12" r="10"/>
294+
<line x1="12" y1="16" x2="12" y2="12"/>
295+
<line x1="12" y1="8" x2="12.01" y2="8"/>
296+
</svg>
297+
<div>
298+
<strong>Good to know:</strong> You can omit the entire metadata block. The editor will generate it from your sidebar selections (name, URLs, run at, grants, requires, resources, etc.) and keep both the header and sidebar in sync.
299+
</div>
300+
</div>
301+
</div>
249302

250303
<h2>Quick Start</h2>
251304
<p>Open the editor by clicking "New Script" from the dashboard. The sidebar helps you configure your script settings while you write code in the main area.</p>

Website/docs/gm-apis.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
<body>
280280
<div class="container">
281281
<nav class="nav-header">
282-
<a href="index.html">
282+
<a href="../../index.html">
283283
<svg class="icon" viewBox="0 0 24 24">
284284
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>
285285
<polyline points="9 22 9 12 15 12 15 22"/>
@@ -827,8 +827,8 @@ <h4>Example Usage:</h4>
827827
</svg>
828828
Script Editor
829829
</a>
830-
<a href="script-management.html" class="nav-btn">
831-
Script Management
830+
<a href="advanced-features.html" class="nav-btn">
831+
Advanced Features
832832
<svg class="icon" viewBox="0 0 24 24">
833833
<polyline points="9 18 15 12 9 6"/>
834834
</svg>

Website/docs/installation.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@
318318
<body>
319319
<div class="container">
320320
<nav class="nav-header">
321-
<a href="index.html">
321+
<a href="../../index.html">
322322
<svg class="icon" viewBox="0 0 24 24">
323323
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>
324324
<polyline points="9 22 9 12 15 12 15 22"/>
@@ -479,7 +479,7 @@ <h4 style="color: var(--primary-color); margin-bottom: 0.5rem;">Clipboard Write<
479479
</div>
480480

481481
<div class="nav-buttons">
482-
<a href="index.html" class="nav-btn secondary">
482+
<a href="../../index.html" class="nav-btn secondary">
483483
<svg class="icon" viewBox="0 0 24 24">
484484
<polyline points="15 18 9 12 15 6"/>
485485
</svg>

0 commit comments

Comments
 (0)