Skip to content

Commit 8baac6f

Browse files
committed
update readem
1 parent daea91f commit 8baac6f

File tree

1 file changed

+67
-47
lines changed

1 file changed

+67
-47
lines changed

README.md

Lines changed: 67 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,104 @@
11
# My Life Timeline
22

3-
A tool for visualizing life events on a timeline, available in Tcl/Tk (desktop) and JavaScript (web) versions.
3+
A Rust-based application for visualizing life events on a timeline, with both native and web versions using egui.
44

55
## Features
66

7-
- Display life periods on a timeline
8-
- Customize period names, start dates, and colors
7+
- Display life periods and yearly events on a timeline
8+
- Customize event names, start dates, and colors
99
- Support for YAML configuration
1010
- Dynamic updates based on configuration changes
11+
- Cross-platform support (native and web)
1112

1213
## Development Setup
1314

14-
This project uses `devenv` to manage dependencies. The following packages are included:
15+
This project uses `devenv` to manage dependencies and `trunk` for web builds.
1516

16-
- `tcl`, `tk`, `tcllib`
17-
- `libyaml`
18-
- `gcc`
19-
- `raylib` (version `3.7.0`)
20-
- `cmake`, `pkg-config`
21-
- `python3`
17+
### Prerequisites
2218

23-
### Setup Instructions
24-
25-
1. Install [devenv](https://devenv.sh/).
26-
2. Run `devenv shell` to enter the development environment.
19+
- [Nix](https://nixos.org/download.html) with flakes enabled
20+
- [devenv](https://devenv.sh/)
2721

28-
### Commands
22+
### Setup Instructions
2923

30-
- `build-run-c`: Build and run the C version.
31-
- `run-tcl`: Run the Tcl version.
32-
- `serve-web`: Serve the web version (accessible at http://localhost:8000).
24+
1. Clone the repository:
25+
```
26+
git clone https://github.com/waozixyz/mylife.git
27+
cd mylife
28+
```
29+
2. Enter the development environment:
30+
```
31+
devenv shell
32+
```
33+
3. Build and run the project:
34+
- For native:
35+
```
36+
cargo run
37+
```
38+
- For web:
39+
```
40+
trunk serve
41+
```
3342

3443
## Configuration Format
3544

3645
```yaml
3746
name: John Doe
38-
date_of_birth: "2000-01"
47+
date_of_birth: 2000-01
48+
life_expectancy: 80
3949
life_periods:
40-
- name: Childhood
41-
start: "2000-01"
42-
color: "#FFB3BA"
43-
- name: Teenage Years
44-
start: "2013-01"
45-
color: "#BAFFC9"
50+
- name: Childhood
51+
start: 2000-01
52+
color: "#FFB3BA"
53+
- name: Teenage Years
54+
start: 2013-01
55+
color: "#BAFFC9"
56+
yearly_events:
57+
2022:
58+
- name: Winter Internship
59+
start: 2022-01-03
60+
color: "#4CAF50"
61+
- name: Spring Semester
62+
start: 2022-03-21
63+
color: "#2196F3"
4664
```
4765
48-
## Tcl/Tk Version
66+
## Native Version
67+
### Requirements
68+
All requirements are managed by devenv and specified in the devenv.nix file.
69+
70+
### Usage
71+
```cargo run```
4972

73+
74+
## Web Version
5075
### Requirements
5176

52-
- Tcl/Tk
53-
- `yaml` package
77+
- Trunk (installed via devenv)
78+
- wasm32-unknown-unknown target (automatically added by devenv)
5479

5580
### Usage
81+
Start the development server:
5682

57-
```
58-
tclsh life.tcl [years] [yaml_file]
59-
```
83+
```trunk serve```
6084

61-
- `years`: (Optional) Number of years to display (default: 100)
62-
- `yaml_file`: (Optional) Name of the YAML file in the `data` directory to load
85+
Open the provided URL in a web browser (usually http://127.0.0.1:8080)
6386

64-
## JavaScript Version
87+
## Development
88+
### Adding Dependencies
89+
To add new dependencies, modify the Cargo.toml file and update the devenv.nix file if necessary.
6590

66-
### Usage
91+
## Building for Release
6792

68-
1. Open the HTML file in a web browser
69-
2. Modify the configuration using the form
70-
3. Load/Save configurations using the provided buttons
93+
- Native:
94+
```cargo build --release```
7195

72-
## Raylib Version
73-
### Usage
74-
This project uses raylib for graphical rendering. Ensure consistency by using the specified version in the devenv.nix file.
96+
- Web:
97+
```trunk build --release```
7598

76-
Use the command to provided in the devenv file to build and run the project.
7799

78-
```
79-
build-run-c
80-
```
100+
## Contributing
101+
Contributions are welcome! Please feel free to submit a Pull Request.
81102

82103
## License
83-
84-
This project is licensed under the MIT License. See the [LICENSE.md](LICENSE.md) file for details.
104+
This project is licensed under the MIT License. See the LICENSE.md file for details.

0 commit comments

Comments
 (0)