Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aborazmeh committed Jul 7, 2024
0 parents commit 0acf723
Show file tree
Hide file tree
Showing 9 changed files with 5,782 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: test
on: [push, pull_request]
env:
CI: true
jobs:
test:
name: "Test on Node.js ${{ matrix.node-version }}"
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.19, 20 ]
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: yarn install
- name: Test
run: yarn test
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
### https://raw.github.com/github/gitignore/608690d6b9a78c2a003affc792e49a84905b3118/Node.gitignore

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules

# Debug log from npm
npm-debug.log

# Publish src/ instead lib/
/lib
16 changes: 16 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
MIT No Attribution

Copyright 2024 aborazmeh

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# textlint-rule-numeral-systems [![Actions Status: test](https://github.com/aborazmeh/textlint-rule-numeral-systems/workflows/test/badge.svg)](https://github.com/aborazmeh/textlint-rule-numeral-systems/actions?query=workflow%3A"test") [![textlint rule](https://img.shields.io/badge/textlint-fixable-green.svg?style=social)](https://textlint.github.io/)

Unify the usage of Arabic, Arabic-Indic and Farsi numbers in a single text

## Fixable

[![textlint rule](https://img.shields.io/badge/textlint-fixable-green.svg?style=social)](https://textlint.github.io/)

```
textlint --rule numeral-systems --fix README.md
```
## Example

> In ١٧٩٩, during Napoleon's campaign in Egypt, a French soldier discovered the Rosetta Stone near the town of Rosetta (modern-day Rashid). The number ۱۹۶ comes into play as it was the year 196 BCE when the decree inscribed on the Rosetta Stone was written. This decree was issued by Ptolemy V, and its purpose was to establish the divine cult of the king.
> In 1799, during Napoleon's campaign in Egypt, a French soldier discovered the Rosetta Stone near the town of Rosetta (modern-day Rashid). The number 196 comes into play as it was the year 196 BCE when the decree inscribed on the Rosetta Stone was written. This decree was issued by Ptolemy V, and its purpose was to establish the divine cult of the king.
## Install

Install with [npm](https://www.npmjs.com/):

npm install textlint-rule-numeral-systems

## Usage

Via `.textlintrc.json`(Recommended)

```json
{
"rules": {
"numeral-systems": {
"default_numbers" : "arabic" // can be: 'arabic', 'indic' or 'persian
}
}
}
```

Via CLI

```
textlint --rule numeral-systems README.md
```

### Build

Builds source codes for publish to the `lib` folder.
You can write ES2015+ source codes in `src/` folder.

npm run build

### Tests

Run test code in `test` folder.
Test textlint rule by [textlint-tester](https://github.com/textlint/textlint-tester).

npm test

## License

MIT © aborazmeh
Loading

0 comments on commit 0acf723

Please sign in to comment.