You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

mkdocs-calendar-plugin

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkdocs-calendar-plugin

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

0.4.5
pipPyPI
Maintainers
1

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:

OptionDescription
tzThe timezone to use for the calendar. Defaults to UTC.
startThe start date of the calendar.
endThe end date of the calendar.
todayThe date to use as today (used mainly for testing). Defaults to now.
week_namesThe names of the weeks. Defaults to [] (no week names).
planThe plan to use for the calendar. Defaults to {} (no plan).
extra_keyThe 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:

KeyDescription
nowThe current date and time
todayThe current date
weekdayThe current weekday (Monday == 0 ... Sunday == 6)
iso_weekdayThe current ISO weekday (Monday == 0 ... Sunday == 7)
week_numberThe current ISO week number
startA copy of extra.<extra_key>.start (only if extra.<extra_key>.start is defined)
academic_weekThe academic week number staring from extra.<extra_key>.start (only if extra.<extra_key>.start is defined)
academic_week_nameThe academic week name (from the week_names array) staring from extra.<extra_key>.start (only if extra.<extra_key>.start is defined)--
elapsedThe number of days elapsed since extra.<extra_key>.start (only if extra.<extra_key>.start is defined)
elapsed_weeksThe number of weeks elapsed since extra.<extra_key>.start (only if extra.<extra_key>.start is defined)
awalias for academic_week (only if extra.<extra_key>.start is defined)
awnalias for academic_week_name (only if extra.<extra_key>.start is defined)
endA copy of extra.<extra_key>.end (only if extra.<extra_key>.end is defined)
remainingThe remaining days to extra.<extra_key>.end (only if extra.<extra_key>.end is defined)
remaining_weeksThe 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.

Keywords

mkdocs

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts