Cedar comes included with a Syntax Highlighter for code blocks, using HighlightJS. As well as generic pattern matching, it has support for the following languages:
Syntax highlighting is a feature which displays text, especially source code, in different colors and fonts according to the category of terms.
- JavaScript
- TypeScript
- HTML/XML
- SCSS
- SQL
- Lua
- Python
- Markdown
- Swift
- Nginx
- JSON
- Haskell
- HTTP
- PHP
- Makefile
- CSS
- C/C++
- C#
- Objective-C
- Perl
- Bash
- Ruby
- Handlebars
- Go
- Java
- Apache
Below is a preview of some of the above languages being highlighted.
JavaScript
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337/');
HTML / CSS
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
.wrapper{
max-width:1400px;
width:100%;
@media (max-width: 1470px) {
padding:0 2.5%;
}
}
Python
def openFile(path):
file = open(path, "r")
content = file.read()
file.close()
return content
Ruby
def self.consume_front(str, size)
str[0..size] = ''
str.lstrip!
end
Shell
$ ls -la /home
PHP
function ivy_get_time(){
if(get_theme_mod('layout_use_custom_date_format', false)) {
the_date();
} else {
the_time('jS F Y ');
}
}