Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Latest commit

 

History

History
61 lines (49 loc) · 1.98 KB

README.md

File metadata and controls

61 lines (49 loc) · 1.98 KB

Timetable @ IITH

TypeScript (NodeJS) app to generate Timetable in ICal format.

How to use

  • Install NodeJS from here.
  • Clone this repository
    $ git clone https://github.com/prateekkumarweb/timetableiith.git
  • Install the required packages
    $ yarn install
  • Edit the files config.yaml file. An example is given in config folder.
  • Generate JS files
    $ yarn build
  • Run the program
    $ cd dist
    $ node index.js -c config.yaml -o filename.ics

The generated ICal file can be imported into Google Calendar or Microsoft Outlook. Instead of importing you can also host this file and keep Google Calendar or Microsoft Outlook in sync with it.

How to keep the ICal file in sync with Google Calendar

  • Fork this repository, make required changes and host the site using github pages.
  • Next, in Google Calendar, click the + button below the overview month calendar and select From URL.
  • Enter the URL of the hosted ics file and add the calendar.
  • This will update the calendar whenever a change is made by pushing changes to the repository.
  • Note that it may take upto 24 hours for Google Calendar to update the events from the hosted iCal file.

Add pre-commit to Git so that tt.ics can be generated before committing

  • Create a new file at .git/hooks/pre-commit with following content.
    #!/bin/sh
    yarn build
    cd dist
    node index.js -c ../config/config.yaml -o ../out/tt.ics
    git add tt.ics
  • Change persimissions of the hook file.
    $ chmod +x .git/hooks/pre-commit
  • After you commit, tt.ics will be auto generated and added to git.

LICENSE

MIT


Copyright © 2017-2019 Prateek Kumar