Display code with proper formatting and syntax highlighting for 100+ programming languages.
Wrap text in backticks (`) to format it as inline code within a sentence.
Use code for inline code snippets.
The console.log() function prints to the console.
Install with npm install package-name.
Use three backticks (```) on separate lines to create a fenced code block.
function hello() {
return "Hello, World!"
}Add a language identifier after the opening backticks to enable syntax highlighting.
javascript
const greeting = "Hello, Markdown!"
console.log(greeting)python
def greet(name):
return f"Hello, {name}!"You can also create code blocks by indenting every line with at least four spaces or one tab. Fenced code blocks are generally preferred.
// Indented with 4 spaces
const x = 42
console.log(x)