# 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](https://mkdocs-macros-plugin.readthedocs.io/en/latest/)
## Installation
Install the package with pip:
```bash
pip install mkdocs-calendar-plugin
```
Activate the plugin in `mkdocs.yml`:
```yaml
plugins:
- search
- calendar
- macros
```
## Configuration
The plugin can be configured in the `plugins` section of `mkdocs.yml` as follows:
```yaml
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:
```yaml
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:
```yaml
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "mkdocs-calendar-plugin",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "mkdocs, python, markdown, wiki",
"author": "Jacques Supcik",
"author_email": "jacques.supcik@hefr.ch",
"download_url": "https://files.pythonhosted.org/packages/9b/97/416250f95490c5acddc5fac2dfb2c543f650f96951e64dbe6d56e8f6c65d/mkdocs_calendar_plugin-0.4.5.tar.gz",
"platform": null,
"description": "# mkdocs-calendar-plugin\n\nThis MkDocs plugin exposes calendar information to the 'extra' configuration variable.\nThis plugin is particularly useful when used together with the\n[mkdocs-macros-plugin](https://mkdocs-macros-plugin.readthedocs.io/en/latest/)\n\n## Installation\n\nInstall the package with pip:\n\n```bash\npip install mkdocs-calendar-plugin\n```\n\nActivate the plugin in `mkdocs.yml`:\n\n```yaml\nplugins:\n - search\n - calendar\n - macros\n```\n\n## Configuration\n\nThe plugin can be configured in the `plugins` section of `mkdocs.yml` as follows:\n\n```yaml\nplugins:\n - search\n - calendar:\n tz: Europe/Zurich\n start: 2023-02-20\n end: 2023-06-23\n - macros\n```\n\nIt can be more convenient to use the `extra` configuration variable, so that the `plugin` section of `mkdocs.yml` can be kept clean.\n`mkdocs-calendar-plugin` can also be configured using the `extra.calendar_plugin` configuration variable as follows:\n\n```yaml\nextra:\n calendar_plugin:\n start: 2023-02-20\n end: 2023-06-23\n\nplugins:\n - search\n - calendar:\n tz: Europe/Zurich\n - macros\n```\n\nThe plugin supports the following configuration options:\n\n| Option | Description |\n|--------------|--------------------------------------------------------------------------|\n| `tz` | The timezone to use for the calendar. Defaults to `UTC`. |\n| `start` | The start date of the calendar. |\n| `end` | The end date of the calendar. |\n| `today` | The date to use as today (used mainly for testing). Defaults to `now`. |\n| `week_names` | The names of the weeks. Defaults to `[]` (no week names). |\n| `plan` | The plan to use for the calendar. Defaults to `{}` (no plan). |\n| `extra_key` | The key to use in the `extra` configuration variable. Defaults to `cal`. |\n\n## Extra configuration variable\n\nThe plugin exposes the following information in the `extra.<extra_key>` configuration variable:\n\n| Key | Description |\n|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| `now` | The current date and time |\n| `today` | The current date |\n| `weekday` | The current weekday (Monday == 0 ... Sunday == 6) |\n| `iso_weekday` | The current ISO weekday (Monday == 0 ... Sunday == 7) |\n| `week_number` | The current ISO week number |\n| `start` | A copy of `extra.<extra_key>.start` _(only if `extra.<extra_key>.start` is defined)_ |\n| `academic_week` | The academic week number staring from `extra.<extra_key>.start` _(only if `extra.<extra_key>.start` is defined)_ |\n| `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)_-- |\n| `elapsed` | The number of days elapsed since `extra.<extra_key>.start` _(only if `extra.<extra_key>.start` is defined)_ |\n| `elapsed_weeks` | The number of weeks elapsed since `extra.<extra_key>.start` _(only if `extra.<extra_key>.start` is defined)_ |\n| `aw` | alias for `academic_week` _(only if `extra.<extra_key>.start` is defined)_ |\n| `awn` | alias for `academic_week_name` _(only if `extra.<extra_key>.start` is defined)_ |\n| `end` | A copy of `extra.<extra_key>.end` _(only if `extra.<extra_key>.end` is defined)_ |\n| `remaining` | The remaining days to `extra.<extra_key>.end` _(only if `extra.<extra_key>.end` is defined)_ |\n| `remaining_weeks` | The remaining weeks to `extra.<extra_key>.end` _(only if `extra.<extra_key>.end` is defined)_ |\n\nThe plugin also exposes the information compited from the plan. A typical plan looks like this:\n\n```yaml\nplan:\n P1: [s01, ex01, tp01]\n P2: [sol1, s02, ex02, tp02]\n```\n\nThe keys of the plan (here above `P1` and `P2`) must exists\nin the `week_names` array (see above). The values of the plan\nare boolean variables that will be `True` if the corresponding week\nis the present week (or before) and `False` otherwise.\n\n",
"bugtrack_url": null,
"license": "Apache-2",
"summary": "An MkDocs plugin to expose calendar information to the 'extra' configuration variable.",
"version": "0.4.5",
"project_urls": {
"Repository": "https://github.com/supcik/mkdocs-calendar-plugin"
},
"split_keywords": [
"mkdocs",
" python",
" markdown",
" wiki"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "0fb84da351e6a1bae6d7195d1d13177ee939b92ea6c8f2b1e6c0b6975ee65893",
"md5": "c03f8cdcc2bf3e49006c4ba4816e1177",
"sha256": "307fabbd7e7bbfc404785eb00477929eb5dd5232c843a9b4b1057449777869d7"
},
"downloads": -1,
"filename": "mkdocs_calendar_plugin-0.4.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c03f8cdcc2bf3e49006c4ba4816e1177",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 4559,
"upload_time": "2025-02-07T12:39:05",
"upload_time_iso_8601": "2025-02-07T12:39:05.238565Z",
"url": "https://files.pythonhosted.org/packages/0f/b8/4da351e6a1bae6d7195d1d13177ee939b92ea6c8f2b1e6c0b6975ee65893/mkdocs_calendar_plugin-0.4.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9b97416250f95490c5acddc5fac2dfb2c543f650f96951e64dbe6d56e8f6c65d",
"md5": "8f2e969f31e4d962f79e8837f8de20d0",
"sha256": "65cb21585aa5815889a3842a385c0a0abfbc1c288278c99ecef1279a4dd681c5"
},
"downloads": -1,
"filename": "mkdocs_calendar_plugin-0.4.5.tar.gz",
"has_sig": false,
"md5_digest": "8f2e969f31e4d962f79e8837f8de20d0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 3806,
"upload_time": "2025-02-07T12:39:08",
"upload_time_iso_8601": "2025-02-07T12:39:08.407392Z",
"url": "https://files.pythonhosted.org/packages/9b/97/416250f95490c5acddc5fac2dfb2c543f650f96951e64dbe6d56e8f6c65d/mkdocs_calendar_plugin-0.4.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-07 12:39:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "supcik",
"github_project": "mkdocs-calendar-plugin",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mkdocs-calendar-plugin"
}