Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/syall/json-timeline
Generate Interactive Timelines stored in JSON Advents with Tags.
https://github.com/syall/json-timeline
advent interactive json tag timeline
Last synced: 10 days ago
JSON representation
Generate Interactive Timelines stored in JSON Advents with Tags.
- Host: GitHub
- URL: https://github.com/syall/json-timeline
- Owner: syall
- Created: 2020-12-13T08:40:48.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-15T04:24:50.000Z (almost 4 years ago)
- Last Synced: 2024-10-02T21:37:59.912Z (about 1 month ago)
- Topics: advent, interactive, json, tag, timeline
- Language: JavaScript
- Homepage: https://json-timeline.syall.work/
- Size: 394 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# json-timeline
## Overview
Generate Interactive Timelines stored in JSON Advents with Tags.
## Usage
To install the command-line application:
```shell
npm install json-timeline
```To use the command-line application:
```shell
json-timeline path/to/advents/ path/to/output/ [vf]
```### Process
Advents are loaded from the `path/to/advents` directory to generate a HTML/CSS/JS template (`index.html`, `index.css`, `index.js`, `renderAdvents.js`, `advents.js`) in the `path/to/output` directory. Existing files that clash names with the generated files will not be overwritten by default except for `advents.js`.
### Arguments
Argument | Description
-------------------|--------------------------------------------
`path/to/advents/` | Path to Advents Directory
`path/to/output/` | Path to Output Directory
`[vf]` | `v`: verbose logging, `f`: force overwrites## Advents
Advents represent events in the timeline that each include a mandatory start date, title, content, and tags. An optional end date can also be supplied to change the date range in the rendered Advent DOM.
Advents are stored as JSON objects in `*.advent.json` files or default exports of `*.advent.js` files in a directory specified in `path/to/advents/`.
The Advent Schema can be found in [`schemas.js`](./src/schema/schemas.js):
```javascript
// AdventSchema
{
"start": DateSchema,
"end?": DateSchema,
"title": String,
"content": String,
"tags": Array.of(String)
}
// DateSchema
{
"month": Number,
"day": Number,
"year": Number
}
```Examples of Advents can be found in [`tst/example/`](./tst/example/).
## Customization
By default, json-timeline generates a basic template that can be deployed as a static site (such as on GitHub pages). The template files can be edited safely after they have been generated once since running json-timeline again will not overwrite the edited files by default.
- `index.html` provides a minimal HTML file
- `index.css` provides styling for the rendered HTML
- `index.js` is the entry point of the javascript
- `renderedAdvents.js` dynamically generates HTML
- `advents.js` provides the Advents and Tags and should NOT be editedAs reference for writing custom HTML/CSS/JS extending the template, minimal HTML are listed below.
### Timeline
```html
Timeline
```
### Tag Toggles DOM
```html
Tags [▼]
```
### Tag Toggle DOM
```html
```### Advent Group DOM
```html
1/1/1970 [▼]
```
### Advent DOM
```html
```