Skip to content

Commit ac158fd

Browse files
committed
Added basic README
1 parent c67667a commit ac158fd

File tree

3 files changed

+65
-5
lines changed

3 files changed

+65
-5
lines changed

README.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,64 @@
1-
# Learn Regex right from the Terminal
1+
# Learn Regex in the Terminal
2+
3+
![Learn Regex Demo](media/demo.gif)
4+
5+
An interactive command-line application to learn and practice regular expressions (regex) right in your terminal. Built with Go and [Bubble Tea](https://github.com/charmbracelet/bubbletea).
6+
7+
## Features
8+
9+
- 🎓 Interactive tutorial with progressive lessons
10+
- 💪 Practice problems to test your skills
11+
- 💾 Progress tracking across sessions
12+
- 🎨 Beautiful terminal UI with gradient text and modern design
13+
14+
## Installation
15+
16+
```
17+
go install github.com/ghousemohamed/learn-regex-in-the-terminal
18+
```
19+
20+
Or clone and build from source:
21+
22+
```
23+
git clone https://github.com/ghousemohamed/learn-regex-in-the-terminal.git
24+
cd learn-regex-in-the-terminal
25+
go build
26+
```
27+
28+
## Usage
29+
30+
Simply run the application in your terminal:
31+
32+
```
33+
learn-regex
34+
```
35+
36+
### Controls
37+
38+
- ``/`` or `j`/`k`: Navigate menu options
39+
- `Enter`: Submit regex pattern / Select menu option
40+
- `Tab`: Skip to next lesson/problem
41+
- `Shift + Tab`: Go to previous lesson/problem
42+
- `Ctrl + r`: Reset progress
43+
- `Esc`: Return to main menu
44+
- `Ctrl + c`: Save progress and quit
45+
46+
## Learning Path
47+
48+
The tutorial is structured to take you from regex basics to advanced patterns:
49+
50+
1. Start with basic character matching
51+
2. Progress through special characters and metacharacters
52+
3. Learn about quantifiers and groups
53+
4. Practice with real-world examples
54+
5. Test your skills with challenging problems
55+
56+
Your progress is automatically saved, allowing you to continue where you left off.
57+
58+
## Development
59+
60+
This project is built using:
61+
- [Go](https://golang.org/)
62+
- [Bubble Tea](https://github.com/charmbracelet/bubbletea) - Terminal UI framework
63+
- [Lip Gloss](https://github.com/charmbracelet/lipgloss) - Style definitions
64+
- [Bubbles](https://github.com/charmbracelet/bubbles) - TUI components

main.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ var (
6969
headerStyle = lipgloss.NewStyle().
7070
Bold(true).
7171
Padding(1, 2).
72-
MarginBottom(1).
7372
Align(lipgloss.Center).
7473
BorderStyle(lipgloss.RoundedBorder()).
7574
BorderForeground(lipgloss.Color("#FF0080"))
@@ -342,7 +341,7 @@ func (m model) View() string {
342341
header := headerStyle.Render(gradientText(headerText))
343342

344343
if m.quitting {
345-
return header + "\n" + "Progress saved. Thanks for learning regex!\n"
344+
return header + "\n" + "Progress saved\n"
346345
}
347346

348347
if m.state == models.Success {
@@ -363,7 +362,6 @@ func (m model) View() string {
363362
header,
364363
lipgloss.NewStyle().
365364
Width(totalWidth - 4).
366-
Margin(2).
367365
Padding(2).
368366
Border(lipgloss.RoundedBorder()).
369367
BorderForeground(lipgloss.Color("#10B981")).
@@ -427,7 +425,6 @@ func (m model) View() string {
427425
header,
428426
lipgloss.NewStyle().
429427
Width(totalWidth - 4).
430-
Margin(1).
431428
Padding(1).
432429
Border(lipgloss.RoundedBorder()).
433430
BorderForeground(lipgloss.Color("#874BFD")).

media/demo.gif

10.5 MB
Loading

0 commit comments

Comments
 (0)