Code Monkey home page Code Monkey logo

obsidian-ics's Introduction

Obsidian ICS Plugin

GitHub release (latest SemVer) Obsidian Downloads

This is a plugin for Obsidian. It adds events from calendar/ics URLs to your Daily Note on demand.

This is designed to work with the Daily Note or Periodic Notes plugins: specifically it gets the date to search for events during from the currently open daily note. You can use it through Dataview or Templater for more advanced / customized usage.

I highly recommend pairing this with the Day Planner plugin: the output format is tuned to support it and you'll get support for seeing the day and week planners.

Installation

This plugin is in the community plugin browser in Obsidian. Search for ICS and you can install it from there.

Using BRAT

If you want to try out beta releases, you can use the BRAT plugin.

  1. Install the BRAT plugin
    1. Open Settings -> Community Plugins
    2. Disable safe mode, if enabled
    3. Browse, and search for "BRAT"
    4. Install the latest version of Obsidian42 - BRAT
  2. Open BRAT settings (Settings -> BRAT)
    1. Scroll to the Beta Plugin List section
    2. Add Beta Plugin
    3. Specify this repository: cloud-atlas-ai/obsidian-ics
  3. Enable the Amazing Marvin plugin (Settings -> Community Plugins)

Setup

  1. From Google Calendar, look for the calendar in the left sidebar click the vertical โ€ฆ menu, Settings and Sharing, Integrate calendar, Copy the Secret address in iCal format
  2. Enter that URL into settings with a calendar name
  3. Customize your format settings. Some are per calendar, others are for all calendars.
    • Per calendar settings: Whether to include a checkbox, the event end time, the calendar name, event summary, event location, event description
    • General output settings: Time format and emitting start and end as Dataview Metadata.

Settings Screenshot

Usage

Go to a daily note, use the ICS: Import events command.

For customizations not available to the formatting, use Dataview or Templater (see below). Likewise, if you want to automatically import events when you create your daily notes, you'll want to use one of those.

Data view usage

You can also use a Dataview to add your events to your journal notes when they get created. For examples, if you use the core Templates plugin you can add the following to add events to your daily note template:

```dataviewjs
var events = await app.plugins.getPlugin('ics').getEvents("{{date:YYYY-MM-DD}}");
var mdArray = [];
events.forEach((e) => {
  mdArray.push(`${e.time} ${e.summary} ${e.location}: ${e.description}`.trim())
})
dv.list(dv.array(mdArray))```

You can see the available fields in the Event interface.

Templater

Or you can use Templater:

<%*
var events = await app.plugins.getPlugin('ics').getEvents(moment(tp.file.title,'YYYY-MM-DD'));
events.sort((a,b) => a.utime - b.utime).forEach((e) => {
  tR+=`- [ ] ${e.time} ${e.summary} ${e.location? e.location : ''}\n`
})
%>

See advanced Templated usage example for an example that demonstrates more features.

You can see the available fields an the Event interface.

Support

If you want to support my work, you can buy me a coffee

Contributions

Manual Installation

If for some reason you want to install the plugin manually:

  1. Download the obsidian-ics-[version].zip release file from releases.
  2. Unpack the file. It should create a obsidian-ics folder.
  3. Place the folder in your .obsidian/plugins directory
  4. Activate the ICS plugin

Local Development

  1. To develop Obsidian plugins you need NodeJS and npm installed. Do that first.
  2. npm install
  3. Make the changes you want...
  4. npm run dev will watch for changes and build the plugin to dist/main.js.
  5. copy the dist/main.js (or dist/main-debug.js if you want the un-minified version) to your Obdisian vault plugin folder (cp dist/main.js <vault>/.obsidian/plugins/ics/main.js).
  6. Reload the vault or use the Hot Reload Plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.