Welcome to the Sample Programs in Every Language Website repository. Here, the documentation for all the code snippets is maintained.
If you'd like to contribute, you're welcome to make any additions or changes you like to the source files (see sources folder). These files are used to automatically generate the documentation.
See our list of issues to get started or create your own!
If you wish to build a local copy of the website, create a virtualenv, activate it, and install
requirements.txt
:
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt
You should only need to do the above once. All other times, just activate the virtualenv with the
source
command.
Now, run generate.sh
. This will build the website, create a temporary web server, and open
up the home webpage in your default browser at http://localhost:8000/index.html
. When you are done,
just press Ctrl+C to exit the web server.
Images for articles that are suppose to be modified by image-titler should be
placed in sources/images
. The filename should look like this:
<project>-in-<language>.<extension>
where:
<project>
is the name of the project in lowercase, with spaces converted to dashes. For example:even-odd
forEven Odd
<language>
is the name of the language in lowercase, with spaces converted to dashes, and symbols like+
converted to words. Examples:c-plus-plus
forC++
c-sharp
forC#
google-apps-script
forGoogle Apps Script
<extension>
is the image file extension, such asjpg
,png
, etc.
All other images are stored in the following directories:
- Project:
docs/assets/projects/<project>
- Language:
docs/assets/languages/<language>
- Sample Program:
docs/assets/projects/<project>/<language>
In the article, you can reference these like this:
![Name of image](<image-directory>/<image-filename>)
where <image-directory>
is the directory where the image is stored without docs
.
For example:
![Space Loop 1](/assets/images/projects/baklava/piet/space-loop1.png)