quran.sh 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +195 -0
- package/dist/quran +0 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# 📖 quran.sh
|
|
2
|
+
|
|
3
|
+
> A fast, offline-first Quran CLI and TUI reader built with Bun and TypeScript
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/quran.sh)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
### 📚 Reading
|
|
11
|
+
- **Offline-First** — All data bundled, works without internet
|
|
12
|
+
- **Multi-Pane Reader** — Arabic (top), Translation + Transliteration (split below)
|
|
13
|
+
- **10 Languages** — Bengali, English, Spanish, French, Indonesian, Russian, Swedish, Turkish, Urdu, Chinese — press `l` to cycle
|
|
14
|
+
- **Arabic Text Shaping** — Proper connected Arabic rendering via `arabic-reshaper`
|
|
15
|
+
- **Verse Flow Modes** — Stacked, inline, or continuous flow — press `F` to cycle
|
|
16
|
+
- **Arabic Layout** — Configurable alignment (`A`) and width (`W`)
|
|
17
|
+
|
|
18
|
+
### 🎨 Design
|
|
19
|
+
- **12 Dynasty Themes** — Mamluk, Ottoman, Safavid, Andalusian, Maghribi, Madinah, Umayyad, Abbasid, Fatimid, Seljuk, Mughal — each with unique ornaments, borders and color palettes inspired by Islamic manuscript illumination
|
|
20
|
+
- **Light & Dark Mode** — Auto-detection + manual toggle
|
|
21
|
+
- **Themed Progress Bars** — Custom ASCII progress indicators in title bars using dynasty-specific ornament characters
|
|
22
|
+
- **Focus Indicators** — Heavy borders + diamond icon on the focused pane
|
|
23
|
+
|
|
24
|
+
### 🔖 Study Tools
|
|
25
|
+
- **Bookmarks** — Mark and revisit favorite verses
|
|
26
|
+
- **Cues** — 9 quick-navigation slots (1–9) for instant jumping
|
|
27
|
+
- **Reflections** — Personal notes attached to any verse
|
|
28
|
+
- **Activity Panel** — Toggleable right panel listing all bookmarks, cues, and reflections
|
|
29
|
+
- **Full-Text Search** — Search across all translations with `/`
|
|
30
|
+
- **Command Palette** — Quick access to all commands with `Ctrl+P`
|
|
31
|
+
|
|
32
|
+
### 📊 Progress Tracking
|
|
33
|
+
- **Reading Mode** — Toggle between browsing (no tracking) and reading (tracks every verse) with `m`
|
|
34
|
+
- **Surah Completion** — When navigating away from a surah in reading mode, prompted to mark it as complete
|
|
35
|
+
- **Reading Stats** — Sidebar widget showing verses read, unique verses, surahs touched, and surahs completed — filterable by Today, Week, Month, All Time, and Session
|
|
36
|
+
- **Streak Tracking** — Current streak, longest streak, and total reading days via CLI
|
|
37
|
+
- **Verse Logging** — Log individual verses or full surahs as read via CLI
|
|
38
|
+
|
|
39
|
+
### 💾 Persistence
|
|
40
|
+
- **SQLite Database** — All bookmarks, cues, reflections, reading logs, and preferences stored locally
|
|
41
|
+
- **Auto-Restore** — Selected surah, verse position, theme, language, layout, sidebar/panel visibility, and reading mode all persist across sessions
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Run directly (no install)
|
|
47
|
+
bunx quran.sh
|
|
48
|
+
|
|
49
|
+
# Global install
|
|
50
|
+
bun install -g quran.sh
|
|
51
|
+
|
|
52
|
+
# Or with npm
|
|
53
|
+
npm install -g quran.sh
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
### CLI Commands
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Launch interactive TUI
|
|
62
|
+
quran
|
|
63
|
+
|
|
64
|
+
# Read a surah (by number or name)
|
|
65
|
+
quran read 1
|
|
66
|
+
quran read al-fatihah
|
|
67
|
+
|
|
68
|
+
# Read a specific verse
|
|
69
|
+
quran read 2:255
|
|
70
|
+
|
|
71
|
+
# Search for verses
|
|
72
|
+
quran search "merciful"
|
|
73
|
+
|
|
74
|
+
# Log reading progress
|
|
75
|
+
quran log 1
|
|
76
|
+
quran log 2:255
|
|
77
|
+
|
|
78
|
+
# View reading streak
|
|
79
|
+
quran streak
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### TUI Keyboard Shortcuts
|
|
83
|
+
|
|
84
|
+
#### Navigation
|
|
85
|
+
|
|
86
|
+
| Key | Action |
|
|
87
|
+
|-----|--------|
|
|
88
|
+
| `Tab` | Cycle focus: Sidebar → Arabic → Translation → Transliteration → Panel |
|
|
89
|
+
| `Shift+Tab` | Cycle sidebar focus: Surah List ↔ Reading Stats |
|
|
90
|
+
| `↑/↓` or `j/k` | Navigate surahs or verses |
|
|
91
|
+
| `Enter` | Select surah (in sidebar) |
|
|
92
|
+
| `1-9` | Jump to cue slot |
|
|
93
|
+
|
|
94
|
+
#### Pane Toggles
|
|
95
|
+
|
|
96
|
+
| Key | Action |
|
|
97
|
+
|-----|--------|
|
|
98
|
+
| `a` | Toggle Arabic pane |
|
|
99
|
+
| `t` | Toggle Translation pane |
|
|
100
|
+
| `r` | Toggle Transliteration pane |
|
|
101
|
+
| `s` | Toggle sidebar |
|
|
102
|
+
| `B` | Toggle activity panel (Bookmarks / Cues / Reflections) |
|
|
103
|
+
|
|
104
|
+
#### Study
|
|
105
|
+
|
|
106
|
+
| Key | Action |
|
|
107
|
+
|-----|--------|
|
|
108
|
+
| `b` | Toggle bookmark on current verse |
|
|
109
|
+
| `R` | Add/edit reflection |
|
|
110
|
+
| `! to (` | Set cue 1–9 (Shift+1–9) |
|
|
111
|
+
| `/` | Search verses |
|
|
112
|
+
| `m` | Toggle Reading/Browsing mode |
|
|
113
|
+
|
|
114
|
+
#### Display
|
|
115
|
+
|
|
116
|
+
| Key | Action |
|
|
117
|
+
|-----|--------|
|
|
118
|
+
| `T` | Cycle dynasty theme |
|
|
119
|
+
| `D` | Cycle light/dark mode |
|
|
120
|
+
| `+`/`-` | Increase/decrease verse spacing |
|
|
121
|
+
| `A` | Cycle Arabic alignment |
|
|
122
|
+
| `W` | Cycle Arabic width |
|
|
123
|
+
| `F` | Cycle verse flow mode |
|
|
124
|
+
|
|
125
|
+
#### General
|
|
126
|
+
|
|
127
|
+
| Key | Action |
|
|
128
|
+
|-----|--------|
|
|
129
|
+
| `Ctrl+P` | Open command palette |
|
|
130
|
+
| `?` | Show/hide help dialog |
|
|
131
|
+
| `ESC` | Dismiss dialog / Clear search |
|
|
132
|
+
| `q` | Quit |
|
|
133
|
+
|
|
134
|
+
## Data Source
|
|
135
|
+
|
|
136
|
+
- Translations from [quran-json](https://github.com/risan/quran-json)
|
|
137
|
+
- 114 surahs, 6,236 verses
|
|
138
|
+
- 10 languages: Bengali, English, Spanish, French, Indonesian, Russian, Swedish, Turkish, Urdu, Chinese
|
|
139
|
+
|
|
140
|
+
## Development
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Clone
|
|
144
|
+
git clone https://github.com/smashah/quran.sh.git
|
|
145
|
+
cd quran.sh
|
|
146
|
+
|
|
147
|
+
# Install dependencies
|
|
148
|
+
bun install
|
|
149
|
+
|
|
150
|
+
# Run TUI
|
|
151
|
+
bun run src/index.ts
|
|
152
|
+
|
|
153
|
+
# Run CLI
|
|
154
|
+
bun run src/index.ts read 1
|
|
155
|
+
|
|
156
|
+
# Run tests
|
|
157
|
+
bun test
|
|
158
|
+
|
|
159
|
+
# Build standalone binary
|
|
160
|
+
bun run build
|
|
161
|
+
# → outputs ./dist/quran
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Recording Demos
|
|
165
|
+
|
|
166
|
+
Demo recording scripts are in `demos/`. To record a TUI demo:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# 1. Start a tmux session
|
|
170
|
+
tmux new-session -d -s demo -x 120 -y 35
|
|
171
|
+
|
|
172
|
+
# 2. Start terminalizer inside it
|
|
173
|
+
tmux send-keys -t demo 'terminalizer record --config demos/tui-demo.yml demos/tui-full -k' Enter
|
|
174
|
+
|
|
175
|
+
# 3. Run the keystroke automation (in another terminal)
|
|
176
|
+
bash demos/send-keys.sh
|
|
177
|
+
|
|
178
|
+
# 4. Render to GIF
|
|
179
|
+
terminalizer render demos/tui-full
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## License
|
|
183
|
+
|
|
184
|
+
MIT © smashah
|
|
185
|
+
|
|
186
|
+
## Credits
|
|
187
|
+
|
|
188
|
+
- Built with [Bun](https://bun.sh)
|
|
189
|
+
- UI powered by [OpenTUI](https://github.com/nicktomlin/opentui)
|
|
190
|
+
- Arabic shaping via [arabic-reshaper](https://github.com/a-patel/arabic-reshaper)
|
|
191
|
+
- Data from [quran-json](https://github.com/risan/quran-json)
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
Made with ❤️ for the Muslim community
|
package/dist/quran
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "quran.sh",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A fast, offline-first Quran CLI and TUI reader",
|
|
5
|
+
"module": "src/index.ts",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"quran": "./dist/quran"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"quran",
|
|
12
|
+
"islam",
|
|
13
|
+
"cli",
|
|
14
|
+
"tui",
|
|
15
|
+
"terminal",
|
|
16
|
+
"reader"
|
|
17
|
+
],
|
|
18
|
+
"author": "smashah",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/smashah/quran.sh.git"
|
|
23
|
+
},
|
|
24
|
+
"bugs": "https://github.com/smashah/quran.sh/issues",
|
|
25
|
+
"homepage": "https://github.com/smashah/quran.sh",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"test": "bun test",
|
|
28
|
+
"build": "bun build --compile --minify --sourcemap --format esm ./src/index.ts --outfile ./dist/quran"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/bun": "latest",
|
|
35
|
+
"@types/react": "^19.0.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"typescript": "^5"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@opentui/core": "^0.1.77",
|
|
42
|
+
"@opentui/react": "^0.1.77",
|
|
43
|
+
"arabic-reshaper": "^1.1.0",
|
|
44
|
+
"bidi-js": "^1.0.3",
|
|
45
|
+
"quran-json": "^3.1.2",
|
|
46
|
+
"react": "^19.0.0",
|
|
47
|
+
"yoga-layout": "^3.2.1"
|
|
48
|
+
}
|
|
49
|
+
}
|