RemiSlang
RemiSlang are a set of bindings for S-Lang for the Crystal programming language.
Wanna support this project? Buy Remilia a coffee on Ko-Fi, or support her through Liberapay.
How do I get set up?
Add this to your shard.yml
:
dependencies:
yunosynth:
fossil: https://chiselapp.com/user/MistressRemilia/repository/remislang
You will need Fossil installed to clone this repo and the dependency. You will also need Shards v0.17.1 or later. If you have an earlier version of Shards, you will need to to build the latest version manually.
Usage
See the example.cr
in the root of the repository for a quick demonstration on
how to use these bindings. A more full set of examples will eventually be
added.
The basic idea is:
require "remislang"
# Some aliases to save typing
alias Slang = RemiSlang
alias Screen = RemiSlang::Screen
alias Input = RemiSlang::Input
# withSlang will automatically handle initialization and deinitialization.
# It should be preferred in most cases.
# Initialize S-Lang and request TTY keypad handling.
Slang.withSlang(tty: Slang::TtyInit::Full) do
Screen.clear # Clear the screen
Screen.hideCursor # Hide the cursor
# ...call more stuff in Slang and Screen...
end
Style info
I use a somewhat non-standard style for my code.
- Keep lines 118 characters or shorter. Obviously sometimes you can't, but please try. Use 80 or 115 characters for Markdown files, though.
- Please use pascalCase for variable and method names. Use CamelCase for type
names. Use
UPPER_SNAKE_CASE
for constants. - ALWAYS put parentheses around method parameters, except for these methods:
puts
,pp
,p
,raise
,sleep
,spawn
,loop
, andexit
. - Always the full
do |foo|...end
syntax with blocks, except when it's all on one line, then always use { and }. - The type name for exceptions end with Error. For example,
ExternalProgramError
.
How do I contribute?
- Go to http(s)://chiselapp.com/user/MistressRemilia/repository/remislang and clone the Fossil repository.
- Create a new branch for your feature.
- Push locally to the new branch.
- Create a bundle with Fossil that contains your changes.
- Get in contact with me.
Contributors
- Remilia Scarlet - creator and maintainer
- Homepage: https://remilia.sdf.org/
- Mastodon: @MistressRemilia@social.sdf.org
- Email: zremiliaz@postzeoz.jpz My real address does not contain Z's
Links and Licenses
RemiSlang is under the GNU Affero General Public License version 3.