Ivy is a masonry styled personal blog theme for the Ghost platform. Featuring a minimal, responsive, and content-focused design. Available for purchase at ThemeForest.

Tags


Syntax Highlighting

11th November 2014

Ivy comes inlcuded with a Syntax Highlighter for code blocks, using RainbowJS. Aswell as generic pattern mathcing, it has support for the following languages:

  • HTML/CSS
  • Python
  • Ruby
  • Shell
  • Java
  • PHP
  • CoffeeScript
  • C
  • Go
  • Scheme
  • Lua
  • C#
  • Haskell

Below is a preview of some of the above languages being highlighted.

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 openFile(path):
    file = open(path, "r")
    content = file.read()
    file.close()
    return content

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 '); 
    }
}

View Comments