🎉 Nextra 4.0 is released. Read more →
AboutPosts

Code blocks

Dimitri POSTOLOV,•1 min read

Test filename, line highlighting and empty lines

test.js
console.log('hello world') console.log('goodbye world')

Test showLineNumbers and word highlighting

object Hello { def main(args: Array[String]) = { println("hello, world") } } object Hello { def main(args: Array[String]) = { println("hello, world") } }

Test highlighting inline code

import React from 'react'

Test without specified language

hello world

Test with code block default language

const links = [ { href: '/settings', label: 'Settings' }, { href: '/support', label: 'Support' }, { href: '/license', label: 'License' }, ]

Link to google

Link to GitHub 

CC BY-NC 4.0 2024 © Dimitri POSTOLOV.RSS