Living Style Guide
Components
Attributes
- Name
- Crystal
- OS
- Linux
- MacOS
- Windows
- Version
- 1.11.2
Code
Book Authors
Include partial: _includes/components/book-authors.html
Code
Book Presenter
Include partial: _includes/components/book-presenter.html
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quia quos autem veniam libero! Deleniti nemo quas optio voluptas voluptatibus sint ratione. Id vel error quia ipsam sit saepe hic at amet excepturi ea.
You can get it from these vendors:
Code
Breadcrumbs
Include partial: _includes/site/breadcrumbs.html
Basic
Section Main
Non-link Item
No section
Code
Card
Code
Card list
Include partial: _includes/pages/sponsors/top_sponors.html
- 84codes €22,000 per month since Apr 1, 2018 €545,000
- Manas.Tech $5,000 per month since Jun 19, 2009 $1,340,000
Code
Copy Action
This component adds a copy button to an element (primarily intended for code blocks) which writes the content of the element to the clipboard.
Code
Image List
Include partial: _includes/components/image-list.html
Code
Link Actions
A set of links which are displayed together. Attached icons are automatically derived from the target URL.
Code
Link Item
Code
Partner Images
Code
Post Card
Code
Post Teaser
Include partial: _includes/posts/meta.html
Code
Profile Card
Include partial: _includes/components/profile-card.html
Code
Side Section
Aside 1
Aside 2 (Reversed)
Code
Testimonial Profile
Include partial: _includes/components/testimonial-profile.html
Peter Schols, CEO, Diploid
Isaac Sloan, CIO & Software Architect, Nikola Motor Company
I love working with Crystal. It has a lot of the happiness value that Ruby had at the beginning, and the community is doing really amazing things.
Code
Topics
Become a Crystal sponsor in only 3 simple steps via OpenCollective
ContributeSponsoring Crystal creates a great springboard for your brand
Get SupportYou can tap into the expertise of the very creators of the language to guide you in your implementation.
Hire UsCode
Elements
Hex Icon
Include partial: _includes/elements/hex-icon.html
Code
Hex Button
Code
Typography
Basics
Crystal’s syntax is heavily inspired by Ruby’s.
So it feels natural to read and easy to write, and has the added benefit of
a lower learning curve for experienced Ruby devs: cat [crystal](https://) > /dev/brain
.
The slick syntax makes it easy to read
for humans, but it’s also fast on machines.
On the Crystal Forum you can meet humans
interested in Crystal.
Press Ctr C to end the process.
Code
Blockquotes
Thank you! Crystal is awesome!
I am always happy to read the release notes. Awesome work, guys!
We are delivering a new release with several bugfixes and improvements. Below we list the most important or interesting changes, without mentioning several bugfixes and smaller enhancements. For more details, visit the changelog.
Breaking changes are marked with ⚠️.
- Point 1
- Point 2
Multi assign = heaven
.
Code
Callout: Generic (with title)
To use this new release you will need to build shards from sources or use a nightly Crystal release until 1.0.0-pre1 is tagged.
Code
Callout: Generic
Generic callout use this new release you will need to build shards from nightly Crystal release until 1.0.0-pre1 is tagged.
With nested blockquote. Ye’a!
NOTE: Attention No nested callout.
Code
Callout: Types
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
Code
Code Block
# A very basic HTTP server
require "http/server"
server = HTTP::Server.new do |context|
context.response.content_type = "text/plain"
context.response.print "Hello world, got #{context.request.path}!"
end
puts "Listening on http://127.0.0.1:8080"
server.listen(8080)
name: my-project
version: 0.1
license: MIT
crystal: 1.3.0
dependencies:
mysql:
github: crystal-lang/crystal-mysql
All types are non-nilable in Crystal, and nilable variables are represented as a union between the type and nil.
if rand(2) > 0
my_string = "hello world"
end
puts my_string.upcase
$ crystal build hello-world.cr
$ ./hello-world
Hello World!
class Object
def has_instance_var?(name) : Bool{{ @type.instance_vars.map &.name.stringify }}.includes? name
end
end
class Person
property name : String
def initialize(@name)
end
end
person = Person.new "John"
p! person.has_instance_var?("name") # => true
p! person.has_instance_var?("birthday") # => false
Code
Figure
Code
Footnotes
Lorem ipsum dolor sit amet consectetur adipisicing elit.1 Quod labore suscipit animi2 consequatur. Accusantium quibusdam dolorum at a, numquam deserunt.
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quia quos autem veniam libero!1 Deleniti nemo quas optio voluptas voluptatibus sint ratione. Id vel error quia ipsam sit saepe hic at amet excepturi ea. Voluptas sunt ratione consequatur optio porro eaque nam quod ex illum modi id animi fugiat vero explicabo illo officiis assumenda nulla rerum, dignissimos sed dicta pariatur quis eum. Beatae ea cumque alias ducimus quos maxime sed, modi illum at repellendus, ex deleniti nesciunt tempore placeat in accusantium!
-
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Amet voluptas dicta dolor. ↩ ↩2
-
Voluptas sunt ratione consequatur optio porro eaque nam quod ex illum modi. ↩
Code
Headlines
Headline 1
Headline 2
Headline 3
Headline 4
Headline 5
Headline 6
Headline 1
We are delivering a new release with several bugfixes and improvements. Below we list the most important or interesting changes, without mentioning several bugfixes and smaller enhancements.
Headline 2
We are delivering a new release with several bugfixes and improvements. Below we list the most important or interesting changes, without mentioning several bugfixes and smaller enhancements.
Headline 3
We are delivering a new release with several bugfixes and improvements. Below we list the most important or interesting changes, without mentioning several bugfixes and smaller enhancements.
Headline 4
We are delivering a new release with several bugfixes and improvements. Below we list the most important or interesting changes, without mentioning several bugfixes and smaller enhancements.
Headline 5
We are delivering a new release with several bugfixes and improvements. Below we list the most important or interesting changes, without mentioning several bugfixes and smaller enhancements.
Headline 6
Code
Inline Elements
code element
A11Y
mark element
Code
Definition List
- Crystal
- We are delivering a new release with several bugfixes and improvements. Below we list the most important or interesting changes, without mentioning several bugfixes and smaller enhancements.
- Shards
- We are delivering a new release with several bugfixes and improvements. Below we list the most important or interesting changes, without mentioning several bugfixes and smaller enhancements.
Code
Ordered List
- Fast as C
- Slick as Ruby
- Crystal uses green threads, called fibers, to achieve concurrency. Fibers communicate with each other using channels, as in Go or Clojure, without having to turn to shared memory or locks.
-
Crystal libraries are packed as Shards, and distributed via Git without needing a centralised repository.
Built in commands allow dependencies to be easily specified through a YAML file and fetched from their respective repositories.
-
Crystal 1.3.0 (2022-01-06) LLVM: 13.0.0 Default target: x86_64-unknown-linux-gnu
Code
Unordered List
- Fast as C
- Slick as Ruby
- Crystal uses green threads, called fibers, to achieve concurrency. Fibers communicate with each other using channels, as in Go or Clojure, without having to turn to shared memory or locks.
-
Crystal libraries are packed as Shards, and distributed via Git without needing a centralised repository.
Built in commands allow dependencies to be easily specified through a YAML file and fetched from their respective repositories.
-
Crystal 1.3.0 (2022-01-06) LLVM: 13.0.0 Default target: x86_64-unknown-linux-gnu
Code
Horizontal Rule
First paragraph.
Second paragraph.
Code
Table
Operator | Description | Example | Overloadable | Associativity |
---|---|---|---|---|
|
positive | 1 |
yes | right |
& |
wrapping positive | & 1 |
yes | right |
- |
negative | -1 |
yes | right |
&- |
wrapping negative | &-1 |
yes | right |
Code
Properties Table
1.3.2 | 2022-01-18 |
---|---|
1.3.1 | 2022-01-13 |
1.3.0 | 2022-01-06 |