-
Notifications
You must be signed in to change notification settings - Fork 123
Contributing Exercise Solutions
martin-henz edited this page Oct 14, 2019
·
4 revisions
You can contribute in the following two ways.
Go to Issues and click on "New Issue". Then just enter your solution. We will take a look and include it in the textbook if it's correct. It's very useful to add test cases, which we can then include as examples in the textbook.
If you want to contribute to exercise solutions via Git and XML, using a Pull Request, you need to know the basics of Git, and the structure of SNIPPET
tags. Here are the components:
-
NAME
: optional; at most one; allows otherSNIPPET
s to refer to and "require" this program. Example:<NAME>my_program</NAME>
-
REQUIRES
: optional; multiple allowed; allows thisSNIPPET
to recursively include other snippets by including their name. Example:<REQUIRES>my_other_program</REQUIRES>
. All "required" programs are placed before the snippet when displayed in the Source Academy. The "required" programs are not displayed in the textbook editions. -
EXAMPLE
: optional; at most one; allows thisSNIPPET
to recursively include anotherSNIPPET
by including its name. Example:<EXAMPLE>my_example_program</NAME>
. The "example" program is placed after the snippet when displayed in the Source Academy. The "example" program is not displayed in the textbook editions. -
SCHEME
: optional; here goes the Scheme version; feel free to ignore -
JAVASCRIPT
: required for all practical purposes: Include the JavaScript version here.
Attributes of SNIPPET
tags include:
-
HIDE = yes
: (default: no) The program is not displayed in the textbook editions. -
LATEX = yes
: (default: no) The program contains LaTeX formulas using $$ syntax. -
EVAL = no
: (default: yes) The program is not clickable.