• Stars
    star
    384
  • Rank 108,384 (Top 3 %)
  • Language Makefile
  • License
    Other
  • Created almost 8 years ago
  • Updated 29 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Crystal reference with language specification, manuals and learning materials

Crystal Programming Language

This is the language reference for the Crystal programming language.

Crystal is a programming language with the following goals:

  • Have a syntax similar to Ruby (but compatibility with it is not a goal).
  • Be statically type-checked, but without having to specify the type of variables or method parameters.
  • Be able to call C code by writing bindings to it in Crystal.
  • Have compile-time evaluation and generation of code, to avoid boilerplate code.
  • Compile to efficient native code.

Crystal's standard library is documented in the API docs.

Contributing to the Language Reference

Do you consider yourself a helpful person? If you find bugs or sections which need more clarification you're welcome to contribute to this language reference. You can submit a pull request to this repository: https://github.com/crystal-lang/crystal-book

Thank you very much!

Building and Serving Locally

$ git clone https://github.com/crystal-lang/crystal-book
$ cd crystal-book
$ pip install -r requirements.txt

Live preview (at http://127.0.0.1:8000):

$ make serve
INFO    -  Building documentation...
INFO    -  Cleaning site directory
INFO    -  Documentation built in 3.02 seconds
INFO    -  Serving on http://127.0.0.1:8000
...

Build into the site directory (some functionality won't work if opening the files locally):

$ make build

devenv environment

This project includes configuration for a reproducible environment via devenv.sh with integrated pre-commit checks.

Live preview (at http://127.0.0.1:8000):

$ devenv up
Building shell ...
pre-commit-hooks.nix: hooks up to date
17:37:13 system  | serve.1 started (pid=6507)
17:37:13 serve.1 | INFO     -  Building documentation...
17:37:13 serve.1 | INFO     -  Cleaning site directory
17:37:16 serve.1 | INFO     -  Documentation built in 2.64 seconds
17:37:16 serve.1 | INFO     -  [17:37:16] Watching paths for changes: 'docs', 'mkdocs.yml'
17:37:16 serve.1 | INFO     -  [17:37:16] Serving on http://127.0.0.1:8000/reference/latest/

Build the site:

$ devenv shell build
Building shell ...
pre-commit-hooks.nix: hooks up to date
rm -rf ./site
mkdocs build -d ./site  --strict
INFO     -  Cleaning site directory
INFO     -  Building documentation to directory: ./site
INFO     -  Documentation built in 2.43 seconds

Enter the development shell and build the site from there:

$ devenv shell
Building shell ...
Entering shell ...

pre-commit-hooks.nix: hooks up to date
$(devenv) make build
mkdocs build -d ./site  --strict
INFO     -  Cleaning site directory
INFO     -  Building documentation to directory: ./site
INFO     -  Documentation built in 2.43 seconds

Run pre-commit checks on the entire repository:

$ devenv ci

Adding a page

To add a page, create a Markdown file in the desired location. Then, add a link in the SUMMARY.md file which acts as the navigation for the language reference.

More Repositories

1

crystal

The Crystal Programming Language
Crystal
19,110
star
2

shards

Dependency manager for the Crystal language
Crystal
753
star
3

crystal-db

Common db api for crystal
Crystal
297
star
4

crystal_lib

Automatic binding generator for native libraries in Crystal
Crystal
139
star
5

crystal-sqlite3

SQLite3 bindings for Crystal
Crystal
131
star
6

heroku-buildpack-crystal

Heroku buildpack for Crystal
Shell
123
star
7

crystal-mysql

MySQL connector for Crystal
Crystal
106
star
8

install-crystal

GitHub Action: Install Crystal programming language
JavaScript
67
star
9

html_builder

DSL for creating HTML
Crystal
62
star
10

crystal-website

crystal-lang.org website
SCSS
57
star
11

clang.cr

libclang bindings for crystal (including automatic C bindings generator)
Crystal
46
star
12

crystal-presents

Playground for creating crystal presentations with live coding
CSS
40
star
13

distribution-scripts

Shell
39
star
14

crystal-molinillo

A generic dependency resolution algorithm. Ported from https://github.com/CocoaPods/Molinillo/
Crystal
29
star
15

omnibus-crystal

Omnibus builder for Crystal
Ruby
25
star
16

perf-tools

An assortment of tools to track resources in Crystal applications
Crystal
23
star
17

bootstrap-script

Automated script to bootstrap the crystal compiler from source
Shell
22
star
18

crystal-readline

Crystal bindings to GNU Readline Library
Crystal
21
star
19

json_mapping.cr

Crystal
18
star
20

rfcs

RFCs repository for Crystal
17
star
21

crystal-env

Crystal
13
star
22

logger.cr

Crystal
13
star
23

homebrew-crystal

Homebrew Tap for Crystal development
Ruby
13
star
24

yaml_mapping.cr

Crystal
8
star
25

crystal-dist

Docker workspace to sign and release Crystal binaries to repositories
Shell
7
star
26

test-ecosystem

Shell
6
star
27

crystal-infrastructure

Infrastructure automation for Crystal related resources
Jinja
4
star
28

crystal-random

Crystal
3
star
29

osc-docker

Dockerfile for pushing to Open Build Service
Dockerfile
1
star
30

.github

Default community health files
1
star