Organize the formula folder

In this section, you will find how to organize Ritchie’s formula folder.

What is the formula folder?

This folder contains the files with the formula’s behavior.

Each programming language has its own specificities, but the formula’s structure is almost always the same, no matter what language is used, and will contain:

FileDescription
config.jsonfile to configure the formula inputs.
main filefile to extract local variables.
pkg/formula filefile to implement the formula operation.
Dockerfilefile to build docker images.
README filefile to explain what the formula does.
Makefile filefile to compile the formula’s code (will be deprecated 03/2021).
build.sh filefile to compile the formula’s code in shell.
metadata.json filefile to tag the formula’s information.
set_unmask.sh filefile used by the Makefile file.
help.json filesfile to configure formula helper messages on the CLI.

You can find all languages templates on the ritchie-formulas repository.

Formula folder examples

To change the formula’s behavior for this language, you’ll have at least to update the following files:

  • config.json: Update the inputs configurations.
  • main.go: Extract the inputs and call the formula’s methods (coded on formula/*).
  • formula/*: Code the formula’s behavior.

To change the formula’s behavior for this language, you’ll have at least to update the following files:

  • config.json: Update the inputs configurations.
  • main.java: Extract the inputs and call the formula’s methods (coded on formula/*).
  • formula/*: Code the formula’s behavior.

To change the formula’s behavior for this language, you’ll have at least to update the following files:

  • config.json: Update the inputs configurations.
  • index.js: Extract the inputs and call the formula’s methods (coded on formula/*).
  • formula/*: Code the formula’s behavior.

To change the formula’s behavior for this language, you’ll have at least to update the following files:

  • config.json: Update the inputs configurations.
  • main.py: Extract the inputs and call the formula’s methods (coded on formula/*).
  • formula/*: Code the formula’s behavior.

To change the formula’s behavior for this language, you’ll have at least to update the following files:

  • config.json: Update the inputs configurations.
  • main.sh: Extract the inputs and call the formula’s methods (coded on formula/*).
  • formula/*: Code the formula’s behavior.

Last modified June 15, 2021: fix: change all image links (9612361c)