crystal-by-example
Crystal By Example
A collection of examples intended to show how to use Crystal. Based on Mark McGranaghan's Go By Example site.
Check it out at crystalbyexample.tams.tech
Dependencies
- Crystal (if compiling the renderer or generate-hash script)
- Python3 and python-pygments for syntax highlighting.
Development
Examples are placed in src/examples/{example name}/{example name}.cr. Shell commands can also be demonstrated by placin them in a file at src/examples/{example name}/{example name}.sh. Comments are formatted with markdown and presented to the left of the block of code they immediately preceed.
Once your example is written, it needs to be rendered:
- run
./generate-hash-file {example name}
- add your example's name to examples.txt
- run
./crystal-by-example
Your example will now be among the other rendered HTML files in public
.
Contributing
- Fork it (https://github.com/dscottboggs/crystal-by-example/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Scott Boggs - creator and maintainer
License
This project is based on the Go By Example site by Mark McGranaghan, which is licensed under a Creative Commons Attribution 3.0 Unported License, and as such carries the same license.
crystal-by-example
- 4
- 0
- 0
- 0
- 1
- almost 5 years ago
- February 15, 2020
Sun, 22 Dec 2024 09:48:53 GMT