Logo: Relish

  1. Sign in

Project: Koios

Block formatting

Some block formatting are available:

  • code block (with or without mention of language)
  • preformated block
Scenarios
A code block can be defined without a language
When
I execute the following koios code:
Koios::Doc.write {[
  code('bundle exec cucumber')
]}
Then
the markdown output is:

``
bundle exec cucumber
``
In a code block, each argument is a new line
When
I execute the following koios code:
Koios::Doc.write {[
  code('gem install bundler',
       'bundle install koios')
]}
Then
the markdown output is:

``
gem install bundler
bundle install koios
``
The language of a code block can be describe using `code_for`
When
I execute the following koios code:
Koios::Doc.write {[
  code_for('ruby',
           'Koios::Doc.write {[',
           ']}')
]}
Then
the markdown output is:

``ruby
Koios::Doc.write {[
]}
``
A string can be converted in a preformatted block
When
I execute the following koios code:
Koios::Doc.write {[
  'This is a preformatted block'.pre
]}
Then
the markdown output is:
    This is a preformatted block
In a preformatted block, each argument is a new line
When
I execute the following koios code:
Koios::Doc.write {[
  pre('This is a',
      'preformatted',
      'block')
]}
Then
the markdown output is:
    This is a
    preformatted
    block
Multiline string are available in code or pre blocks
When
I execute the following koios code:
Koios::Doc.write {[
  pre('''This is
a
preformatted
block''')
]}
Then
the markdown output is:
    This is
    a
    preformatted
    block
When
I execute the following koios code:
Koios::Doc.write {[
  code('''gem install bundler
gem install koios''')
]}
Then
the markdown output is:

``
gem install bundler
gem install koios
``

Last published over 4 years ago by eunomie.