Skip to main content

A tool to help developing LibreOffice Extension.

Project description

This tool helps developing LibreOffice Extension. It mainly does:

  • build an LibreOffice extension from your source

  • create the Addons.xcu file following a simple yaml conf file.

  • install / uninstall extension

  • create shortcut from installed extension to development files

WHY

When developing for LibreOffice, it is common to often reinstall the extension to test it. It means compiling, uninstalling, installing. This tasks are time consuming. Beside, if you want to make modification of your code without reinstalling, you need to create some shortcuts from the installation path to your code. This command line tool helps achieving this goal.

Installation

$ pip install lo-extension-dev

Then create two config files using yaml. One to configure your extension, the other one to create the Addons.xcu files (OfficeMenuBar & OfficeToolBar).

Usage

To develop a LibreOffice extension, we advocate to use the following architecture. Your extension code is in src/.

─ my_extension
    │   ├── addons_conf.yml
│   ├── Addons.xcu
│   ├── extension
│   │   ├── 0.0.1
│   │   │   ├── lo-extension-testing.oxt
│   ├── extension.yml
│   ├── README.md
│   └── src
│       ├── Accelerators.xcu
│       ├── Addons.xcu
│       ├── assets
│       │   ├── avaudiologo.svg
│       │   └── sc_underline.svg
│       ├── description
│       │   ├── descr-en.txt
│       ├── description.xml
│       ├── dialogs
│       │   ├── window.xdl
│       ├── Events.xcu
│       ├── META-INF
│       │   └── manifest.xml
│       ├── Office
│       │   └── UI
│       ├── python
│       │   ├── pythonpath
│       │   └── my_macros.py
│       ├── README.md
│       └── registration
│           ├── license_en.txt
└── README.md

Once installed, a functino manage_extension is available in your terminal.

To get help, just type:

$ manage_extension -h

options:
-h, --help

show this help message and exit

-o, --open

Open installation directory

-m, --make

Make extension

-i, --install

Install extension

-u, --uninstall

Uninstall extension

-d, --dev

Set dev shortcuts

-id, --install-dev

Install and set dev shortcuts

Configuration files

We use two configuration files, using yaml syntax. One to generate menubar menu and toolbar menu. The second one hold the extension configuration.

extension.yml

  • version : version number in format 0.0.1

  • extension_name : name of your extension (no space)

  • file_extension : zip or oxt

  • lib : com.company.my_extension

  • macros_directory : in this example, it is python. In some project, it is macros.

-addons_conf : it shouldn’t be changed. The file holding menubar & toolbar conf.

  • menu_name : the label displayed in the menu bar.

addons_conf.yml

This files has two main sections :

  • OfficeMenuBar

  • OfficeToolBar

You can create a submenu. Don’t forget, the keys following a submenu have to be named as the function they call. It’s the same logic for the OfficeToolBar.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lo_extension_dev-0.0.4.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

lo_extension_dev-0.0.4-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file lo_extension_dev-0.0.4.tar.gz.

File metadata

  • Download URL: lo_extension_dev-0.0.4.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for lo_extension_dev-0.0.4.tar.gz
Algorithm Hash digest
SHA256 75967e0585e5ffb368400b4e7735432a75a665cd53ed064c94a0bc5165784b49
MD5 d6d755b70b339ac51fb7f4d0e7a41896
BLAKE2b-256 1ce46bcff67f8429d56e3311076c99ef59c8b0ae4079ae6e54b9ae52ee2d7244

See more details on using hashes here.

File details

Details for the file lo_extension_dev-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for lo_extension_dev-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1fe40f19a9aad95cab25841c0284fbdf6948c56c39f3d4ba8de356ca0a057c5f
MD5 814b11042dc24fa0b43de0b61f4b5b0e
BLAKE2b-256 e3af58c92b5a086b93ba8e5fc9a8044a30c3f8ff43e0c32fe4a7f4559a9b5355

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page