Rakefire / jekyll-ical-tag

Pull ICS feed and provide a for-like loop of calendar events in jekyll's liquid tag
7 stars 6 forks source link

Proposal: Use RFC5545 attribute names for events #10

Closed fabacab closed 4 years ago

fabacab commented 4 years ago

Would you have any interest in supporting a patch (that I am willing to code myself) that would make it possible to reference event attribute data by its standard RFC5545 object property names?

I ask this because I have several instances of Jekyll templates that rely on standardized naming schemes for event-like objects, and it becomes difficult to maintain generalized templates when different utilities use different names to expose the data they provide.

There is an underlying standard from which all this data is generated, of course: RFC 5545, the iCalendar specifiction. This specification provides an exhaustive listing of all legal iCalendar property names that are, in my experience, more than satisfactorily self-describing and can be used to unambiguously refer to specific data that a consuming application wants to inspect.

Before I actually do this work, though, I would love to know whether or not this is something you would be willing to merge and then support. My plan would be to alias the current attribute names (start_time) to the standard property names (dtstart) so as not to break backwards-compatibility, but to suggest that non-standard attribute names be formally deprecated moving forward.

Such a change would make it possible to reuse Jekyll template includes that produce, for example, h-calendar compliant microformat markup in a manner such as:

{% ical url: https://example.com/events.ics %}
    {% include h-event.html event=event %}
{% endical %}

where h-event.html contains generalized iCalendar-aware template code such as:

<div class="h-event vevent">
[…]
<p><time datetime="{{ include.event.dtstart | date_to_xmlschema }}">{{ include.event.dtstart | date: site.datetime_format }}</time></p>
[…]
</div>

instead of checking for provider-specific attribute names.

Some attributes in this plugin already provide the RFC 5545 object property names, e.g., summary. However, others do not. I would like to propose that all attributes of an event exposed by this Gem conform to the same RFC 5545 standard naming scheme.

Thanks in advance for the wonderful Gem, regardless. :)

rickychilcott commented 4 years ago

I'd be happy to accept a PR on this and it feels like the right thing. As you likely suspect, I built this plugin for a specific use and extracted it because it didn't exist.

I'm not sure about how best to deprecate the old attribute names, but if you have ideas feel free to put them in the PR. If not, I can investigate.