mirror of
https://github.com/Xevion/time-banner.git
synced 2025-12-06 01:16:36 -06:00
chore: edit README, feature planning
This commit is contained in:
66
README.md
66
README.md
@@ -2,23 +2,27 @@
|
|||||||
|
|
||||||
My first Rust project, intended to offer a simple way to display the current time relative, in an image format.
|
My first Rust project, intended to offer a simple way to display the current time relative, in an image format.
|
||||||
|
|
||||||
## Planned Features
|
## Features
|
||||||
|
|
||||||
- Dynamic light/dark mode
|
- [ ] Dynamic light/dark mode
|
||||||
- Via Query Parameters for Raster or SVG
|
- [ ] Via Query Parameters for Raster or SVG
|
||||||
- Via CSS for SVG
|
- [ ] Via CSS for SVG
|
||||||
- Relative or Absolute Format
|
- [x] Relative or Absolute Format
|
||||||
- Dynamic Formats
|
- [ ] Dynamic Formats (currently basic template only)
|
||||||
- Caching Abilities
|
- [ ] Caching Abilities
|
||||||
- Relative caching for up to 59 seconds, purged on the minute
|
- [ ] Relative caching for up to 59 seconds, purged on the minute
|
||||||
- Absolute caching for up to 50MB, purged on an LRU basis
|
- [ ] Absolute caching for up to 50MB, purged on an LRU basis
|
||||||
- Flexible & Dynamic Browser API
|
- [x] Flexible & Dynamic Browser API
|
||||||
- Allow users to play with format in numerous ways to query API
|
- [x] Basic routing with multiple formats
|
||||||
- Examples
|
- [x] SVG and PNG output support
|
||||||
- `/svg/2023-06-14-3PM-CST`
|
- [ ] JPEG/WebP support
|
||||||
- `2023-06-14-3PM-CST.svg`
|
- [ ] Query parameter support (`?format=`, `?tz=`)
|
||||||
- `/jpeg/2023.06.14.33` (14th of June, 2023, 2:33 PM UTC)
|
- [x] Timezone Support
|
||||||
- `/jpeg/2023.06.14.33T-5` (14th of June, 2023, 2:33 PM UTC-5)
|
- [x] Timezone abbreviation parsing
|
||||||
|
- [x] UTC and offset handling
|
||||||
|
- [x] Error Handling
|
||||||
|
- [x] Comprehensive error responses
|
||||||
|
- [x] Parse, render, and rasterization error handling
|
||||||
|
|
||||||
## Routes
|
## Routes
|
||||||
|
|
||||||
@@ -38,31 +42,31 @@ My first Rust project, intended to offer a simple way to display the current tim
|
|||||||
## Structure
|
## Structure
|
||||||
|
|
||||||
1. Routing
|
1. Routing
|
||||||
- Handle different input formats at the route layer
|
- Handle different input formats at the route layer
|
||||||
2. Parsing
|
2. Parsing
|
||||||
- Module for parsing input
|
- Module for parsing input
|
||||||
3. Cache Layer
|
3. Cache Layer
|
||||||
- Given all route options, provide a globally available cache for the next layer
|
- Given all route options, provide a globally available cache for the next layer
|
||||||
4. SVG Template Rendering
|
4. SVG Template Rendering
|
||||||
- Template rendering based on parsed input
|
- Template rendering based on parsed input
|
||||||
5. (Optional) Rasterization
|
5. (Optional) Rasterization
|
||||||
- If rasterization is requested, render SVG to PNG
|
- If rasterization is requested, render SVG to PNG
|
||||||
6. (Catch-all) Error Handling
|
6. (Catch-all) Error Handling
|
||||||
- All errors/panics will be caught in separate middleware
|
- All errors/panics will be caught in separate middleware
|
||||||
|
|
||||||
## Input Parsing
|
## Input Parsing
|
||||||
|
|
||||||
- Date formatting will be guesswork, but can be specified with `?format=` parameter.
|
- Date formatting will be guesswork, but can be specified with `?format=` parameter.
|
||||||
- To avoid abuse, it will be limited to a subset of the `chrono` formatting options.
|
- To avoid abuse, it will be limited to a subset of the `chrono` formatting options.
|
||||||
- The assumed extension when not specified is `.svg` for performance sake.
|
- The assumed extension when not specified is `.svg` for performance sake.
|
||||||
- `.png` is also available. `.jpeg` and `.webp` are planned.
|
- `.png` is also available. `.jpeg` and `.webp` are planned.
|
||||||
- Time is not required, but will default each value to 0 (except HOUR, which is the minimum specified value).
|
- Time is not required, but will default each value to 0 (except HOUR, which is the minimum specified value).
|
||||||
- Millisecond precision is allowed, but will be ignored in most outputs. Periods or commas are allowed as separators.
|
- Millisecond precision is allowed, but will be ignored in most outputs. Periods or commas are allowed as separators.
|
||||||
- Timezones can be qualified in a number of ways, but will default to UTC if not specified.
|
- Timezones can be qualified in a number of ways, but will default to UTC if not specified.
|
||||||
- Fully qualified TZ identifiers like "America/Chicago" are specified using the `tz` query parameter.
|
- Fully qualified TZ identifiers like "America/Chicago" are specified using the `tz` query parameter.
|
||||||
- Abbreviated TZ identifiers like "CST" are specified inside the time string, after the time, separated by a dash.
|
- Abbreviated TZ identifiers like "CST" are specified inside the time string, after the time, separated by a dash.
|
||||||
- Abbreviated terms are incredibly ambiguous, and should be avoided if possible. For ease of use, they are
|
- Abbreviated terms are incredibly ambiguous, and should be avoided if possible. For ease of use, they are
|
||||||
available, but several of them are ambiguous, and the preferred TZ has been specified in code.
|
available, but several of them are ambiguous, and the preferred TZ has been specified in code.
|
||||||
- Full table available in [`abbr_tz`](./src/abbr_tz). Comments designated with `#`. Preferred interpretation
|
- Full table available in [`abbr_tz`](./src/abbr_tz). Comments designated with `#`. Preferred interpretation
|
||||||
designated arbitrarily by me. Table sourced
|
designated arbitrarily by me. Table sourced
|
||||||
from [Wikipedia](https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations)
|
from [Wikipedia](https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations)
|
||||||
|
|||||||
Reference in New Issue
Block a user