plugincomponent
UtilitiesEasy Code Highlighter
Code Highlighter Plugin for Joomla

DemoPHP with line highlight
<?php
declare(strict_types=1);
function greet(string $name): string
{
return "Hello, {$name}!";
}
echo greet("Joomla");[codehighlight id=1]
DemoCSS sample
.sample-card {
border-radius: 8px;
border: 2px solid #f59e0b;
padding: 1rem;
font-weight: 600;
}[codehighlight id=2]
DemoJavaScript fetch helper
async function loadPosts(url) {
const response = await fetch(url);
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
return response.json();
}
loadPosts("/api/posts.json").then(console.log);[codehighlight id=3]
DemoHTML markup
<section class="hero">
<h1>Easy Code Highlighter</h1>
<p>Prism.js syntax highlighting for Joomla.</p>
<a class="button" href="#docs">Read the docs</a>
</section>[codehighlight id=4]
DemoSQL query
SELECT a.id, a.title, a.language
FROM #__easycodehighlighter AS a
WHERE a.state = 1
ORDER BY a.ordering ASC, a.title ASC;[codehighlight id=5]
DemoPython snippet
from pathlib import Path
def read_lines(path: str) -> list[str]:
return Path(path).read_text(encoding="utf-8").splitlines()
print(read_lines("readme.txt")[:5])[codehighlight id=6]