Part I. Introduction: Tepl 6 Reference Manual

# Part I. Introduction

Tepl is a library that eases the development of GtkSourceView-based text editors and IDEs. Tepl is the acronym for “Text editor product line”.

Tepl was previously named Gtef (GTK text editor framework). The project has been renamed in June 2017 to have a more beautiful name. The end of Tepl is pronounced like in “apple”.

The Tepl library follows a product line approach, inspired by Feature-Oriented Software Product Lines: Concepts and Implementation (2013 - Apel, Batory, Kästner and Saake).

Instead of creating one general-purpose text editor or IDE with a plugin system, the idea is to create several specialized text editors. For example specialized for one programming language, or one development platform, or a small group of related languages. By being specialized, an application is potentially better at what it does. It follows more closely the UNIX philosophy to “do only one thing but do it well”. And it better follows the GNOME philosophy: writing applications that Just Works; when a user opens the text editor for the first time, it should work out-of-the-box, without the need to find, install and configure plugins. Of course it still makes sense to develop one general-purpose text editor for the languages not yet covered by specialized text editors.

Most of the features of the library are available as a toolkit, but the interesting part of Tepl is that it contains also a framework (for now without a plugin system). The goal of the framework is to provide higher-level APIs, to be able to create a new text editor easily. An application wanting to use Tepl is not forced to use the framework in its entirety, it is possible to use just the toolkit parts. The library is implemented this way to achieve maximum re-usability: the framework is less re-usable because it makes some assumptions about the general architecture of the application, but since the features are also available with a lower-level API – as a toolkit – all text editors and IDEs based on GtkSourceView (or even other types of applications) should be able to benefit from the features implemented in Tepl.

Initially, Tepl was created as an incubator for new GtkSourceView features, but in practice the features remained in Tepl, because Tepl is considered less stable for its APIs, and it's convenient to iterate on the APIs with more freedom. Another reason is that renaming the namespace of all symbols is difficult to do in C.

## Boundary between GtkSourceView and Tepl

For the framework part of Tepl (not the toolkit parts), there is a somewhat clear boundary between GtkSourceView and Tepl: the top-level object in GtkSourceView is the GtkSourceView widget (representing only one view, or one file), while the GtkSourceView widget is at the bottom of the containment hierarchy in the Tepl framework (it is a “somewhat” clear boundary because there is also TeplBuffer, a subclass of GtkSourceBuffer).

The top-level object in Tepl is TeplApplication, representing the whole application which can contain several windows, with each window containing one or several GtkSourceView widgets (typically with a Tabbed Document Interface).

So the GtkSourceView library is not aware that there can be several files opened in the application, while the Tepl framework has a complete view of the application with regards to the opened files/tabs. It permits to implement higher-level APIs.

## API stability

The API is now constantly unstable. The library soname is adapted for each release.

Tepl contains more experimental APIs than GtkSourceView, sometimes even unfinished features. API design is hard, it needs an iterative process. Instead of being stuck for years with a non-optimal API, the Tepl developers want to be able to break the API at any time, to iteratively improve it. Sometimes we see possible improvements several years later.

The API breaks are documented in this section.

## GTK dependency

Tepl 6 depends on GTK 3.

## pkg-config name

For Tepl 6, the pkg-config name is: `tepl-6`