calingen.contrib.layouts.year_by_week

Implementation of LayoutProvider that provides TeX-sources for a full year’s calendar, presented by calendar weeks.

Warning

This layout does only include events of the types ANNUAL_ANNIVERSARY and HOLIDAY.

Submodules

Package Contents

Classes

YearByWeek

The actual implementation of the layout.

Attributes

default_app_config

The path to the app's default configuration class.

class calingen.contrib.layouts.year_by_week.YearByWeek

Bases: calingen.interfaces.plugin_api.LayoutProvider

The actual implementation of the layout.

prepare_context() is used to create a year’s full representation, grouping the days by week and matching the entries to the given day.

Warning

The provided templates create a document targeted at German users. You may override the templates to (fully) support other languages.

Notes

To customize the generated TeX-sources, the following templates may be overridden:

  • year_by_week/tex/base.tex: Speaking in TeX-terms: the preamble of the document, including package definitions.

  • year_by_week/tex/year_by_week.tex: Speaking in TeX-terms: the document’s body.

_template = year_by_week/tex/year_by_week.tex
layout_type = tex
name = Year by Week
orientation = portrait
paper_size = a5
classmethod prepare_context(context)

Create a full year’s representation and return it as weeklist.

calingen.contrib.layouts.year_by_week.default_app_config = calingen.contrib.layouts.year_by_week.apps.CalingenLayoutYearByWeekConfig

The path to the app’s default configuration class.

Consider this legacy code. See Django’s documentation for details.

Notes

While the layout is provided as a “standalone Django app”, it is in fact nothing more than an implementation of LayoutProvider. The actual magic of registering the layout with the main app is not done in this app’s AppConfig, but in this very file by importing the YearByWeek class.