Syntax Highlighting

What about the syntax

Kitabu uses Route as the syntax highlight formatter. It emits an output compatible with stylesheets designed for pygments, the Python library used by many.

To highlight a code block, use the fenced block syntax. The following example would be formatted as Ruby.

```ruby
class User
  attr_accessor :name, :email

  def initialize(name, email)
    @name = name
    @email = email
  end
end
```

The output would be something like this:

class User
  attr_accessor :name, :email

  def initialize(name, email)
    @name = name
    @email = email
  end
end

If you’re using Sublime Text, make sure you install the Markdown Extended plugin; it enables code syntax highlighting on your Markdown files.

You can also provide inline options such as line numbers and inline rendering.

```ruby?line_numbers=1
class User
  attr_accessor :name, :email

  def initialize(name, email)
    @name = name
    @email = email
  end
end
```

This would be rendered like this:

1
2
3
4
5
6
7
8
class User
  attr_accessor :name, :email

  def initialize(name, email)
    @name = name
    @email = email
  end
end

Lexers

Rouge comes with dozens of lexers. Check out this list, generated dynamically when you export your e-book.

And if what you want is not on this list, make you open a ticket on the project.