-
Notifications
You must be signed in to change notification settings - Fork 0
How to add a language plugin?
0. Follow example plugin pull request (python)
Changes made there will help you navigate through project structure.
In this step you should set up compiler for your language for later tests via GitHub Actions. Don't forget a cute emoji in the name :)
You will have to add your language name-constructor pair to LANGUAGES constant object.
Language name should be key and language constructor as Constructor
- value.
In general, your plugin may be similar to Python3 plugin. However, syntax and markdown in most cases will be different.
NB! Your plugin should be able to generate at least two variants of code: human-readable and non-human-readable. If you would like other settings, consider getting them from Settings
object in construct()
function (check langs/javascript.ts
).
At first, consider editing type()
function with your language types implementation.
Then comes create_function_for_line()
function for creating a function for each log line.
Finaly, if your plugin builds, you can style it with CSS via CODE_STYLE
array with RegExps as keys and css-strings as values.
You should create InEntry array for your test string and compile it with default (TypeScript) plugin with check_default()
function. All your plagin variants outputs should match the result.
Yuo can pass variables to your plugin with process.env
, them construct the code with your plugin, launch and capture output with check_code()
function. If the output matches default, you won!