-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from mshibanami/library
Implement Library
- Loading branch information
Showing
28 changed files
with
395 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
generated/ | ||
output/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
# Contributing guide | ||
|
||
Thank you for investing your time in contributing to our project! Any contribution you make will be reflected on [mshibanami.github.io/redirect-web](https://mshibanami.github.io/redirect-web/). | ||
Thank you for investing your time in contributing to our project! | ||
|
||
## Livereload | ||
## File structure | ||
|
||
This website is powered by Docsify, and you can livereload it with their `docsify-cli`. | ||
- `docs/`: A documentation of Redirect Web for Safari, which is hosted as [mshibanami.github.io/redirect-web](https://mshibanami.github.io/redirect-web/). | ||
- `library/`: Data of the library available on the app, such as rules and categories. | ||
|
||
### Documentation | ||
|
||
#### Livereload | ||
|
||
The documentation is powered by Docsify, and you can livereload it with their `docsify-cli`. | ||
Please check [their repository](https://github.com/docsifyjs/docsify-cli), and install it. | ||
|
||
Once it's ready, run this command in the repository root of redirect-web. | ||
Once it's ready, run this command in the repository root: | ||
|
||
```sh | ||
$ docsify serve docs/ | ||
``` | ||
|
||
Livereload makes maintaining the documentation easier. | ||
|
||
### Library | ||
|
||
Please check [Library's README](./library/README.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
cd "$(dirname "${BASH_SOURCE:-$0}")" | ||
|
||
./docs/scripts/generate-rule-set-list.sh | ||
|
||
rm -rf output | ||
mkdir -p output/redirect-web | ||
cp -R docs/* output/redirect-web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
docs/rules-in-library/8_twitter_redirect_to_nitter/rule-set.json
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Library | ||
|
||
The library is shown in the Redirect Web apps and the data under the `library` folder may be used in the app. | ||
|
||
## Rule Sets | ||
|
||
Rule sets within the library are managed at [library/rule-sets](https://github.com/mshibanami/redirect-web/tree/main/library/rule-sets). | ||
|
||
Each rule is identified by a unique integer ID. All data in a rule set should be in a folder named `{id}_{short-title-of-rule-set}`. This folder should contain: | ||
|
||
- `rule-set.json` | ||
- `metadata.json` | ||
|
||
Folders of deleted rule sets remain like `8_DELETED`, ensuring that IDs remain unique. | ||
|
||
You can submit a pull request to add your rule to the library. | ||
|
||
> [!WARNING] | ||
> Old rules will persist in the Git history, although you can modify or remove your rules after creation. | ||
## `rule-set.json` | ||
|
||
This file defines a rule set containing one or more rules. It's essentially equivalent to the `redirectweb` file you can get by exporting your rules from the Redirect Web apps. | ||
|
||
> [!NOTE] | ||
> The file extension is `json` because it's easier to browse on GitHub. | ||
Below is an example of `rule-set.json` that configures Google Meet links to open in Google Chrome: | ||
|
||
```json | ||
{ | ||
"bundleID": "io.github.mshibanami.RedirectWebForSafari", | ||
"kind": "RedirectList", | ||
"redirects": [ | ||
{ | ||
"appURL": "file:\/\/\/Applications\/Google%20Chrome.app", | ||
"comments": "This is a rule to open Google Meet links in Google Chrome automatically.", | ||
"destinationURLPattern": "$0", | ||
"exampleURLs": [ | ||
"https:\/\/meet.google.com\/xxx-yyyy-zzz" | ||
], | ||
"kind": "Redirect", | ||
"sourceURLPattern": { | ||
"type": "regularExpression", | ||
"value": "https:\/\/meet.google.com\/[a-z]*-[a-z]*-[a-z]*" | ||
}, | ||
"title": "Google Meet: Open in Chrome" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
## `metadata.json` | ||
|
||
This file contains metadata of a rule set. | ||
|
||
```json | ||
{ | ||
"authors": [ | ||
{ | ||
"name": "Author Name 1", | ||
"gitHubID": "author-github-id1" | ||
}, | ||
{ | ||
"name": "Author Name 2", | ||
"gitHubID": "author-github-id2", | ||
} | ||
], | ||
"imageURLs": [ | ||
"https://somewhere-on-the-internet.com/path/to/your-rule-set-image.jpg" | ||
], | ||
"aboutURL": "https://somewhere-on-the-internet.com/path/to/the-rule-set-details.html", | ||
"title": "A title of the rule set", | ||
"description": "A description of the rule set.", | ||
"version": "1.0.0", | ||
"primaryCategoryID": "gaming", | ||
"secondaryCategoryID": "productivity" | ||
} | ||
``` | ||
|
||
- `authors`: A list of rule set's authors. | ||
- `name`: The name of an author. | ||
- `gitHubID`: The GitHub ID of an author. | ||
- `imageURLs` (optional): A list of image URLs of the rule set. | ||
- `videoURLs` (optional): A list of video URLs for the rule set, including: | ||
- A direct link to a video file that QuickTime Player can play, or, | ||
- A YouTube video URL. | ||
- `aboutURL` (optional): A link to a webpage where users can learn more about the rule set. | ||
- `title`: A short title of the rule set. | ||
- `description`: A description of the rule set. This is optional when the first rule in the rule set has non-empty `comments`. | ||
- `version`: A version of the rule set, which should follow [Semantic Versioning](https://semver.org). | ||
- `primaryCategoryID`: A primary category ID of the rule set. Find a list of the categories in [categories.json](./categories.json). | ||
- `secondaryCategoryID` (optional): A secondary category ID of the rule set. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
{ | ||
"categories": [ | ||
{ | ||
"id": "social_media", | ||
"name": "Social Media", | ||
"emoji": "👍" | ||
}, | ||
{ | ||
"id": "search", | ||
"name": "Search", | ||
"emoji": "🔍" | ||
}, | ||
{ | ||
"id": "education", | ||
"name": "Education", | ||
"emoji": "🎓" | ||
}, | ||
{ | ||
"id": "reference", | ||
"name": "Reference", | ||
"emoji": "📖" | ||
}, | ||
{ | ||
"id": "productivity", | ||
"name": "Productivity", | ||
"emoji": "🧠" | ||
}, | ||
{ | ||
"id": "software_development", | ||
"name": "Software Development", | ||
"emoji": "💻" | ||
}, | ||
{ | ||
"id": "entertainment", | ||
"name": "Entertainment", | ||
"emoji": "🍿" | ||
}, | ||
{ | ||
"id": "shopping", | ||
"name": "Shopping", | ||
"emoji": "👜" | ||
}, | ||
{ | ||
"id": "health_and_fitness", | ||
"name": "Health", | ||
"emoji": "💊" | ||
}, | ||
{ | ||
"id": "travel", | ||
"name": "Travel", | ||
"emoji": "🏝️" | ||
}, | ||
{ | ||
"id": "news", | ||
"name": "News", | ||
"emoji": "🗞️" | ||
}, | ||
{ | ||
"id": "finance", | ||
"name": "Finance", | ||
"emoji": "📈" | ||
}, | ||
{ | ||
"id": "business", | ||
"name": "Business", | ||
"emoji": "📊" | ||
}, | ||
{ | ||
"id": "government", | ||
"name": "Government", | ||
"emoji": "🏢" | ||
}, | ||
{ | ||
"id": "science", | ||
"name": "Science", | ||
"emoji": "🔬" | ||
}, | ||
{ | ||
"id": "arts_and_crafts", | ||
"name": "Arts & Crafts", | ||
"emoji": "🎨" | ||
}, | ||
{ | ||
"id": "sports", | ||
"name": "Sports", | ||
"emoji": "⚽️" | ||
}, | ||
{ | ||
"id": "photo_and_video", | ||
"name": "Lifestyle", | ||
"emoji": "🌇" | ||
}, | ||
{ | ||
"id": "legal", | ||
"name": "Legal", | ||
"emoji": "🧑⚖️" | ||
}, | ||
{ | ||
"id": "gaming", | ||
"name": "Gaming", | ||
"emoji": "🎮" | ||
}, | ||
{ | ||
"id": "real_estate", | ||
"name": "Real Estate", | ||
"emoji": "🏠" | ||
}, | ||
{ | ||
"id": "transport", | ||
"name": "Transport", | ||
"emoji": "🚅" | ||
}, | ||
{ | ||
"id": "jobs_and_careers", | ||
"name": "Jobs & Careers", | ||
"emoji": "🧑💼" | ||
}, | ||
{ | ||
"id": "nonprofits", | ||
"name": "Nonprofits", | ||
"emoji": "🖐️" | ||
}, | ||
{ | ||
"id": "food_and_cooking", | ||
"name": "Food & Cooking", | ||
"emoji": "🥗" | ||
}, | ||
{ | ||
"id": "other", | ||
"name": "Other", | ||
"emoji": null | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"authors": [ | ||
{ | ||
"name": "Manabu Nakazawa", | ||
"gitHubID": "mshibanami" | ||
} | ||
], | ||
"imageURLs": null, | ||
"videoURLs": null, | ||
"aboutURL": null, | ||
"title": "Example Redirect Rule", | ||
"description": "An example rule.", | ||
"version": "1.0.0", | ||
"primaryCategoryID": "other" | ||
} |
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
library/rule-sets/1_google-meet-open-in-chrome/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"authors": [ | ||
{ | ||
"name": "Manabu Nakazawa", | ||
"gitHubID": "mshibanami" | ||
} | ||
], | ||
"imageURLs": null, | ||
"videoURLs": null, | ||
"aboutURL": null, | ||
"title": "Google Meet: Open in Chrome", | ||
"description": "A rule to open Google Meet links in Google Chrome automatically.", | ||
"version": "1.0.0", | ||
"primaryCategoryID": "productivity", | ||
"secondaryCategoryID": "business" | ||
} |
File renamed without changes.
Oops, something went wrong.