<commit_before>TbSync Provider Documentation
=================================

This document tries to cover all aspects of how to create a provider add-on for TbSync to extends its sync capabilities. All TbSync providers are currently designed as *bootrapped extensions*, for which support is probably going to be dropped from Thunderbird at some time. We are working on migrate them into future proof *WebExtensions*.

Getting Started
---------------

To get started, generate a basic provider add-on skeleton, which will get you a working add-on for TB68 with some preconfigurations for your provider. The add-on file has the ``XPI`` extension, but is simply a zip file. Unzip it somewhere. You will see the following structure:

::

    Project
    ├── LICENSE          
    ├── manifest.json
    ├── chrome.manifest
    ├── bootstrap.js
    ├── skin          
    │   ├── logo16.png
    │   └── logo32.png
    │   └── logo48.png
    ├── _locales          
    │   └── en-US
    │       ├── provider.strings
    │       ├── provider.dtd
    │       └── messages.json
    └── content
        ├── provider.js        
        ├── includes
        │   └── sync.js    
        └── manager
            ├── provider.strings
            ├── provider.dtd
            └── messages.json

This documentation will refer to this structure and will explain the different files and folders as needed.

Registering your Provider
-------------------------

The file ``bootstrap.js`` is registering your provider with TbSync and the generated file should work out of the box. You should not touch it, if you do not know exactly what you are doing.


Implementing the Provider Interface
-----------------------------------

After your provider has been registered, TbSync will read the file ``provider.js``, where the provider interface has to be implemented.


.. js:autofunction:: base<commit_msg>Update index.rst<commit_after>TbSync Provider Documentation
=================================

This document tries to cover all aspects of how to create a provider add-on for TbSync to extends its sync capabilities. All TbSync providers are currently designed as *bootrapped extensions*, for which support is probably going to be dropped from Thunderbird at some time. We are working on migrate them into future proof *WebExtensions*.

Getting Started
---------------

To get started, generate a basic provider add-on skeleton, which will get you a working add-on for TB68 with some preconfigurations for your provider. The add-on file has the ``XPI`` extension, but is simply a zip file. Unzip it somewhere. You will see the following structure:

::

    Project
    ├── LICENSE          
    ├── manifest.json
    ├── chrome.manifest
    ├── bootstrap.js
    ├── skin          
    │   ├── logo16.png
    │   └── logo32.png
    │   └── logo48.png
    ├── _locales          
    │   └── en-US
    │       ├── provider.strings
    │       ├── provider.dtd
    │       └── messages.json
    └── content
        ├── provider.js        
        ├── includes
        │   └── sync.js    
        └── manager
            ├── provider.strings
            ├── provider.dtd
            └── messages.json

This documentation will refer to this structure and will explain the different files and folders as needed.

Registering your Provider
-------------------------

The file ``bootstrap.js`` is registering your provider with TbSync and the generated file should work out of the box. You should not touch it, if you do not know exactly what you are doing.


Implementing the Provider Interface
-----------------------------------

After your provider has been registered, TbSync will read the file ``provider.js``, where the provider interface has to be implemented.


.. js:autofunction:: base#load

{'fraction_non_alphanumeric': 0.12980132450331125, 'fraction_numerical': 0.00423841059602649, 'mean_word_length': 2.3594306049822062, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4351406', 'n_tokens_mistral': 964, 'n_tokens_neox': 962, 'n_words': 472}