Back to Lawnchair

The `flowerpot` ruleset format

flowerpot/README.md

8182.5 KB
Original Source

The flowerpot ruleset format

Keeping beautiful things organized.

Basic overview

We want to be able to provide an automatic categorization of apps into folders and tabs and needed a fitting file format for storing rules in a compact but human-readable way. This is what flowerpot is, a simple format for rule lists which is easy to read and equally easy to parse from code. Repurposing the general ideas of this format for other uses is also easily possible.

Format

Flowerpot files are built as a line delimited list of rules. Except for metadata related rules/tags, most rules are filters. The parser identifies rules by the leading character.

Supported rules

IdentifierRuleDescriptionNotes
PackagePackage name filterVersion 1 only supports full package names as filter
#CommentComment
$VersionVersion tag (integer)Must be the first non-comment item, can only occur once
:IntentActionIntent action to filter by
;IntentCategoryIntent category to filter byTested in combination with the MAIN action
&CodeRuleRule which has been defined in codeAccepts arguments seperated by `

File names

Each file is a ruleset for one category, and the name of the file represents the name (codename) of that category. Flowerpot files have no file extension. You are advised to use uppercase (snake case) filenames spelling out the English name of the category.

Versioning

Versions are identified by an incrementing integer value and accompanied by codenames. Codenames are given alphabetically and should be the name of a flower (I encourage everyone to use names of pink flowers, if possible).

Current Version

The format is currently at version 1 (azalea). This is the initial version of flowerpot.

Azalea - A beautiful pink flower, known in China as "thinking of home bush" (sixiang shu).

Past versions

There are no past versions of flowerpot yet.