Skip to main content

An MkDocs plugin to expose calendar information to the 'extra' configuration variable.

Project description

mkdocs-calendar-plugin

This MkDocs plugin exposes calendar information to the 'extra' configuration variable. This plugin is particularly useful when used together with the mkdocs-macros-plugin

Installation

Install the package with pip:

pip install mkdocs-calendar-plugin

Activate the plugin in mkdocs.yml:

plugins:
  - search
  - calendar
  - macros

Configuration

The plugin can be configured in the plugins section of mkdocs.yml as follows:

plugins:
  - search
  - calendar:
      tz: Europe/Zurich
      start: 2023-02-20
      end: 2023-06-23
  - macros

It can be more convenient to use the extra configuration variable, so that the plugin section of mkdocs.yml can be kept clean. mkdocs-calendar-plugin can also be configured using the extra.calendar_plugin configuration variable as follows:

extra:
  calendar_plugin:
    start: 2023-02-20
    end: 2023-06-23

plugins:
  - search
  - calendar:
      tz: Europe/Zurich
  - macros

The plugin supports the following configuration options:

Option Description
tz The timezone to use for the calendar. Defaults to UTC.
start The start date of the calendar.
end The end date of the calendar.
today The date to use as today (used mainly for testing). Defaults to now.
week_names The names of the weeks. Defaults to [] (no week names).
plan The plan to use for the calendar. Defaults to {} (no plan).
extra_key The key to use in the extra configuration variable. Defaults to cal.

Extra configuration variable

The plugin exposes the following information in the extra.<extra_key> configuration variable:

Key Description
now The current date and time
today The current date
weekday The current weekday (Monday == 0 ... Sunday == 6)
iso_weekday The current ISO weekday (Monday == 0 ... Sunday == 7)
week_number The current ISO week number
start A copy of extra.<extra_key>.start (only if extra.<extra_key>.start is defined)
academic_week The academic week number staring from extra.<extra_key>.start (only if extra.<extra_key>.start is defined)
academic_week_name The academic week name (from the week_names array) staring from extra.<extra_key>.start (only if extra.<extra_key>.start is defined)--
elapsed The number of days elapsed since extra.<extra_key>.start (only if extra.<extra_key>.start is defined)
elapsed_weeks The number of weeks elapsed since extra.<extra_key>.start (only if extra.<extra_key>.start is defined)
aw alias for academic_week (only if extra.<extra_key>.start is defined)
awn alias for academic_week_name (only if extra.<extra_key>.start is defined)
end A copy of extra.<extra_key>.end (only if extra.<extra_key>.end is defined)
remaining The remaining days to extra.<extra_key>.end (only if extra.<extra_key>.end is defined)
remaining_weeks The remaining weeks to extra.<extra_key>.end (only if extra.<extra_key>.end is defined)

The plugin also exposes the information compited from the plan. A typical plan looks like this:

plan:
  P1: [s01, ex01, tp01]
  P2: [sol1, s02, ex02, tp02]

The keys of the plan (here above P1 and P2) must exists in the week_names array (see above). The values of the plan are boolean variables that will be True if the corresponding week is the present week (or before) and False otherwise.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_calendar_plugin-0.4.4.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_calendar_plugin-0.4.4-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_calendar_plugin-0.4.4.tar.gz.

File metadata

  • Download URL: mkdocs_calendar_plugin-0.4.4.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for mkdocs_calendar_plugin-0.4.4.tar.gz
Algorithm Hash digest
SHA256 8fbe2d9e533a6900b9695ff47d646767c9072ea49f05abb71c51fefb8af35a5d
MD5 d6fa19b1d505b624c7625d28858533a7
BLAKE2b-256 985eebfeee9e27d71cf7ac1a6c627cbe5a61c0309b868ae66d192e77e74d2e5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_calendar_plugin-0.4.4.tar.gz:

Publisher: release.yml on supcik/mkdocs-calendar-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mkdocs_calendar_plugin-0.4.4-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_calendar_plugin-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9db75e58db0bca925f53f047175f11223ae7ddc799f8112948b988fabdd2966d
MD5 c829589042c1868bd40f9cfcbb87f011
BLAKE2b-256 7ea1c69a0d0197ea907c387315beb63ed373ac31a6c7a6af441f18c4cf3b4f38

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_calendar_plugin-0.4.4-py3-none-any.whl:

Publisher: release.yml on supcik/mkdocs-calendar-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page