raylib has a big collection of examples to learn how to use the library. It started with just a few examples and it has grown to +160 in the last 12 years, with many of those examples contributed by the community (~50%).
**Managing those examples has become a considerable amount of work.** Some years ago an [examples template](https://github.com/raysan5/raylib/blob/master/examples/examples_template.c) was created to standarize examples format and contents, it simplified the review process but implementing a new example is not enough; adding/modifying an new example from the collection implies a series of actions:
This process has been done manually for many years and required a lot of time, it was also very prone to errors, like missing some edits or adding typos.
Finally I decided to automatize the process and create a pipeline to `add`, `rename`, `remove`, `validate` and `build` examples automatically edited. Additionally I decided to a `validation` process to verify the integrity of all the required files and even fix some of the potential issues.
## `rexm` supported commands
The following commands are supported by `rexm` to manage examples:
```
help : Provides command-line usage information
create <new_example_name> : Creates an empty example, from internal template
add <example_name> : Add existing example, category extracted from name
update : Validate and update examples collection, generates report
```
## `rexm` examples **validation** and **update**
Two commands have been added to `rexm` to validate all the examples, checking if the examples follow all requirements and all the files needed are available, that way the examples review has been automated, generating complete tables on examples status.
As we were able to detect possible examples errors and inconsistencies, an additional command was implemented to **update** all examples with inconsistencies.
## `rexm` technology used
Usually this kind of pipelines are implemented with high-level scripting languages like Python due to all the functionality already provided, specially useful for files/paths management or text files editing but those languages also require the interpreter available to run. I decided to follow a less common route, implementing the tool directly in C, the language I use for raylib and all my tools.
C standard library does not provide a lot of the high-level functionality required for files and text management but here is where raylib came to the rescue. raylib already contained some functions to work with the file system and to manage text, so I decided to implement the required additional ones to use raylib on pipelines building.
The main benefit of using C and raylib is that the pipeline can be created in C and it can be build int an independent multi-platform dependency-free executable tool; it also open the door for a possible expansion into a UI interface, if required in the future.
As mentioned, implementing the pipeline in C with raylib required some additional support functions to be added, to simplify some tasks and align with functionality provided by high-level languages; but it was not dramatic and the truth is that the development process just flowed smoothly.