Skip to content

Instantly share code, notes, and snippets.

@jsvensson
Created December 3, 2012 22:48
Show Gist options
  • Save jsvensson/4198846 to your computer and use it in GitHub Desktop.
Save jsvensson/4198846 to your computer and use it in GitHub Desktop.
Octopress code PHP highlight test

Triple backticks

With opening tag, no closing tag

<?php 
  public function __construct(){
    parent::__construct();
  }

With both opening/closing tag

<?php 
  public function __construct(){
    parent::__construct();
  }
?>

No opening/closing tag

public function __construct(){
  parent::__construct();
}

No opening/closing tag, full Class syntax

class Foo extends Bar
{
  public function __construct(){
    parent::__construct();
  }
}

With opening/closing tag, full Class syntax

<?php
class Foo extends Bar
{
  public function __construct(){
    parent::__construct();
  }
}
?>

Partial code

function Dbug() { }

function inspect($var,$forceType="",$bCollapsed=false) {
  ...
// Empty constructor for CodeIgniter
function Dbug() { }

// Rename the original constructor
function inspect($var,$forceType="",$bCollapsed=false) {
  ...

Using codeblock plugin

With opening tag, no closing tag

{% codeblock lang:php %}

{% endcodeblock %}

No opening/closing tag

{% codeblock lang:php %} public function __construct(){ parent::__construct(); } {% endcodeblock %}

No opening/closing tag, full Class syntax

{% codeblock lang:php %} class Foo extends Bar { public function __construct(){ parent::__construct(); } } {% endcodeblock %}

With opening/closing tag, full Class syntax

{% codeblock lang:php %}

{% endcodeblock %}

Partial code

{% codeblock lang:php %} function Dbug() { }

function inspect($var,$forceType="",$bCollapsed=false) { ... {% endcodeblock %}

{% codeblock lang:php %} // Empty constructor for CodeIgniter function Dbug() { }

// Rename the original constructor function inspect($var,$forceType="",$bCollapsed=false) { ... {% endcodeblock %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment