Skip to content

Commit 3db8d75

Browse files
committed
Docs update and smooth out AI
1 parent ead2c83 commit 3db8d75

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+6471
-7243
lines changed

.github/workflows/static.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy static content to Pages
1+
name: Build and Deploy Docs to Pages
22

33
on:
44
push:
@@ -15,20 +15,39 @@ concurrency:
1515
cancel-in-progress: false
1616

1717
jobs:
18-
deploy:
19-
environment:
20-
name: github-pages
21-
url: ${{ steps.deployment.outputs.page_url }}
18+
build:
2219
runs-on: ubuntu-latest
2320
steps:
2421
- name: Checkout
2522
uses: actions/checkout@v4
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
cache: "npm"
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
2633
- name: Setup Pages
2734
uses: actions/configure-pages@v5
35+
36+
- name: Build docs
37+
run: npm run docs:build
38+
2839
- name: Upload artifact
2940
uses: actions/upload-pages-artifact@v3
3041
with:
31-
path: 'docs'
42+
path: docs-src/.vitepress/dist
43+
44+
deploy:
45+
needs: build
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
runs-on: ubuntu-latest
50+
steps:
3251
- name: Deploy to GitHub Pages
3352
id: deployment
3453
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ dist
108108
# vuepress v2.x temp and cache directory
109109
.temp
110110

111+
# VitePress output/cache
112+
docs/
113+
docs-src/.vitepress/cache/
114+
docs-src/.vitepress/dist/
115+
111116
# Docusaurus cache and generated files
112117
.docusaurus
113118

@@ -135,4 +140,4 @@ dist
135140

136141
### Node Patch ###
137142
# Serverless Webpack directories
138-
.webpack/
143+
.webpack/

README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,6 @@ npm build.js
4343

4444
---
4545

46-
## TODO List
47-
48-
### Editor
49-
50-
* [ ] Link CodeMirror minimap toggle
51-
* [ ] Move helper functions (`exportScript`, `generateTamperMonkeyHeader`) to separate files
52-
53-
### UI
54-
* [ ] Fix editor optimizations
55-
* [ ] Can you make it so if you have mutiple scripts running at once on the same page the notifications will expand verticlly and not all overlap
56-
57-
---
58-
5946
## Acknowledgments
6047

