SyntxCode Demo

Testing syntxcode syntax highlighting.

HTML


<div class="container">
  <h1>Hello World</h1>
</div>
    

CSS


h1 {
  color: red;
  margin: 1rem;
}
    

JavaScript (Dark Theme)


function add(a, b) {
  return a + b;
}
    

Github Dark Theme


h1 {
  color: red;
  margin: 1rem;
}
    

Ruby (Light Theme)


module MathUtils
  PI = 3.1415

  def self.circle_area(radius)
    PI * radius**2
  end
end

# comment
radius = 5
puts "Circle area: #{MathUtils.circle_area(radius)}"

email_pattern = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/i
email = "test@example.com"
puts "Email valid" if email =~ email_pattern