Skip to content

Commit 6e10ef2

Browse files
committed
Improve contribution guide
1 parent 0e274a8 commit 6e10ef2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

contribute.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ <h3>I want a new esolang/feature</h3>
2424
If the interpreter is in other languages but can be called from JavaScript (like C by using Emscripten), the JavaScript file should call the interpreter.
2525

2626
The function name should not be the same with function names for existing esolangs.
27+
28+
If you have a Python interpreter, add a Python file to link in the about.html file in the last step, and add a JavaScript file that calls the Python code (not the Python file) just like pyexec_example.html.
2729
<li>Add an <code>option</code> tag inside the <code>select</code> tag in the index.html file, the text should be the language name, like this:</li>
2830
<pre>
2931
&lt;option&gt;YourLang&lt;/option&gt;
@@ -34,6 +36,11 @@ <h3>I want a new esolang/feature</h3>
3436
&lt;script defer src=&quot;yourlang.js&quot;&gt;&lt;/script&gt;
3537
</pre>
3638
<code>script</code> tags should be sorted by their sources, in lexicographical order, just like the <code>option</code> tags.
39+
<li></li>In the <code>run</code> function, add a line of code that maps the option of the new esolang to the function, like this:</li>
40+
<pre>
41+
funcs["YourLang"]=yourlang;
42+
</pre>
43+
3744
<li>Finally, add the link to the language in the README.md file and add a row for this language in the about.html file, and update the number of languages and the version number.</li>
3845
Please do <b>NOT</b> do anything else or you'll mess up the repository!
3946
</p>

pyexec_example.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var yourlang_py_code=`code here`
1+
var yourlang_py_code=`code here`;
22
function yourlang(code,input){
3-
execute(yourlang_py_code,code,input,'yourlang');
3+
execute(yourlang_py_code,code,input,'YourLang');
44
}

0 commit comments

Comments
 (0)