Readme.rst 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. ical
  2. ----
  3. This plugin looks for and parses an ``.ics`` file if it is defined in a given
  4. page's ``calendar`` metadata. One calendar can be defined per page.
  5. Dependencies
  6. ------------
  7. This plugin depends on the ``icalendar`` package, which can be installed via
  8. pip::
  9. pip install icalendar
  10. Usage
  11. -----
  12. For a reST-formatted page, include the following line in the metadata::
  13. :calendar: /path/to/your/ics/file
  14. For Markdown, include the following line in the page metadata::
  15. Calendar: /path/to/your/ics/file
  16. Following is some example code that can be added to your theme's ``page.html``
  17. template in order to display the calendar::
  18. {% if page.calendar %}
  19. <dl>
  20. {% for vevent in events[page.slug] %}
  21. <dt>{{ vevent.summary }}</dt>
  22. <dd>{{ vevent.description|replace('\n\n', '<br>') }}</dd>
  23. <dd>{{ vevent.dtstart }}</dd>
  24. <dd>{{ vevent.dtend }}</dd>
  25. <dd class="footer"><a href="{{ vevent.url }}">See more</a></dd>
  26. {% endfor %}
  27. </dl>
  28. {% endif %}