An Online Book
Select Theme
An Open Source Project Site
Select Theme
A Presentation
Select Theme
A Diagram
Coming Soon
fpm: FTD Package Manager & Static Site Generator
FPM is a command line tool written in Rust that acts as both package manager for FTD programs as well as static site generator that converts .ftd files to .html files you can ship on Github Pages, Vercel etc.
To convert a folder contianing ftd files, create a FPM.ftd file:
-- import: fpm

-- fpm.package: fpm.dev
zip: github.com/fifthtry/fpm.dev/archive/refs/heads/main.zip
We have created a package named fpm.dev. Packages in FPM are named after the domain where they would be published. Every FPM package is a website.
Distributed Package Manager
Unlike other package managers like pypi, npm and crates, there is no central package repository in FPM. Since every FPM package is a website, that website acts as the package repository.
FPM support package dependencies. To add a dependency add it in FPM.ftd file:
-- import: fpm

-- fpm.package: fpm.dev
zip: github.com/fifthtry/fpm.dev/archive/refs/heads/main.zip

-- fpm.dependency: fifthtry.github.io/Forest-Theme as ft

Here fpm.dev has a dependency on fifthtry.github.io/Forest-Theme.

We have also used “alias” feature to bind the name of this dependency to ft, so FTD files can write -- import: ft instead of -- import: fifthtry.github.io/Forest-Theme.

Fungible Themes - Package Interface

An FPM package contains one or more “ftd modules”, and the modules export one or more “symbols”, eg records, variables, components and so on.

The set of modules and symbols exported by a package is called “package interface” of that package. FPM lets one package declare that it is “implementing” another package. All packages that implement a common package are interchangeable without chaning any code, and only updating the dependency in FPM.ftd file.

This allows for component libraries and themes to be easily interchangeable. So if you use any component, say a event schedule bar, dark mode switcher, etc, you know you can easily find other packages that are compatible with those packages and switch to those components easily.

Translation Tracking
FPM has a unique translation tracking feature. An FPM package can declare it can be translated by adding a language key:
-- import: fpm

-- fpm.package: fpm.dev
zip: github.com/fifthtry/fpm.dev/archive/refs/heads/main.zip
language: English
translation: hi.fpm.dev

Here we have declared that this package supports translation by adding the language key. Also we have already got one “accepted translation”, hi.fpm.dev.

Once you have enabled translation, you can create a new fpm package, here hi.fpm.dev, and give it a FPM.ftd file:

-- import: fpm

-- fpm.package: hi.fpm.dev
zip: github.com/fifthtry/fpm.dev-hi/archive/refs/heads/main.zip
language: hi
translation-of: fpm.dev

This can be your entire package when you create a new translation. When you build a translated FPM package, FPM is aware it is a translation, and it builds all the files in the original, which if fpm.dev, so you do not have to copy any files.

FPM uses a fallback based logic, for every missing file, it builds the corresponding file from original package. So say if index.ftd is missing in Hindi translation, because it is not yet translated, FPM will pick the index.ftd from the English/original version and hi.fpm.dev will be a “complete website”.

Once a file has been created in translation package, it can be in other of three states: a. file exists but has never been accepted, meaning translation has started but not yet finished, b. file is upto date with the original, and c. file was once up to date, but since then English version has changed.

In a and c we show a warning on the genrated pages so readers can see that either the translation is not complete or out of date, and we give quick option to switch to the English/original version. In case if things are out of date, we also show since how long is it out of date and what is the diff in the Enlish version from when Hindi version was last marked up to date, to current English version.

Translation Status
We also create a translation status page that shows a summary information for all languages how many documents are upto date, missing etc.

Checkout what is planned in Roadmap, and day to day updates in the Journal.

Github: github.com/FifthTry/fpm Discord: #fpm on FifthTry