6148
* Built with [CodeMirror](https://codemirror.net/)

docs-src/.vitepress/config.mjs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { defineConfig } from 'vitepress';
2+
3+
export default defineConfig({
4+
title: 'CodeTweak Docs',
5+
description: 'Simple docs for using CodeTweak',
6+
lang: 'en-US',
7+
base: '/CodeTweak/',
8+
lastUpdated: true,
9+
cleanUrls: true,
10+
themeConfig: {
11+
logo: '/assets/icons/icon32.png',
12+
nav: [
13+
{ text: 'Guide', link: '/guide/getting-started' },
14+
{ text: 'API', link: '/reference/gm-apis' },
15+
{ text: 'Troubleshooting', link: '/troubleshooting/common-issues' }
16+
],
17+
sidebar: [
18+
{
19+
text: 'Guide',
20+
items: [
21+
{ text: 'Getting Started', link: '/guide/getting-started' },
22+
{ text: 'Install CodeTweak', link: '/guide/installation' },
23+
{ text: 'Use the Editor', link: '/guide/editor' },
24+
{ text: 'Manage Scripts', link: '/guide/dashboard' },
25+
{ text: 'Install From Greasy Fork', link: '/guide/greasyfork' },
26+
{ text: 'Privacy and Permissions', link: '/guide/privacy' }
27+
]
28+
},
29+
{
30+
text: 'Reference',
31+
items: [
32+
{ text: 'GM APIs', link: '/reference/gm-apis' },
33+
{ text: 'Run Timing', link: '/reference/run-timing' },
34+
{ text: 'Match Patterns', link: '/reference/match-patterns' }
35+
]
36+
},
37+
{
38+
text: 'Troubleshooting',
39+
items: [
40+
{ text: 'Common Issues', link: '/troubleshooting/common-issues' },
41+
{ text: 'Strict Sites', link: '/troubleshooting/strict-sites' }
42+
]
43+
}
44+
],
45+
socialLinks: [
46+
{ icon: 'github', link: 'https://github.com/MrBlankCoding/CodeTweak' }
47+
],
48+
search: {
49+
provider: 'local'
50+
},
51+
footer: {
52+
message: 'MIT License',
53+
copyright: 'Copyright © CodeTweak Contributors'
54+
}
55+
},
56+
srcExclude: ['README.md']
57+
});

docs-src/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# CodeTweak Docs Source
2+
3+
This folder contains VitePress source files.
4+
5+
Build output is generated into `/docs` for GitHub Pages.

docs-src/guide/dashboard.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Manage Scripts
2+
3+
Use the dashboard to control all scripts.
4+
5+
## Script list
6+
7+
You can:
8+
9+
- Enable or disable scripts
10+
- Search by name
11+
- Filter by website, status, and run timing
12+
- Edit or delete scripts
13+
14+
## Settings tab
15+
16+
Main settings include:
17+
18+
- Enable scripts by default
19+
- Show notifications
20+
- Enhanced debugging
21+
- Allow external resources
22+
- Confirm first run
23+
24+
## Best practices
25+
26+
- Keep unused scripts disabled.
27+
- Review scripts with broad `@match` rules.
28+
- Keep `allow external resources` off unless needed.

docs-src/guide/editor.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Use the Editor
2+
3+
The editor is where you write and save scripts.
4+
5+
## Create a script
6+
7+
1. Open dashboard.
8+
2. Click `New Script`.
9+
3. Fill script name and metadata.
10+
11+
## Recommended metadata
12+
13+
```javascript
14+
// ==UserScript==
15+
// @name My Script
16+
// @match *://example.com/*
17+
// @run-at document_end
18+
// ==/UserScript==
19+
```
20+
21+
## Run timing
22+
23+
- `document_start`: runs early
24+
- `document_end`: runs when DOM is ready
25+
- `document_idle`: runs after page load
26+
27+
## Tips
28+
29+
- Keep one purpose per script.
30+
- Use clear names.
31+
- Keep match patterns narrow.
32+
- Test on one site before broad patterns.

docs-src/guide/getting-started.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Getting Started
2+
3+
CodeTweak is a Chrome extension for userscripts.
4+
5+
Use this flow:
6+
7+
1. Install the extension.
8+
2. Create or import a script.
9+
3. Set where it runs.
10+
4. Save and test.
11+
12+
## Before you begin
13+
14+
- Chrome or Chromium browser
15+
- Developer mode enabled only for manual install
16+
17+
## Quick start
18+
19+
1. Open the CodeTweak dashboard.
20+
2. Click `New Script`.
21+
3. Add metadata (`@name`, `@match`, `@run-at`).
22+
4. Write your script code.
23+
5. Save.
24+
6. Open a matching page and confirm it runs.
25+
26+
## Next pages
27+
28+
- [Install CodeTweak](/guide/installation)
29+
- [Use the Editor](/guide/editor)
30+
- [Manage Scripts](/guide/dashboard)

docs-src/guide/greasyfork.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Install From Greasy Fork
2+
3+
CodeTweak supports Greasy Fork in two ways.
4+
5+
## From dashboard
6+
7+
1. Open dashboard.
8+
2. Click `Browse Scripts`.
9+
3. Search by script name or keyword.
10+
4. Click `Import`.
11+
5. Review code in editor and save.
12+
13+
## From greasyfork.org
14+
15+
CodeTweak can intercept `.user.js` install links and open them in CodeTweak.
16+
17+
## After import
18+
19+
Always review:
20+
21+
- `@match` rules
22+
- `@grant` usage
23+
- external `@require` URLs
24+
- network requests in code
25+
26+
If the script is too broad, edit it before enabling.

docs-src/guide/installation.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Install CodeTweak
2+
3+
## Chrome Web Store install
4+
5+
1. Open the Chrome Web Store listing.
6+
2. Click `Add to Chrome`.
7+
3. Pin the extension if you want quick access.
8+
9+
## Manual install (developer mode)
10+
11+
1. Build the extension:
12+
13+
```bash
14+
npm install
15+
npm run build:chrome
16+
```
17+
18+
2. Open `chrome://extensions`.
19+
3. Enable `Developer mode`.
20+
4. Click `Load unpacked`.
21+
5. Select `build/chrome`.
22+
23+
## Update manual install
24+
25+
1. Rebuild:
26+
27+
```bash
28+
npm run build:chrome
29+
```
30+
31+
2. In `chrome://extensions`, click `Reload` on CodeTweak.
32+
33+
## Verify install
34+
35+
- Open the popup.
36+
- Open the dashboard.
37+
- Create a test script.

0 commit comments

Comments
 (0)