khalorg 0.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- khalorg-0.0.0/.gitignore +11 -0
- khalorg-0.0.0/CHANGELOG.md +35 -0
- khalorg-0.0.0/CONTRIBUTING.md +29 -0
- khalorg-0.0.0/LICENCE +21 -0
- khalorg-0.0.0/PKG-INFO +422 -0
- khalorg-0.0.0/README.md +407 -0
- khalorg-0.0.0/demo/delete.gif +0 -0
- khalorg-0.0.0/demo/edit.gif +0 -0
- khalorg-0.0.0/demo/list.gif +0 -0
- khalorg-0.0.0/demo/meeting.org +22 -0
- khalorg-0.0.0/demo/new.gif +0 -0
- khalorg-0.0.0/extras/calsync +86 -0
- khalorg-0.0.0/publish +10 -0
- khalorg-0.0.0/pyproject.toml +85 -0
- khalorg-0.0.0/setup.cfg +4 -0
- khalorg-0.0.0/setup.py +8 -0
- khalorg-0.0.0/src/khalorg/__init__.py +11 -0
- khalorg-0.0.0/src/khalorg/__main__.py +4 -0
- khalorg-0.0.0/src/khalorg/cli.py +118 -0
- khalorg-0.0.0/src/khalorg/commands.py +223 -0
- khalorg-0.0.0/src/khalorg/helpers.py +31 -0
- khalorg-0.0.0/src/khalorg/khal/args.py +264 -0
- khalorg-0.0.0/src/khalorg/khal/calendar.py +358 -0
- khalorg-0.0.0/src/khalorg/khal/checker.py +164 -0
- khalorg-0.0.0/src/khalorg/khal/helpers.py +107 -0
- khalorg-0.0.0/src/khalorg/org/agenda_items.py +673 -0
- khalorg-0.0.0/src/khalorg/org/helpers.py +86 -0
- khalorg-0.0.0/src/khalorg/paths.py +12 -0
- khalorg-0.0.0/src/khalorg/rrule.py +337 -0
- khalorg-0.0.0/src/khalorg/static/__init__.py +0 -0
- khalorg-0.0.0/src/khalorg/static/description_delete_command.txt +5 -0
- khalorg-0.0.0/src/khalorg/static/description_edit_command.txt +1 -0
- khalorg-0.0.0/src/khalorg/static/description_list_command.txt +25 -0
- khalorg-0.0.0/src/khalorg/static/description_new_command.txt +9 -0
- khalorg-0.0.0/src/khalorg/static/khal_format.txt +14 -0
- khalorg-0.0.0/src/khalorg/static/khalorg_format.txt +14 -0
- khalorg-0.0.0/src/khalorg.egg-info/PKG-INFO +422 -0
- khalorg-0.0.0/src/khalorg.egg-info/SOURCES.txt +96 -0
- khalorg-0.0.0/src/khalorg.egg-info/dependency_links.txt +1 -0
- khalorg-0.0.0/src/khalorg.egg-info/entry_points.txt +2 -0
- khalorg-0.0.0/src/khalorg.egg-info/requires.txt +14 -0
- khalorg-0.0.0/src/khalorg.egg-info/top_level.txt +1 -0
- khalorg-0.0.0/tests/__init__.py +0 -0
- khalorg-0.0.0/tests/agenda_items.py +203 -0
- khalorg-0.0.0/tests/helpers.py +440 -0
- khalorg-0.0.0/tests/khalorg_tester +30 -0
- khalorg-0.0.0/tests/static/__init__.py +0 -0
- khalorg-0.0.0/tests/static/agenda_items/all_day.org +21 -0
- khalorg-0.0.0/tests/static/agenda_items/all_day_until_with_time.org +21 -0
- khalorg-0.0.0/tests/static/agenda_items/body_first.org +21 -0
- khalorg-0.0.0/tests/static/agenda_items/demo.org +22 -0
- khalorg-0.0.0/tests/static/agenda_items/duplicate.org +40 -0
- khalorg-0.0.0/tests/static/agenda_items/minimal.org +3 -0
- khalorg-0.0.0/tests/static/agenda_items/multiple_timestamps.org +23 -0
- khalorg-0.0.0/tests/static/agenda_items/multiple_timestamps_unsorted.org +23 -0
- khalorg-0.0.0/tests/static/agenda_items/no_heading.org +20 -0
- khalorg-0.0.0/tests/static/agenda_items/no_time_stamp.org +20 -0
- khalorg-0.0.0/tests/static/agenda_items/not_first_child.org +21 -0
- khalorg-0.0.0/tests/static/agenda_items/not_first_heading.org +22 -0
- khalorg-0.0.0/tests/static/agenda_items/not_first_level.org +21 -0
- khalorg-0.0.0/tests/static/agenda_items/past.org +3 -0
- khalorg-0.0.0/tests/static/agenda_items/recurring.org +21 -0
- khalorg-0.0.0/tests/static/agenda_items/recurring_allday.org +21 -0
- khalorg-0.0.0/tests/static/agenda_items/recurring_and_non_recurring.org +22 -0
- khalorg-0.0.0/tests/static/agenda_items/recurring_first_item_moved.org +57 -0
- khalorg-0.0.0/tests/static/agenda_items/recurring_first_item_moved_expected.org +38 -0
- khalorg-0.0.0/tests/static/agenda_items/recurring_monthly.org +21 -0
- khalorg-0.0.0/tests/static/agenda_items/recurring_not_supported.org +20 -0
- khalorg-0.0.0/tests/static/agenda_items/rrule_recurring.org +22 -0
- khalorg-0.0.0/tests/static/agenda_items/rrule_recurring_1th.org +22 -0
- khalorg-0.0.0/tests/static/agenda_items/rrule_recurring_allday.org +22 -0
- khalorg-0.0.0/tests/static/agenda_items/rrule_recurring_and_non_recurring.org +66 -0
- khalorg-0.0.0/tests/static/agenda_items/rrule_recurring_duplicates.org +66 -0
- khalorg-0.0.0/tests/static/agenda_items/rrule_recurring_monthly.org +22 -0
- khalorg-0.0.0/tests/static/agenda_items/rrule_recurring_not_supported.org +22 -0
- khalorg-0.0.0/tests/static/agenda_items/scheduled_and_deadline.org +22 -0
- khalorg-0.0.0/tests/static/agenda_items/short_timestamp.org +21 -0
- khalorg-0.0.0/tests/static/agenda_items/timestamp_scheduled_deadline.org +0 -0
- khalorg-0.0.0/tests/static/agenda_items/two_items.org +41 -0
- khalorg-0.0.0/tests/static/agenda_items/two_timestamps.org +21 -0
- khalorg-0.0.0/tests/static/agenda_items/valid.org +21 -0
- khalorg-0.0.0/tests/static/agenda_items/valid_no_until.org +21 -0
- khalorg-0.0.0/tests/static/config_template.txt +31 -0
- khalorg-0.0.0/tests/static/khalorg_format_full.txt +15 -0
- khalorg-0.0.0/tests/static/test_config_combined.ini +11 -0
- khalorg-0.0.0/tests/static/test_config_default.ini +7 -0
- khalorg-0.0.0/tests/static/test_config_khal +34 -0
- khalorg-0.0.0/tests/static/test_config_user.ini +7 -0
- khalorg-0.0.0/tests/test_cli.py +144 -0
- khalorg-0.0.0/tests/test_commands.py +248 -0
- khalorg-0.0.0/tests/test_helpers.py +27 -0
- khalorg-0.0.0/tests/test_khal/helpers.py +12 -0
- khalorg-0.0.0/tests/test_khal/test_args.py +148 -0
- khalorg-0.0.0/tests/test_khal/test_calendar.py +49 -0
- khalorg-0.0.0/tests/test_khal/test_checker.py +78 -0
- khalorg-0.0.0/tests/test_org/test_agenda_items.py +272 -0
- khalorg-0.0.0/tests/test_org/test_helpers.py +26 -0
- khalorg-0.0.0/tests/test_rrule.py +62 -0
khalorg-0.0.0/.gitignore
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Changelog - Khalorg
|
|
2
|
+
This document describes the changes that were made to the software for each
|
|
3
|
+
version. The changes are described concisely, to make it comprehensible for the
|
|
4
|
+
user. A change is always categorized based on the following types:
|
|
5
|
+
- Bug: a fault in the software is fixed.
|
|
6
|
+
- Feature: a functionality is added to the program.
|
|
7
|
+
- Improvement: a functionality in the software is improved.
|
|
8
|
+
- Task: a change is made to the repository that has no effect on the source
|
|
9
|
+
code.
|
|
10
|
+
|
|
11
|
+
# 0.0.0
|
|
12
|
+
|
|
13
|
+
## Feature
|
|
14
|
+
- `khalorg new` is added. It converts an org agenda item into a `khal` agenda
|
|
15
|
+
item.
|
|
16
|
+
- `khalorg list` is added. It converts a `khal` agenda item into an org agenda
|
|
17
|
+
item.
|
|
18
|
+
- `khalorg edit` is added. It edits an existing `khal` agenda item with org
|
|
19
|
+
mode.
|
|
20
|
+
- `khalorg delete` is added. It deletes an existing `khal` item.
|
|
21
|
+
- Recurring items are supported by providing an org repeater in the
|
|
22
|
+
time stamp (e.g., `+1w`). The following is supported:
|
|
23
|
+
- the follow org repeaters: `+{integer}{d,w,m,y}`
|
|
24
|
+
- `khalorg new` and `khalorg edit --edit-dates` support 1 time stamp
|
|
25
|
+
per org agenda item.
|
|
26
|
+
- `khalorg list` concatenates timestamps that cannot be describes by
|
|
27
|
+
an org repeater, resulting in an org agenda item with multiple
|
|
28
|
+
timestamps.
|
|
29
|
+
- Supports an `until` date for recurring items. The until date can be
|
|
30
|
+
supplied through an org property `UNTIL`.
|
|
31
|
+
|
|
32
|
+
## Task
|
|
33
|
+
- An Office 365 workflow with a [bash script](./extras/calsync) is added which
|
|
34
|
+
synchronizes all `vdirsyncer` calendars and exports them to org with `khalorg`.
|
|
35
|
+
Davmail is used as the CalDav server.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Contributing to khalorg
|
|
2
|
+
|
|
3
|
+
Thank you for considering contributing to the `khalorg` project! We welcome contributions from everyone.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
1. Fork the repository on GitHub.
|
|
8
|
+
2. Clone your forked repository (`git clone https://github.com/your_username/khalorg.git`).
|
|
9
|
+
3. Create a new branch (`git checkout -b my_branch_name`).
|
|
10
|
+
4. Make your changes.
|
|
11
|
+
5. Commit your changes (`git commit -am "Add some feature"`).
|
|
12
|
+
6. Push your changes to your forked repository (`git push origin my_branch_name`).
|
|
13
|
+
7. Create a pull request on GitHub.
|
|
14
|
+
|
|
15
|
+
## Code of Conduct
|
|
16
|
+
|
|
17
|
+
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
|
|
18
|
+
|
|
19
|
+
## Reporting Bugs
|
|
20
|
+
|
|
21
|
+
If you encounter any bugs or issues, please report them on the issue tracker at:
|
|
22
|
+
|
|
23
|
+
[Issues](https://github.com/username/khalorg/issues)
|
|
24
|
+
|
|
25
|
+
## License
|
|
26
|
+
|
|
27
|
+
By contributing to this project, you agree that your contributions will be licensed under the MIT License.
|
|
28
|
+
|
|
29
|
+
|
khalorg-0.0.0/LICENCE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 BartSte
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
khalorg-0.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: khalorg
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: An interface between Org mode and Khal cli calendar.
|
|
5
|
+
Author: BartSte
|
|
6
|
+
License: MIT License
|
|
7
|
+
Keywords: khal,org mode,vdirsyncer,CalDav,agenda,emacs,neovim,orgmode-nvim
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
Provides-Extra: debug
|
|
12
|
+
Provides-Extra: test
|
|
13
|
+
Provides-Extra: build
|
|
14
|
+
License-File: LICENCE
|
|
15
|
+
|
|
16
|
+
[Click here for the GitHub page.](https://github.com/BartSte/khalorg)
|
|
17
|
+
|
|
18
|
+
# Contents
|
|
19
|
+
- [Introduction](#introduction)
|
|
20
|
+
- [Installation](#installation)
|
|
21
|
+
- [Usage](#usage)
|
|
22
|
+
- [Neovim plugin](#neovim-plugin)
|
|
23
|
+
- [Workflow for Office 365](#workflow-for-office-365)
|
|
24
|
+
- [Troubleshooting](#troubleshooting)
|
|
25
|
+
- [Contributing](#contributing)
|
|
26
|
+
- [License](#license)
|
|
27
|
+
- [Improvements](#improvements)
|
|
28
|
+
|
|
29
|
+
# Introduction
|
|
30
|
+
`khalorg` is an interface between Org mode and Khal cli calendar.
|
|
31
|
+
|
|
32
|
+
## Definitions
|
|
33
|
+
- [CalDav](<https://en.wikipedia.org/wiki/CalDAV>): internet standard for client access to calendars
|
|
34
|
+
- [Davmail](<https://davmail.sourceforge.net/e>): CalDav exchange gateway
|
|
35
|
+
- [khal](<https://github.com/pimutils/khal>): command line calendar app
|
|
36
|
+
- [khalel](<https://gitlab.com/hperrey/khalel>): interface between emacs and khal
|
|
37
|
+
- [nvim-orgmode](<https://github.com/nvim-orgmode/orgmode>): org mode for neovim
|
|
38
|
+
- [org](<https://orgmode.org>): plain text system for keeping notes, agendas and more
|
|
39
|
+
- [vdirsyncer](<https://github.com/pimutils/vdirsyncer>): synchronizes calendars and addressbooks between servers and the local file system
|
|
40
|
+
|
|
41
|
+
## Motivation
|
|
42
|
+
I use org mode to manage my agenda and my notes. However, in a professional
|
|
43
|
+
setting, you are often required to use proprietary software for your agenda,
|
|
44
|
+
like Office 365. Luckily, programs exist that can synchronize agendas from
|
|
45
|
+
different sources, by implementing the CalDav standard. Personally, I like to
|
|
46
|
+
use `vdirsyncer` with `khal` to synchronize my agendas. To bridge the gap
|
|
47
|
+
between `khal` and `org mode`, only 1 program exists called: `khalel`. However,
|
|
48
|
+
this program is designed for `emacs`. Since there are also org mode users
|
|
49
|
+
outside of `emacs` (e.g. `neovim`), `khalorg` aims to be a general interface
|
|
50
|
+
between `vdirsyncer`/`khal` and `org mode`.
|
|
51
|
+
|
|
52
|
+
Based on the above, the following workflow is desired:
|
|
53
|
+
|
|
54
|
+
``` example
|
|
55
|
+
┌──────┐
|
|
56
|
+
│CalDav│
|
|
57
|
+
└┬─────┘
|
|
58
|
+
┌▽─────────┐
|
|
59
|
+
│vdirsyncer│
|
|
60
|
+
└┬─────────┘
|
|
61
|
+
┌▽───┐
|
|
62
|
+
│khal│
|
|
63
|
+
└┬───┘
|
|
64
|
+
┌▽───────┐
|
|
65
|
+
│khalorg │
|
|
66
|
+
└┬───────┘
|
|
67
|
+
┌▽───────┐
|
|
68
|
+
│org mode│
|
|
69
|
+
└────────┘
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Features
|
|
73
|
+
- [x] Can be used by org mode for emacs, vim and neovim.
|
|
74
|
+
- [x] Vdirsyncer calendars can be manipulated by using the cli of `khal`
|
|
75
|
+
as the interface.
|
|
76
|
+
- [x] `khalorg new`: convert an org agenda item into a `khal` agenda
|
|
77
|
+
item.
|
|
78
|
+
- [x] `khalorg list`: convert a `khal` agenda item into an org agenda
|
|
79
|
+
item.
|
|
80
|
+
- [x] `khalorg edit`: edit an existing `khal` agenda item with org mode.
|
|
81
|
+
- [x] `khalorg delete`: delete an existing `khal` item.
|
|
82
|
+
- [x] Recurring items are supported by providing an org repeater in the
|
|
83
|
+
time stamp (e.g., `+1w`). The following is supported:
|
|
84
|
+
- the follow org repeaters: `+{integer}{d,w,m,y}`
|
|
85
|
+
- `khalorg new` and `khalorg edit --edit-dates` support 1 time stamp
|
|
86
|
+
per org agenda item.
|
|
87
|
+
- `khalorg list` concatenates timestamps that cannot be describes by
|
|
88
|
+
an org repeater, resulting in an org agenda item with multiple
|
|
89
|
+
timestamps.
|
|
90
|
+
- Supports an `until` date for recurring items. The until date can be
|
|
91
|
+
supplied through an org property `UNTIL`.
|
|
92
|
+
- [x] Has unittests
|
|
93
|
+
- [x] Includes an Office 365 workflow with a bash script
|
|
94
|
+
- [x] Semantic versioning
|
|
95
|
+
- [x] Gifs with demos
|
|
96
|
+
- [x] Neovim plugin
|
|
97
|
+
- [x] Is available on PyPI
|
|
98
|
+
|
|
99
|
+
# Installation
|
|
100
|
+
For safety, always make a back-up of your calendar before installing software
|
|
101
|
+
that is new to you.
|
|
102
|
+
|
|
103
|
+
Make sure your `khal` date format is compatible with org, otherwise it
|
|
104
|
+
will not work. When running `khal printformats` you should get:
|
|
105
|
+
``` example
|
|
106
|
+
longdatetimeformat: 2013-12-21 Sat 21:45
|
|
107
|
+
datetimeformat: 2013-12-21 Sat 21:45
|
|
108
|
+
longdateformat: 2013-12-21 Sat
|
|
109
|
+
dateformat: 2013-12-21 Sat
|
|
110
|
+
timeformat: 21:45
|
|
111
|
+
```
|
|
112
|
+
If not, check the documentation of `khal` on how to change this.
|
|
113
|
+
|
|
114
|
+
## PyPi
|
|
115
|
+
Install by running the following command:
|
|
116
|
+
``` bash
|
|
117
|
+
pip install khalorg
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## From source
|
|
121
|
+
Set your current working directory to the root directory, i.e, the
|
|
122
|
+
directory containing the `pyproject.toml` file. Next, run:
|
|
123
|
+
|
|
124
|
+
``` bash
|
|
125
|
+
pip install .
|
|
126
|
+
```
|
|
127
|
+
After this, the executable `khalorg` will be available.
|
|
128
|
+
|
|
129
|
+
## For development
|
|
130
|
+
If you want to develop the code, debug it, and test it, run:
|
|
131
|
+
``` bash
|
|
132
|
+
pip install -e '.[test,debug]'
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
# Usage
|
|
136
|
+
Use `khalorg --help` to get information about the cli of `khalorg`. The
|
|
137
|
+
following section discuss the `khalorg` commands that are available.
|
|
138
|
+
|
|
139
|
+
## List: from khal to org
|
|
140
|
+
|
|
141
|
+

|
|
142
|
+
|
|
143
|
+
Agenda items from `khal` can be converted to org items using the
|
|
144
|
+
`khalorg list` command. For examples:
|
|
145
|
+
|
|
146
|
+
``` bash
|
|
147
|
+
khalorg list my_calendar today 90d > my_calendar.org
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Here, the `khal` agenda items of the calendar `my_calendar` are
|
|
151
|
+
converted to org format and written to a file called `my_calendar.org`.
|
|
152
|
+
The range is specified from `today` till `90d` (90 days) in the future.
|
|
153
|
+
For more information about the allowed date formats, check the
|
|
154
|
+
`khal list` command, which is used for this functionality. It is assumed
|
|
155
|
+
that the `khal` calendar called `my_calendar` exists. Make sure
|
|
156
|
+
`my_calendar` is a calendar that exists on your local file system.
|
|
157
|
+
|
|
158
|
+
### –format
|
|
159
|
+
If `khalorg list --format` option is not defined, the default one is
|
|
160
|
+
used which can be found at `./khalorg/static/khalorg_format.txt`. If you
|
|
161
|
+
want to define your own format, you have 2 options: you can use the
|
|
162
|
+
`khalorg list --format` option, or you can place your custom format at
|
|
163
|
+
`$HOME/.config/khalorg/khalorg_format.txt` this format will then be used
|
|
164
|
+
instead of the default one that is shown below.
|
|
165
|
+
|
|
166
|
+
``` org
|
|
167
|
+
* {title}
|
|
168
|
+
{timestamps}
|
|
169
|
+
:PROPERTIES:
|
|
170
|
+
:ATTENDEES: {attendees}
|
|
171
|
+
:CALENDAR: {calendar}
|
|
172
|
+
:CATEGORIES: {categories}
|
|
173
|
+
:LOCATION: {location}
|
|
174
|
+
:ORGANIZER: {organizer}
|
|
175
|
+
:STATUS: {status}
|
|
176
|
+
:UID: {uid}
|
|
177
|
+
:URL: {url}
|
|
178
|
+
:END:
|
|
179
|
+
{description}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
the following keys are supported:
|
|
183
|
+
- `{attendees}`: a comma separated list of email addresses of attendees
|
|
184
|
+
- `{calendar}`: the name of the khal calendar
|
|
185
|
+
- `{categories}`: the categories property of the item
|
|
186
|
+
- `{description}`: the description of the item
|
|
187
|
+
- `{location}`: the location of the item
|
|
188
|
+
- `{organizer}`: the email of the organizer
|
|
189
|
+
- `{status}`: the status of the item, e.g., TENTATIVE or ACCEPTED
|
|
190
|
+
- `{timestamps}`: the timestamp of the item
|
|
191
|
+
- `{title}`: the summary of the item
|
|
192
|
+
- `{uid}`: the UID of the item
|
|
193
|
+
- `{rrule_until}`: the until value of the RRULE.
|
|
194
|
+
- `{url}`: the url property
|
|
195
|
+
|
|
196
|
+
the following keys are supported but are typically reserved for internal use
|
|
197
|
+
and are therefore less informative:
|
|
198
|
+
|
|
199
|
+
- `{until}`: the until property value. Is empty when using `khalorg list`.
|
|
200
|
+
- `{rrule}`: the ICal RRULE of the item.
|
|
201
|
+
|
|
202
|
+
### Recurring items
|
|
203
|
+
|
|
204
|
+
The `khalorg list` command relies on the `khal list` command. Using this
|
|
205
|
+
command the `RRULE` of each item is retrieved to created the correct org
|
|
206
|
+
repeater. Only simple org repeaters are supported that have the
|
|
207
|
+
following form: `+[number][h,w,m,y]`. Complex `RRULEs` are described by
|
|
208
|
+
concatenating the corresponding timestamps within 1 agenda item,
|
|
209
|
+
resulting in a list of items. For example, the agenda item below
|
|
210
|
+
represents a weekly recurring event where the first meeting was moved to
|
|
211
|
+
another date, resulting in a timestamp without a repeater, and one with
|
|
212
|
+
a repeater.
|
|
213
|
+
|
|
214
|
+
``` org
|
|
215
|
+
* Meeting
|
|
216
|
+
<2023-01-05 Thu 01:00-02:00>
|
|
217
|
+
<2023-01-08 Sun 01:00-02:00 +1w>
|
|
218
|
+
:PROPERTIES:
|
|
219
|
+
:UID: 123
|
|
220
|
+
:LOCATION: Somewhere
|
|
221
|
+
:ORGANIZER: Someone (someone@outlook.com)
|
|
222
|
+
:ATTENDEES: test@test.com, test2@test.com
|
|
223
|
+
:URL: www.test.com
|
|
224
|
+
:END:
|
|
225
|
+
Hello,
|
|
226
|
+
|
|
227
|
+
Lets have a meeting.
|
|
228
|
+
|
|
229
|
+
Regards,
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
Someone
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## New: from org to khal
|
|
236
|
+
|
|
237
|
+

|
|
238
|
+
|
|
239
|
+
An org agenda item can be converted to a new `khal` agenda item by
|
|
240
|
+
feeding the org item through stdin to `khalorg new` and specifying the
|
|
241
|
+
khal calendar name as a positional argument. For example, the consider
|
|
242
|
+
the org item below, which is saved as `meeting.org`.
|
|
243
|
+
|
|
244
|
+
``` org
|
|
245
|
+
* Meeting
|
|
246
|
+
<2023-01-01 Sun 01:00-02:00 +1w>
|
|
247
|
+
:PROPERTIES:
|
|
248
|
+
:UID: 123
|
|
249
|
+
:LOCATION: Somewhere
|
|
250
|
+
:ORGANIZER: Someone (someone@outlook.com)
|
|
251
|
+
:ATTENDEES: test@test.com, test2@test.com
|
|
252
|
+
:URL: www.test.com
|
|
253
|
+
:END:
|
|
254
|
+
Hello,
|
|
255
|
+
|
|
256
|
+
Lets have a meeting.
|
|
257
|
+
|
|
258
|
+
Regards,
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
Someone
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
This item can be converted to the `khal` calendar called
|
|
265
|
+
"my<sub>calendar</sub>" as follows:
|
|
266
|
+
|
|
267
|
+
``` bash
|
|
268
|
+
cat meeting.org | khalorg new my_calendar
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
It is assumed that the `khal` calendar called "my<sub>calendar</sub>"
|
|
272
|
+
exists. Make sure "my<sub>calendar</sub>" is a calendar that exists on
|
|
273
|
+
your local file system.
|
|
274
|
+
|
|
275
|
+
### Recurring items
|
|
276
|
+
Only 1 timestamp per org item is supported. Note that the meeting above
|
|
277
|
+
is repeated every week (`+1w`). Only simple org repeaters are supported
|
|
278
|
+
that have the following form: `+[number][h,w,m,y]`. These events repeat
|
|
279
|
+
forever, unless you specify an end date using the \`UNTIL\` property in
|
|
280
|
+
the org file.
|
|
281
|
+
|
|
282
|
+
Personally, when I need to create a complex repeat pattern (or when I
|
|
283
|
+
need outlook specific items like a Teams invite), I create the event in
|
|
284
|
+
outlook first. Next, I use `khalorg edit` to change the fields that need
|
|
285
|
+
editing (e.g., the description).
|
|
286
|
+
|
|
287
|
+
### Attendees
|
|
288
|
+
Optionally, attendees can be added to the `ATTENDEES` property field.
|
|
289
|
+
The attendees will be added to the `Attendees` field of `khal`. Once you
|
|
290
|
+
synchronize `khal` with a server (e.g., outlook) an invitation will be
|
|
291
|
+
send to the attendees.
|
|
292
|
+
|
|
293
|
+
## Edit: from org to khal
|
|
294
|
+
|
|
295
|
+

|
|
296
|
+
|
|
297
|
+
Existing `khal` events can be updates by feeding an org file with the
|
|
298
|
+
corresponding UID through stdin to the `khalorg edit` command. For
|
|
299
|
+
example, the org agenda item of <span class="spurious-link"
|
|
300
|
+
target="New">*New*</span> can be altered and used as an input for
|
|
301
|
+
`khalorg edit`, as long as the UID remains untouched.
|
|
302
|
+
|
|
303
|
+
``` org
|
|
304
|
+
* Edited meeting
|
|
305
|
+
<2023-01-01 Sun 01:00-02:00 +1w>
|
|
306
|
+
:PROPERTIES:
|
|
307
|
+
:UID: 123
|
|
308
|
+
:ORGANIZER: Someone (someone@outlook.com)
|
|
309
|
+
:ATTENDEES: other@test.com
|
|
310
|
+
:END:
|
|
311
|
+
Hello,
|
|
312
|
+
|
|
313
|
+
I edited the meeting by removing the location and url. I also changed the
|
|
314
|
+
title and the attendees field.
|
|
315
|
+
|
|
316
|
+
Regards,
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
Someone
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Next, run the following command:
|
|
323
|
+
|
|
324
|
+
``` bash
|
|
325
|
+
cat meeting.org | khalorg edit my_calendar
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
When using `khalorg edit` please consider the following:
|
|
329
|
+
|
|
330
|
+
- Editing an existing event is different from creating a new one as the
|
|
331
|
+
original `icalendar` file is retained. Only parts of it are altered.
|
|
332
|
+
This is convienent when the icalendar file contains information that
|
|
333
|
+
cannot be generated by `khalorg`. For example, a Microsoft Team
|
|
334
|
+
meeting.
|
|
335
|
+
- Only the PROTO event is edited, i.e., the whole series is altered not
|
|
336
|
+
only the occurence.
|
|
337
|
+
- `khal edit` will only update the dates + recurrence if the
|
|
338
|
+
`--edit-dates` flag is passed. This avoids editing the start-stop date
|
|
339
|
+
when editing an event that contains multiple timestamps (which are not
|
|
340
|
+
supported).
|
|
341
|
+
|
|
342
|
+
## Delete: from org to khal
|
|
343
|
+
|
|
344
|
+

|
|
345
|
+
|
|
346
|
+
An event can be deleted from a khal calendar by feeding an org file to the
|
|
347
|
+
`khalorg delete` command through stdin. The org file must contain an agenda
|
|
348
|
+
item with a non-empty UID property. For example, the khal event that was
|
|
349
|
+
created using the <span class="spurious-link" target="New">*New*</span> command
|
|
350
|
+
above can be removed by feeding the same file to `khalorg delete`:
|
|
351
|
+
|
|
352
|
+
``` bash
|
|
353
|
+
cat meeting.org | khalorg delete my_calendar
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### Recurring items
|
|
357
|
+
When deleting recurring items the whole series will be removed. Removing
|
|
358
|
+
occurrences is not supported.
|
|
359
|
+
|
|
360
|
+
## Neovim plugin
|
|
361
|
+
The neovim plugin can be found here: [nvim-khalorg](https://github.com/BartSte/nvim-khalorg).
|
|
362
|
+
|
|
363
|
+
# Workflow for Office 365
|
|
364
|
+
The diagram below illustrates the workflow than can be achieved when using
|
|
365
|
+
`khalorg`. The folder `extras`, on the
|
|
366
|
+
[GitHub](https://github.com/BartSte/khalorg) page, contains a `bash` script
|
|
367
|
+
called `calsync`, that synchronizes `vdirsyncer` calendars and exports them as
|
|
368
|
+
an org file using the `khalorg list` command. Davmail is used as the CalDav
|
|
369
|
+
server in this specific example.
|
|
370
|
+
|
|
371
|
+
``` example
|
|
372
|
+
┌──────────┐
|
|
373
|
+
│Office 365│
|
|
374
|
+
└┬─────────┘
|
|
375
|
+
┌▽──────┐
|
|
376
|
+
│Davmail│
|
|
377
|
+
└┬──────┘
|
|
378
|
+
┌▽─────────┐
|
|
379
|
+
│vdirsyncer│
|
|
380
|
+
└┬─────────┘
|
|
381
|
+
┌▽───┐
|
|
382
|
+
│khal│
|
|
383
|
+
└┬───┘
|
|
384
|
+
┌▽───────┐
|
|
385
|
+
│khalorg │
|
|
386
|
+
└┬───────┘
|
|
387
|
+
┌▽───────┐
|
|
388
|
+
│org mode│
|
|
389
|
+
└────────┘
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
## Troubleshooting
|
|
393
|
+
|
|
394
|
+
If you encounter any issues, please report them on the issue tracker at:
|
|
395
|
+
[khalorg issues](https://github.com/BartSte/khalorg/issues)
|
|
396
|
+
|
|
397
|
+
## Contributing
|
|
398
|
+
|
|
399
|
+
Contributions are welcome! Please see [CONTRIBUTING](./CONTRIBUTING.md) for
|
|
400
|
+
more information.
|
|
401
|
+
|
|
402
|
+
## License
|
|
403
|
+
|
|
404
|
+
Distributed under the [MIT License](./LICENCE).
|
|
405
|
+
|
|
406
|
+
# Improvements:
|
|
407
|
+
- [ ] Timezones are not yet supported, so `khalorg` will only work when
|
|
408
|
+
you agenda remain in the timezone that you specified within your
|
|
409
|
+
`khal` config.
|
|
410
|
+
- [ ] Running khal commands directly from a script in not
|
|
411
|
+
straightforward. Therefore, khal is executed as a subprocess, by using
|
|
412
|
+
its command line interface.
|
|
413
|
+
- [ ] `khalorg new` and `khal edit` only support 1 timestamp per item.
|
|
414
|
+
However, it is desired that all timestamps within 1 org agenda item,
|
|
415
|
+
end up in 1 khal event, as is the case for the `orgagenda`. To achieve
|
|
416
|
+
this the following could be build:
|
|
417
|
+
- [ ] When multiple timestamps without an org repeater are provided,
|
|
418
|
+
find the `RRULE` that describes them. Also, set the `UNTIL` date to
|
|
419
|
+
the last date. If no `RRULE` can be found, raise an error. Another
|
|
420
|
+
option could be to use the `RDATE` option of ICal.
|
|
421
|
+
- [ ] When multiple timestamps with an org repeater are presented, try
|
|
422
|
+
to find the `RRULE` that describes them.
|