Skip to content

Latest commit

 

History

History
53 lines (43 loc) · 821 Bytes

code-block.md

File metadata and controls

53 lines (43 loc) · 821 Bytes

Code block

Example without tabs

def greeting(name)
  puts "Hello #{name}"
end
greeting("Anna")

Example with tabs

{% tabs %} {% tab title="Ruby" %}

def greeting(name)
  puts "Hello #{name}"
end
greeting("Anna")

{% endtab %}

{% tab title="Elixir" %}

greeting = fn (name) -> "Hello, #{name}!" end
greeting.("Anna")

{% endtab %} {% endtabs %}

Example with filename

{% code title="greeting.rb" %}

def greeting(name)
  puts "Hello #{name}"
end
greeting("Anna")

{% endcode %}

JavaScript example

{% code title="index.js" overflow="wrap" lineNumbers="true" %}

‌import * as React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

ReactDOM.render(<App />, window.document.getElementById('root'));

{% endcode %}