https://github.com/textlint/editor-script-template
@textlint/editor script template
https://github.com/textlint/editor-script-template
Last synced: over 1 year ago
JSON representation
@textlint/editor script template
- Host: GitHub
- URL: https://github.com/textlint/editor-script-template
- Owner: textlint
- Created: 2021-04-18T13:10:12.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-01-08T15:07:55.000Z (over 1 year ago)
- Last Synced: 2025-01-11T11:17:01.767Z (over 1 year ago)
- Homepage: https://textlint.github.io/editor-script-template/
- Size: 437 KB
- Stars: 10
- Watchers: 5
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @textlint/editor-script-template
This template for [@textlint/editor](https://github.com/textlint/editor) worker scripts.
## Setup
1. Use this template → fork repository
- Repository name: your favorite name
- ✔ Include all branches
2. Enable GitHub Pages on your repository's settings
- Source: Branch `gh-pages`

3. Visit `https://{yourname}.github.io/{yourrepo}/` after adding rules
## Add new rule
npm install textlint-rule-
# edit .textlintrc.json and add it
git add .
git commit -m "feat: add new rule"
After a commit, GitHub Actions publish your website to GitHub pages.
## Test rule
@textlint/editor script require browser supported textlint rule. So, Some textlint rule does not work on
@textlint/editor.
You can test the rule on local.
npm run website -- --metadataName="your script name" --metadataNamespace="https://github.com/your/repo" --metadataHomepage="https://github.com/your/repo"
npx http-serve dist/
or add some metadata into `package.json`:
```json5
{
"private": true,
"name": "@textlint/editor-script-template",
// <= edit your rule name
"version": "1.0.0",
"homepage": "https://github.com/your/repo",
// <= add your repository url
"description": "@textlint/editor script template",
"scripts": {
"website": "textlint-website-generator --outputDir dist"
},
"devDependencies": {
"@textlint/website-generator": "^0.10.0"
},
"dependencies": {
"textlint": "^11.9.0",
"textlint-filter-rule-comments": "^1.2.2",
"textlint-rule-no-todo": "^2.0.1"
}
}
```
After the setup, you can build and serve:
npm run website
npx http-serve dist/