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. |
week_names |
The names of the weeks. Defaults to [] (no week names). |
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) |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mkdocs_calendar_plugin-0.3.0.tar.gz
.
File metadata
- Download URL: mkdocs_calendar_plugin-0.3.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0f851f411b4520b94314b565660a95d9435f9f5cb538074348f723114b73178 |
|
MD5 | 98f8a316c747b91ac921ebf1468fa9d9 |
|
BLAKE2b-256 | 45a78efb9dc1ae03e6bdcc70f441eb7ea25b91617e72c0f4ed4c73facb5fadea |
File details
Details for the file mkdocs_calendar_plugin-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: mkdocs_calendar_plugin-0.3.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2575dcedb5e750029979e0aa7c03bbdbe6eb2e1e13779832bedcdf36f2439e92 |
|
MD5 | 3b74fe65c910cb0dcf57ce795e4d2071 |
|
BLAKE2b-256 | 6de643ce3851dace15e7e6a2f2a0a8b17649f8e77ecae5e5177fffcba63b7ab8 |