Skip to the content.

Chalk has several types of elements for different purposes:

Standard Elements

Standard elements use the standard syntax pattern identifier{...}[...](...) and are defined in your library:

blog-post{
    ...
}(author: John Doe; published: 2024-01-01)

chart{
    ...
}[
    ...
](
    attr1: value1
    attr2: value2
)

square(size: 10)

Custom Elements

Custom elements use non-standard syntax patterns that don’t follow the standard identifier{...}[...](...) format:

# Heading 1
## Heading 2

This is a paragraph.

**bold text**

Custom elements are processed by specialized parsers that handle specific syntax patterns.

Meta-Elements

Meta-elements start with @ and control document processing:

@const(name: John Doe; version: 1.0)
@include(src: header.chalke)

Constants

Define reusable values:

@const(name: John Doe; version: 1.0)

Constants can be referenced using ``:

Welcome, !

signature(version: )

Include

Include external .chalke chalk element files:

@include(src: header.chalke)
@include(src: footer.chalke)

Headers

Document headers use *(...) syntax:

*(
    title: My Document
    author: John Doe
    date: 2024-01-01
)

Containers

Containers are anonymous elements that group content to apply attributes to multiple elements at once:

{
    # Container content
    More content here
}(
    attr: value
)

Element Structure

All elements follow this general pattern:

identifier{
    body content
}[
    detail content
](
    attributes
)

Next Steps