**KF5 or KF6?**
While the plan so far was to only include Grantlee for KF6, there are reasons to do that work already before KF6:
* the KF6 plan also includes some redesigns at least on repo level, so being able to gather experience with the new design before allows to have a clean and perfect version right on the start of KF6
* a version in KF5 allows Grantlee users to port already now to the KF variant and all it potential differences to the current Grantlee, reducing the workload at the actual Qt6/KF6 port
**Current state**
Grantlee itself consists of two independent libraries:
* Grantlee::Templates, a text-template system based on Qt introspection
* Grantlee::TextDocument, a builder design pattern implementation for processing QTextDocuments
KDE has the GrantleeTheme project, extending Grantlee with generic features as loading templates from the Qt resource system, a localizer variant using KF's KI18n and support for "icon" tag in templates.
Known Grantlee users (December 2019):
```
$ apt-cache rdepends libgrantlee-templates5
libgrantlee-templates5
Reverse Depends:
libgrantlee5-dev
skrooge
rocs
libkf5pimcommon5abi3
libkf5messageviewer5abi5
libkf5messageviewer-plugins
libkf5kaddressbookgrantlee5
libkf5grantleetheme5
libkf5grantleetheme-plugins
libkf5calendarutils5abi1
libkf5calendarutils-bin
kdepim-addons
kjots
khelpcenter
kdevelop52-libs
kdevelop
$ apt-cache rdepends libgrantlee-textdocument5
libgrantlee-textdocument5
Reverse Depends:
libgrantlee5-dev
libkf5pimtextedit5abi3
libkf5messageviewer5abi5
libkf5messagecomposer5abi2
kjots
```
**Plans for new design:**
The following so far are current ideas to develop off from:
Namespace: keeping "Grantlee"
While dropping the name Grantlee name has been proposed, possibly in favour of generic K & KF, given the otherwise generic terms in the API like "text", "template", etc., the use of "Grantlee" (and thus its associated solution space and features) removes the need for having to use more generic terms to differentiate the library and classes from other things dealing with text and templates.
So the namespace Grantlee would be kept. But it also means extra work needed to ensure no naming clashes with the old grantlee libraries in builds (cmake config, library names) and at runtime (symbol names), by whatever approaches.
Library/plugin distributions over repos: two separate KF modules
The library Grantlee::Templates is used by many consumers without its silbling Grantlee::TextDocument. To ease usage by packagers and bundled app builds, having it in its own repo and responding release tarballs, without further build flags needed, should improve experience and thus help reuse. Names would be "grantlee" for the repo, "KF5Grantlee" for the library.
The library Grantlee::TextDocument would be split into a second repository. Names would be "?" for the repo, "?" for thel ibrary (placeholder "KF5GrantleeTextDocument" right now)
**Execution plan:**
Given most consumers of Grantlee as PIM projects, part of KDE Gear release cycle, current target for execution is to have KF modules part of KF releases in time for KDE Gear 21.12, which means KF 5.88 begin of November.
**Artifacts**
https://gitlab.com/kossebau/grantlee for now serves as repository to collect the initial work (invent.kde.org has some commit check hooks not happy with existing commits, with more to be added, move to invent.kde.org planned once all are in).
[x] commits to github grantlee (modulo buildsystem & code reformat)
[x] commits from earlier kf-import work, found at https://github.com/kde/grantlee
[x] commits from Cuteless
[ ] missing license headers -> https://github.com/steveire/grantlee/pull/75
[ ] find name for former Grantlee::TextDocument
[ ] split-off into two repos
Repos that need porting
* education/rocs
* kdevelop
* office/skrooge
* pim/akonadi-contacts -> https://invent.kde.org/pim/akonadi-contacts/-/merge_requests/11
* pim/akregator -> https://invent.kde.org/pim/akregator/-/merge_requests/19
* pim/grantleetheme -> https://invent.kde.org/pim/grantleetheme/-/merge_requests/4
* pim/kcalutils -> https://invent.kde.org/pim/kcalutils/-/merge_requests/15
* pim/kdepim-addons -> https://invent.kde.org/pim/kdepim-addons/-/merge_requests/16
* pim/kjots
* pim/knotes -> https://invent.kde.org/pim/knotes/-/merge_requests/4
* pim/messagelib -> https://invent.kde.org/pim/messagelib/-/merge_requests/64
* system/khelpcenter
**Background:**
Stephen Kelly in December 2019 proposed to include his Grantlee project into KDE Frameworks:
https://marc.info/?l=kde-core-devel&m=157566819811019&w=2
The initial discussion how to do that ended with Stephen deciding he rather would want that happen for KF6 only: https://marc.info/?l=kde-frameworks-devel&m=157757468828735&w=2
Meanwhile upstream development has fully stalled, e.g. https://github.com/steveire/grantlee/pull/70 never getting any reaction. Which triggered the Cutelyst project to even fork it as a new Cutelee project: https://github.com/cutelyst/cutelee. Cutelyst might be interested to switch to a KF version of Grantlee, but as they already need Qt6 support now, that might only happen in KF6 time.