We love contributions! The easiest way to contribute to the Tree Traversal Explorer is by adding or improving support for programming languages and pseudocode syntaxes.
Our architecture is entirely language-agnostic. You can add a new language just by creating a .lang file inside the languages/ directory.
- Create a new file in
languages/named after your language (e.g.,ruby.langorpseudocode-edexcel.lang). - Follow the Language Format Documentation to define how your language builds objects, declares classes, and writes its logic.
- Test your
.langfile. - When deploying, the
manifest.jsonfile is automatically built to detect all.langfiles in the folder. You do not need to manually update the manifest.
- Be Idiomatic: Write the code as it would be written by a seasoned developer in that language. Use the standard libraries and naming conventions of the language.
- Support all Arities (if applicable): Try to support Binary, Ternary, and N-ary tree structures. If a language is highly specific or limited (e.g. strict pseudocodes), you may only support Binary.
- Use Inline Hooks: Utilize
[nary],[!nary],[ternary], etc., to avoid duplicating classes or structure for different tree types.
The .lang format supports a categories metadata property.
Forks of this repository are free to use categories in whatever way best suits their audience.
However, in this primary repository, we strictly use categories for language descriptors (e.g., OOP, Relational) and exam boards.
When specifying an exam board, you must prefix it with the country flag emoji (e.g., 🇬🇧 AQA, 🇬🇧 OCR, 🇬🇧 Edexcel).
If you want to run the project locally and add a new language:
- Clone the repository.
- Ensure you have Node.js installed.
- Test your
.langsyntax usingnode scripts/validate-all.mjs(this parses the template looking for syntax errors to ensure it will deploy). - Update your local manifest by running
node scripts/generate-manifest.mjs. Note: DO NOT commit changes tomanifest.json. The CI/CD pipeline dynamically regenerates the manifest upon deployment to guarantee it is up-to-date, so any checked-in changes will cause merge conflicts or be overwritten. - Run a local web server in the root directory (e.g.
npx serve .orpython -m http.server). - Access
index.htmlto see the Tree Traversal Explorer in action.