# 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": "https://github.com/supcik/mkdocs-calendar-plugin",
"name": "mkdocs-calendar-plugin",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "mkdocs,python,markdown,wiki",
"author": "Jacques Supcik",
"author_email": "jacques.supcik@hefr.ch",
"download_url": "https://files.pythonhosted.org/packages/2e/28/fae1dbd8093a5416c8f9d72f9345b2011550ff30729d485e8491c7311c61/mkdocs_calendar_plugin-0.4.3.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.3",
"project_urls": {
"Homepage": "https://github.com/supcik/mkdocs-calendar-plugin",
"Repository": "https://github.com/supcik/mkdocs-calendar-plugin"
},
"split_keywords": [
"mkdocs",
"python",
"markdown",
"wiki"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "52baa993152b662eb09dc2cc887a2407087052076571e9db816f5146c3f48822",
"md5": "6c5c7799efb0684cf621ea0f996c81f9",
"sha256": "e5b276eea32f85cf5e3f89e3250f6dd24808aa2f93c7efea23ccc0c3dc9b93c6"
},
"downloads": -1,
"filename": "mkdocs_calendar_plugin-0.4.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6c5c7799efb0684cf621ea0f996c81f9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 4570,
"upload_time": "2024-02-13T21:36:34",
"upload_time_iso_8601": "2024-02-13T21:36:34.906657Z",
"url": "https://files.pythonhosted.org/packages/52/ba/a993152b662eb09dc2cc887a2407087052076571e9db816f5146c3f48822/mkdocs_calendar_plugin-0.4.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2e28fae1dbd8093a5416c8f9d72f9345b2011550ff30729d485e8491c7311c61",
"md5": "64661b088178f922f6e478cd59bb7138",
"sha256": "29ad8e1ea30617813389f8859cc177ca07601b6781abac70bd785226b1730f86"
},
"downloads": -1,
"filename": "mkdocs_calendar_plugin-0.4.3.tar.gz",
"has_sig": false,
"md5_digest": "64661b088178f922f6e478cd59bb7138",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 3909,
"upload_time": "2024-02-13T21:36:36",
"upload_time_iso_8601": "2024-02-13T21:36:36.691415Z",
"url": "https://files.pythonhosted.org/packages/2e/28/fae1dbd8093a5416c8f9d72f9345b2011550ff30729d485e8491c7311c61/mkdocs_calendar_plugin-0.4.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-13 21:36:36",
"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"
}